import { DBaseShadow } from "./d-base"; import { DCanvasContainer, DCanvasContainerEvents, DCanvasContainerOptions, DThemeCanvasContainer } from "./d-canvas-container"; import { DDiagramBaseController } from "./d-diagram-base-controller"; import { DDiagramCanvasBackgroundOptions, DDiagramCanvasBase, DDiagramCanvasBaseOptions } from "./d-diagram-canvas-base"; import { DDiagramCanvasTilePyramidFactory } from "./d-diagram-canvas-tile"; import { DDiagramDataMapper } from "./d-diagram-data-mapper"; import { DDiagramLayer } from "./d-diagram-layer"; import { DDiagramSerialized } from "./d-diagram-serialized"; import { DDiagramSnapshot, DDiagramSnapshotOptions } from "./d-diagram-snapshot"; import { DOnOptions } from "./d-on-options"; import { EShapeResourceManagerDeserializationMode } from "./shape/e-shape-resource-manager-deserialization-mode"; import { EShape } from "./shape/e-shape"; import { EShapeEmbeddedDatum } from "./shape/variant/e-shape-embedded-datum"; /** * {@link DDiagramBase} events. */ export interface DDiagramBaseEvents extends DCanvasContainerEvents { /** * Triggered when all the shape initializations are finished. * * @param emitter an emitter */ ready(emitter: EMITTER): void; } /** * {@link DDiagramBase} "on" options. */ export interface DDiagramBaseOnOptions extends Partial>, DOnOptions { } /** * {@link DDiagramBase} options. */ export interface DDiagramBaseOptions extends DCanvasContainerOptions { controller?: CONTROLLER; /** * A tile pyramid factory. */ tile?: DDiagramCanvasTilePyramidFactory; ambient?: boolean; /** * Snapshot options. */ snapshot?: DDiagramSnapshotOptions; on?: DDiagramBaseOnOptions; } /** * {@link DDiagramBase} theme. */ export interface DThemeDiagramBase extends DThemeCanvasContainer { getCanvasBackgroundColor(): number; getCanvasBackgroundAlpha(): number; getCanvasShadow(): DBaseShadow | null; isAmbient(): boolean; } export declare abstract class DDiagramBase = DDiagramBaseOptions> extends DCanvasContainer { protected _serialized: DDiagramSerialized | null; protected _tileFactory?: DDiagramCanvasTilePyramidFactory; protected _controller?: CONTROLLER; protected _isAmbient: boolean; protected _snapshot: DDiagramSnapshot; protected _mode: EShapeResourceManagerDeserializationMode; constructor(options?: OPTIONS); get snapshot(): DDiagramSnapshot; get controller(): CONTROLLER | null; set(serialized: null): Promise; set(serialized: DDiagramSerialized): Promise; set(serialized: DDiagramSerialized | null): Promise; protected onSet(serialized: DDiagramSerialized, canvas: CANVAS): void; protected abstract toMode(options?: OPTIONS): EShapeResourceManagerDeserializationMode; protected newLayer(serialized: DDiagramSerialized, canvas: CANVAS, mode: EShapeResourceManagerDeserializationMode, pieces?: string[], pieceData?: Map): Promise; protected initLayer(canvas: CANVAS, shapes: EShape[], mapper?: DDiagramDataMapper | null): CANVAS; protected toCanvasBaseOptions(serialized: DDiagramSerialized): DDiagramCanvasBaseOptions; protected toCanvasBaseBackgroundOptions(serialized: DDiagramSerialized, theme: THEME, isAmbient: boolean): DDiagramCanvasBackgroundOptions; protected abstract newCanvas(serialized: DDiagramSerialized): CANVAS; protected onUnset(): void; get(): DDiagramSerialized | null; get layer(): DDiagramLayer | null; protected getType(): string; }