UNPKG

threepipe

Version:

A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.

51 lines 1.71 kB
import { Class } from 'ts-browser-helpers'; declare const jsPropTypes: { readonly string: "string"; readonly number: "number"; readonly boolean: "boolean"; readonly object: "object"; }; export type JSPropTypes = (typeof jsPropTypes[keyof typeof jsPropTypes]) | `"${string}"` | `${number}` | `${boolean}`; type KeyofPropType = string; type ClassName = string; interface PropTypeArray { arrayOf: TypedType; type: 'Array'; } interface PropTypeObject { recordOf: Map<KeyofPropType, TypedType>; type: 'Object'; } interface PropTypeUnion { oneOf: Set<TypedType>; type: 'Union'; } export type TypedType = JSPropTypes | ClassName | 'null' | 'Object' | PropTypeUnion | PropTypeArray | PropTypeObject | { type: ClassName; }; export interface TypedClass<T = any> { key: ClassName; getId: (obj: any) => string; ctor: Class<T>; getLabel?: (obj?: T) => string | any; getIcon?: (obj?: T) => string | any; setName?: (obj: T, name: string) => void; } export declare class TypeSystem { static Classes: Map<string, TypedClass<any>>; static AddClass(def: TypedClass): void; static GetClass(type: TypedType): TypedClass<any> | undefined; static GetClassType(ctor: Class<any>): ClassName | undefined; static GetType(v: any, allowSerializable?: boolean): TypedType | false; static NonLiteral(type: TypedType): TypedType; static TypeToString(type: TypedType): string; /** * Returns true if `tar = src` is valid * @param src * @param tar * @constructor */ static CanAssign(src: TypedType, tar: TypedType): boolean; } export {}; //# sourceMappingURL=../../../src/plugins/extras/components/typeSystem.d.ts.map