UNPKG

@zxh19890103/wik

Version:

The world-class JavaScript library for building large-scale digital warehouse both on 2D and 3D.

62 lines (61 loc) 3.03 kB
import { IWarehouse, Core, GlobalConstManager, ModeManager, SelectionManager, HighlightManager, InteractiveStateActionManager, ListCtorArgs, IWarehouseOptional, ConfigProviderConfigValue } from '../../model'; import { GraphicObject, LayerWithID, ILogger, IBehavior, IInjector, Constructor } from '../../interfaces'; import { AnimationManager } from '../animation/AnimationManager.class'; import { ImageManager } from '../state'; import { PaneManager } from '../state/PaneManager.class'; import { WikMap } from './Map.class'; import { LayerList } from './LayerList.class'; type WarehouseEventType = 'click' | 'dblclick' | 'hover' | 'press' | 'contextmenu' | 'phase'; export declare abstract class Warehouse<LayoutData = any, OT extends string = string> extends Core<WarehouseEventType> implements IWarehouse { readonly injector: IInjector; private updateDeps; readonly animationManager: AnimationManager; readonly paneManager: PaneManager; readonly selectionManager: SelectionManager; readonly imageManager: ImageManager; readonly highlightManager: HighlightManager; readonly interactiveStateActionManager: InteractiveStateActionManager; readonly modeManager: ModeManager; readonly globalConsts: GlobalConstManager; readonly logger: ILogger; readonly scene: WikMap; readonly mounted: boolean; readonly layouted: boolean; private typedLists; [Symbol.iterator](): Generator<LayerWithID, void, unknown>; queryListAll(): any[]; queryList(type: OT): LayerList<LayerWithID, never>; each(fn: (item: GraphicObject, type: OT) => void, type?: OT): void; first<G>(type: OT): G; item(type: OT, id: string): LayerWithID; query<T extends LayerWithID>(type: OT, predicate: (item: T) => boolean): any[]; update(type: OT, item: LayerWithID, data: any): void; add(type: OT, item: LayerWithID): void; remove(type: OT, item: LayerWithID | string): void; addList(type: OT, list: LayerList<LayerWithID> | ListCtorArgs): any; removeList(type: OT): void; mount(map: WikMap): void; addUpdateDep<M extends LayerWithID = LayerWithID, D = any>(type: OT, fn?: ItemUpdateFn<M, D>): void; /** * retains the data for layouting ,which is the initial data. default is null, you can overrides it in subclass. */ getLayoutData(): Promise<LayoutData>; /** * default is empty, you can overrides it. */ configModes(): Record<string, IBehavior[]>; create<C extends Constructor>(ctor: C, ...args: ConstructorParameters<C>): InstanceType<C>; abstract layout(data?: LayoutData): void | Promise<void>; } export type ItemUpdateFn<M extends LayerWithID, D> = (item: M, data: D) => void; export interface Warehouse<LayoutData = any, OT extends string = string> extends IWarehouseOptional { } export declare enum WarehousePhase { mount = 1, mounted = 5, data = 10, layout = 20, ready = 40 } export declare const DEFAULT_WAREHOUSE_DEPENDENCIES: Record<symbol, ConfigProviderConfigValue>; export {};