module export enum NodeClassMask { Object = 1 << 0 , Variable = 1 << 1 , Method = 1 << 2 , ObjectType = 1 << 3 , VariableType = 1 << 4 , ReferenceType = 1 << 5 , DataType = 1 << 6 , View = 1 << 7 } interface Enum { [ id ] : number ; } function makeFlagFromString < Type > ( type , str ) { const flags = str . split ( " | " ) ; let result = 0 ; for ( const flag of flags ) { result |= type [ flag ] ; } return result as Type ; } export function makeNodeClassMask ( str ) { const classMask = makeFlagFromString < NodeClassMask > ( NodeClassMask as any , str ) ; if ( ! classMask ) { throw new Error ( " cannot find class mask for " + str ) ; } return classMask ; }