UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

56 lines (55 loc) 4.09 kB
import type { CoreObjectType, ObjectContent } from './ObjectContent'; import type { CorePoint } from './entities/point/CorePoint'; import type { CoreVertex } from './entities/vertex/CoreVertex'; import type { BaseCoreObject } from './entities/object/BaseCoreObject'; import type { CorePrimitive } from './entities/primitive/CorePrimitive'; type BaseCorePointInstance = CorePoint<CoreObjectType>; type BaseCorePointClassClass = typeof CorePoint<CoreObjectType>; type BaseCoreVertexInstance = CoreVertex<CoreObjectType>; type BaseCoreVertexClassClass = typeof CoreVertex<CoreObjectType>; type BaseCorePrimitiveInstance = CorePrimitive<CoreObjectType>; type BaseCorePrimitiveClassClass = typeof CorePrimitive<CoreObjectType>; type BaseCoreObjectInstance = BaseCoreObject<CoreObjectType>; type BaseCoreObjectClassClass = typeof BaseCoreObject<CoreObjectType>; export type CorePointClassFactoryCheckFunction = (object: ObjectContent<CoreObjectType>) => BaseCorePointClassClass | undefined; export type CorePointInstanceFactoryCheckFunction = (object: ObjectContent<CoreObjectType>, index: number) => BaseCorePointInstance | undefined; export type CoreVertexClassFactoryCheckFunction = (object: ObjectContent<CoreObjectType>) => BaseCoreVertexClassClass | undefined; export type CoreVertexInstanceFactoryCheckFunction = (object: ObjectContent<CoreObjectType>, index: number) => BaseCoreVertexInstance | undefined; export type CorePrimitiveClassFactoryCheckFunction = (object: ObjectContent<CoreObjectType>) => BaseCorePrimitiveClassClass | undefined; export type CorePrimitiveInstanceFactoryCheckFunction = (object: ObjectContent<CoreObjectType>, index: number) => BaseCorePrimitiveInstance | undefined; export type CoreObjectClassFactoryCheckFunction = (object: ObjectContent<CoreObjectType>) => BaseCoreObjectClassClass | undefined; export type CoreObjectInstanceFactoryCheckFunction = (object: ObjectContent<CoreObjectType>, index: number) => BaseCoreObjectInstance | undefined; export interface CoreFactoryFunctions { pointClass: CorePointClassFactoryCheckFunction; pointInstance: CorePointInstanceFactoryCheckFunction; vertexClass: CoreVertexClassFactoryCheckFunction; vertexInstance: CoreVertexInstanceFactoryCheckFunction; primitiveClass: CorePrimitiveClassFactoryCheckFunction; primitiveInstance: CorePrimitiveInstanceFactoryCheckFunction; objectClass: CoreObjectClassFactoryCheckFunction; objectInstance: CoreObjectInstanceFactoryCheckFunction; } export declare function registerFactoryFunctions(checkFunctions: CoreFactoryFunctions): void; export declare function corePointClassFactory(object: ObjectContent<CoreObjectType>): BaseCorePointClassClass; export declare function corePointInstanceFactory<T extends CoreObjectType>(object: ObjectContent<T>, index?: number): CorePoint<T>; export declare function coreVertexClassFactory(object: ObjectContent<CoreObjectType>): BaseCoreVertexClassClass; export declare function coreVertexInstanceFactory<T extends CoreObjectType>(object: ObjectContent<T>, index?: number): CoreVertex<T>; export declare function corePrimitiveClassFactory(object: ObjectContent<CoreObjectType>): BaseCorePrimitiveClassClass; export declare function corePrimitiveInstanceFactory<T extends CoreObjectType>(object: ObjectContent<T>, index?: number): CorePrimitive<T>; export declare function coreObjectClassFactory(object: ObjectContent<CoreObjectType>): BaseCoreObjectClassClass; export declare function coreObjectInstanceFactory<T extends CoreObjectType>(object: ObjectContent<T>, index?: number): BaseCoreObject<T>; export declare const ENTITY_CLASS_FACTORY: { point: typeof corePointClassFactory; vertex: typeof coreVertexClassFactory; primitive: typeof corePrimitiveClassFactory; object: typeof coreObjectClassFactory; coreGroup: null; }; export declare const ENTITY_INSTANCE_FACTORY: { point: typeof corePointInstanceFactory; vertex: typeof coreVertexInstanceFactory; primitive: typeof corePrimitiveInstanceFactory; object: typeof coreObjectInstanceFactory; coreGroup: null; }; export {};