import { EnumArrayProperty , EnumProperty , Int64Property , ReferenceMapProperty , SetProperty , ArrayProperty , BaseProperty , MapProperty , PropertyFactory , ReferenceArrayProperty , Uint64Property } from '@fluid-experimental/property-properties' ; import { TypeIdHelper } from '@fluid-experimental/property-changeset' ; import memoize from 'memoize-one' ; export class Utils { public static isReferenceCollectionTypeid = memoize ( ( typeid ) => { return TypeIdHelper . isReferenceTypeId ( typeid ) ; } ) ; public static isUint64Property ( property ) { return PropertyFactory . instanceOf ( property , 'Uint64' ) ; } public static isInt64Property ( property ) { return PropertyFactory . instanceOf ( property , 'Int64' ) ; } public static isEnumProperty ( property ) { return PropertyFactory . instanceOf ( property , 'Enum' ) ; } public static isEnumArrayProperty ( property ) { return PropertyFactory . instanceOf ( property , 'Enum' , 'array' ) ; } public static isReferenceArrayProperty ( property ) { return PropertyFactory . instanceOf ( property , 'Reference' , 'array' ) ; } public static isReferenceMapProperty ( property ) { return PropertyFactory . instanceOf ( property , 'Reference' , 'map' ) ; } public static isArrayProperty ( property ) { return property . getContext ( ) === 'array' ; } public static isMapProperty ( property ) { return property . getContext ( ) === 'map' ; } public static isSetProperty ( property ) { return property . getContext ( ) === 'set' ; } public static isReferenceProperty ( property ) { return PropertyFactory . instanceOf ( property , 'Reference' ) ; } param property return public static isCollectionProperty ( property ) { return ! ( property . getContext === undefined || property . getContext ( ) === 'single' ) ; } }