@zxh19890103/wik
Version:
The world-class JavaScript library for building large-scale digital warehouse both on 2D and 3D.
52 lines (51 loc) • 2.42 kB
TypeScript
import THREE from 'three';
import { Constructor, IDisposable } from '../interfaces';
import { GraphicObject } from '../interfaces';
import { IInjector } from '../interfaces';
import { IBehavior, IModeManager } from '../interfaces';
import { ISelectionManager } from '../interfaces';
import { WithClickCancel } from '../mixins/ClickCancel';
import { IWarehouse, IWarehouseOptional, Core, IList } from '../model';
import { Object3DList } from './Object3DList.class';
export declare abstract class Warehouse3D extends Core implements IWarehouse, IDisposable {
readonly mounted: boolean;
readonly layouted: boolean;
readonly scene: THREE.Scene;
readonly camera: THREE.Camera;
readonly renderer: THREE.Renderer;
readonly injector: IInjector;
readonly selectionManager: ISelectionManager;
readonly modeManager: IModeManager;
readonly typedLists: Map<string, Object3DList<THREE.Object3D>>;
abstract layout(data?: unknown): void | Promise<void>;
fireBehavior(type: string, target: THREE.Object3D, event?: any): void;
mount(scene: THREE.Scene, renderer: THREE.Renderer, camera: THREE.Camera): void;
dispose(): void;
queryListAll(): {
type: string;
value: IList<GraphicObject>;
}[];
queryList(type: string): IList<GraphicObject>;
addList<O extends THREE.Object3D>(type: string): Object3DList<O>;
removeList(type: string): void;
each(fn: (item: GraphicObject, type: string) => void, type?: string): void;
first<M extends GraphicObject>(type: string): M;
item(type: string, id: string): GraphicObject;
query(type: string, predicate: (item: unknown) => boolean): unknown[];
add<M extends THREE.Object3D = THREE.Object3D>(type: string, item: M): void;
update(type: string, item: THREE.Object3D, data: any): void;
remove(type: string, item: string | THREE.Object3D): void;
/**
* retains the data for layouting ,which is the initial data. default is null, you can overrides it in subclass.
*/
getLayoutData(): Promise<any>;
/**
* default is empty, you can overrides it.
*/
configModes(): Record<string, IBehavior[]>;
create<C extends Constructor<object>>(ctor: C, ...args: ConstructorParameters<C>): InstanceType<C>;
[Symbol.iterator](): Iterator<THREE.Object3D, any, undefined>;
}
export interface Warehouse3D extends WithClickCancel, IWarehouseOptional {
onTick(): void;
}