import { EnumClass , EnumIO , _from , _fromString } from '../misc/EnumIO' ; export type ShaderTypeEnum = EnumIO ; class ShaderTypeClass extends EnumClass implements ShaderTypeEnum { constructor ( { index , str } ) { super ( { index , str } ) ; } } const VertexShader = new ShaderTypeClass ( { index : 1 , str : 'VertexShader' , } ) ; const PixelShader = new ShaderTypeClass ( { index : 2 , str : 'PixelShader' , } ) ; const VertexAndPixelShader = new ShaderTypeClass ( { index : 3 , str : 'VertexAndPixelShader' , } ) ; const ComputeShader = new ShaderTypeClass ( { index : 4 , str : 'ComputeShader' , } ) ; const typeList = [ VertexShader , PixelShader , VertexAndPixelShader , ComputeShader , ] ; function from ( index ) { return _from ( { typeList , index } ) as ShaderTypeEnum ; } function fromString ( str ) { return _fromString ( { typeList , str } ) as ShaderTypeEnum ; } export const ShaderType = Object . freeze ( { VertexShader , PixelShader , VertexAndPixelShader , ComputeShader , from , fromString , } ) ;