import * as _angular_core from '@angular/core'; import { OnDestroy, Signal, OnInit, EventEmitter } from '@angular/core'; import { Observable } from 'rxjs'; declare enum ActionType { Save = "save", Undo = "undo", Redo = "redo", Clear = "clear", AddImage = "addImage", ToggleGrid = "toggleGrid", AddElement = "addElement", UpdateElement = "updateElement", RemoveElements = "removeElements", RemoveSelectedElements = "removeSelectedElements", SelectElements = "selectElements", ToggleSelection = "toggleSelection", DeselectElement = "deselectElement", SelectAll = "selectAll", ClearSelection = "clearSelection", UpdateSelectedElements = "updateSelectedElements", SetActiveTool = "setActiveTool", SetCanvasDimensions = "setCanvasDimensions", SetCanvasPosition = "setCanvasPosition", UpdateGridTranslation = "updateGridTranslation", UpdateElementsTranslation = "updateElementsTranslation", FullScreen = "fullScreen", CenterCanvas = "centerCanvas", ZoomIn = "zoomIn", ZoomOut = "zoomOut", Zoom = "zoom", ZoomToFit = "zoomToFit", ZoomToSelection = "zoomToSelection", ResetZoom = "resetZoom", SetBackgroundColor = "setBackgroundColor", UpdateConfig = "updateConfig", Batch = "batch", AddLayer = "addLayer", RemoveLayer = "removeLayer", RenameLayer = "renameLayer", SetActiveLayer = "setActiveLayer", ToggleLayerVisibility = "toggleLayerVisibility", ToggleLayerLock = "toggleLayerLock", SetLayerOpacity = "setLayerOpacity", SetLayerBlendMode = "setLayerBlendMode", MoveLayerUp = "moveLayerUp", MoveLayerDown = "moveLayerDown" } type WhiteboardAction = { type: ActionType.Save; payload: { format: FormatType; name: string; }; } | { type: ActionType.Undo; } | { type: ActionType.Redo; } | { type: ActionType.Clear; } | { type: ActionType.AddImage; payload: AddImage; } | { type: ActionType.ToggleGrid; } | { type: ActionType.AddElement; payload: { element: WhiteboardElement; }; } | { type: ActionType.UpdateElement; payload: { element: WhiteboardElement; }; } | { type: ActionType.RemoveElements; payload: { ids: string[]; }; } | { type: ActionType.RemoveSelectedElements; } | { type: ActionType.SelectElements; payload: { elementsOrIds: WhiteboardElement | WhiteboardElement[] | string | string[]; }; } | { type: ActionType.ToggleSelection; payload: { elementOrId: WhiteboardElement | string; }; } | { type: ActionType.DeselectElement; payload: { elementOrId: WhiteboardElement | string; }; } | { type: ActionType.SelectAll; } | { type: ActionType.ClearSelection; } | { type: ActionType.UpdateSelectedElements; payload: { partialElement: Partial; }; } | { type: ActionType.SetActiveTool; payload: { tool: ToolType; }; } | { type: ActionType.SetCanvasDimensions; payload: { width: number; height: number; }; } | { type: ActionType.SetCanvasPosition; payload: { x: number; y: number; }; } | { type: ActionType.UpdateGridTranslation; payload: { dx: number; dy: number; }; } | { type: ActionType.UpdateElementsTranslation; payload: { dx: number; dy: number; }; } | { type: ActionType.FullScreen; } | { type: ActionType.CenterCanvas; } | { type: ActionType.ZoomIn; } | { type: ActionType.ZoomOut; } | { type: ActionType.Zoom; payload: { zoom: number; }; } | { type: ActionType.ZoomToFit; } | { type: ActionType.ZoomToSelection; } | { type: ActionType.ResetZoom; } | { type: ActionType.SetBackgroundColor; payload: { color: string; }; } | { type: ActionType.UpdateConfig; payload: { config: Partial; }; } | { type: ActionType.Batch; payload: WhiteboardAction[]; } | { type: ActionType.AddLayer; payload: { name?: string; }; } | { type: ActionType.RemoveLayer; payload: { id: string; }; } | { type: ActionType.RenameLayer; payload: { id: string; name: string; }; } | { type: ActionType.SetActiveLayer; payload: { id: string; }; } | { type: ActionType.ToggleLayerVisibility; payload: { id: string; }; } | { type: ActionType.ToggleLayerLock; payload: { id: string; }; } | { type: ActionType.SetLayerOpacity; payload: { id: string; opacity: number; }; } | { type: ActionType.SetLayerBlendMode; payload: { id: string; blendMode: string; }; } | { type: ActionType.MoveLayerUp; payload: { id: string; }; } | { type: ActionType.MoveLayerDown; payload: { id: string; }; }; type Priority = 'high' | 'normal' | 'low'; /** * Controls what happens after a tool finishes drawing an element: * - `true` (for a tool): the new element is selected and the Select tool becomes active. * - `false`: nothing is selected and the current drawing tool stays active (draw several in a row). * - object: per-element-type overrides (e.g. `{ pen: false, rectangle: true }`). * - omitted: falls back to each element's own `selectAfterDraw` default. */ type SelectAfterDrawConfig = boolean | Partial>; /** * Describes the type of arrowhead. * Mirrors ArrowheadType for config usage. */ type ArrowHeadStyle = 'none' | 'arrow' | 'open-arrow' | 'diamond' | 'open-diamond' | 'circle' | 'open-circle' | 'bar'; /** * Describes the default path style for new arrows. */ type ArrowLineStyle = 'straight' | 'curve' | 'elbow'; interface ArrowConfig { /** Default head style for the start of an arrow */ startHeadStyle: ArrowHeadStyle; /** Default head style for the end of an arrow */ endHeadStyle: ArrowHeadStyle; /** Default line style for new arrows */ lineStyle: ArrowLineStyle; } declare const defaultArrowConfig: ArrowConfig; interface WhiteboardConfig { drawingEnabled: boolean; canvasWidth: number; canvasHeight: number; fullScreen: boolean; center: boolean; canvasX: number; canvasY: number; strokeColor: string; strokeWidth: number; backgroundColor: string; lineJoin: LineJoin; lineCap: LineCap; fill: string; zoom: number; fontFamily: string; fontSize: number; dasharray: string; dashoffset: number; x: number; y: number; enableGrid: boolean; gridSize: number; snapToGrid: boolean; keyboardShortcutsEnabled: boolean; penType: PenType; /** Minimum distance (in pixels) between points when drawing with the pen tool */ penThrottlingThreshold: number; /** Arrow-specific configuration – heads, line style, size */ arrowConfig: ArrowConfig; /** * Post-draw behaviour: whether a freshly drawn element gets selected (and the Select tool * activated) or the drawing tool stays active. Global, per-element-type, or omitted to use * each element's own default. See {@link SelectAfterDrawConfig}. */ selectAfterDraw?: SelectAfterDrawConfig; } interface EditorConfig { title: string; showTitle: boolean; showZoom: boolean; showLayers: boolean; showTools: boolean; showGrid: boolean; showBackground: boolean; showStroke: boolean; showFill: boolean; showOpacity: boolean; showFont: boolean; showDash: boolean; showEraser: boolean; showUndo: boolean; showRedo: boolean; showClear: boolean; showSave: boolean; showLoad: boolean; showExport: boolean; showImport: boolean; showShare: boolean; showSettings: boolean; showHelp: boolean; showAbout: boolean; showFeedback: boolean; showSupport: boolean; showContact: boolean; showPrivacy: boolean; showTerms: boolean; showLicense: boolean; showAttribution: boolean; showCredits: boolean; showChangelog: boolean; showReleaseNotes: boolean; showRoadmap: boolean; showBlog: boolean; showForum: boolean; showCommunity: boolean; showEvents: boolean; showWebinars: boolean; showWorkshops: boolean; showTutorials: boolean; showDocumentation: boolean; showAPI: boolean; showSDK: boolean; showCLI: boolean; showPlugins: boolean; showExtensions: boolean; showIntegrations: boolean; showAddons: boolean; showThemes: boolean; showTemplates: boolean; showSnippets: boolean; showExamples: boolean; showDemos: boolean; showSamples: boolean; showShowcases: boolean; showPortfolios: boolean; showCaseStudies: boolean; showSuccessStories: boolean; showTestimonials: boolean; showReviews: boolean; showRatings: boolean; showComparisons: boolean; showAlternatives: boolean; showInsights: boolean; enableEditor: boolean; } declare enum FormatType { Png = "png", Jpeg = "jpeg", Svg = "svg", Base64 = "base64" } declare enum AlignmentType { Left = "left", Center = "center", Right = "right", Top = "top", Middle = "middle", Bottom = "bottom", DistributeHorizontally = "distribute-horizontally", DistributeVertically = "distribute-vertically" } declare enum LineCap { Round = "round", Butt = "butt", Square = "square" } declare enum LineJoin { Round = "round", Miter = "miter", Bevel = "bevel", MiterClip = "miter-clip" } interface AddImage { image: string | ArrayBuffer; x?: number; y?: number; } declare enum Direction { NW = "nw", N = "n", NE = "ne", E = "e", SE = "se", S = "s", SW = "sw", W = "w" } interface ResizeElement { direction: Direction; x: number; y: number; } interface Point { x: number; y: number; } interface Bounds { minX: number; minY: number; maxX: number; maxY: number; width: number; height: number; } interface SelectionBox { x: number; y: number; width: number; height: number; visible: boolean; } interface BoundingBox { x: number; y: number; width: number; height: number; handles: { topLeft: Point; topRight: Point; bottomLeft: Point; bottomRight: Point; rotateHandle: Point; }; rotation: number; } /** * Represents a named connection point on a shape's edge. * `position` is the absolute world-coordinate of the point; * `normal` is an outward-facing unit vector used for arrowhead orientation. */ interface ConnectionPoint { id: string; position: Point; normal: Point; } /** * Where on a shape the arrow is anchored. * * - `elementId` – the shape this end is bound to * - `pointId` – which connection point (optional; `null` → closest edge) * - `focus` – normalised position [0-1] along a specific edge, for fine-tuning */ interface ArrowBinding { elementId: string; pointId: string | null; /** 0 = start of edge, 1 = end of edge. Only used when pointId is set. */ focus: number; /** Gap (in px) between shape edge and arrow endpoint */ gap: number; } /** * Describes an arrow's curvature between its two endpoints. * * - `type: 'straight'` – simple line * - `type: 'quadratic'` – single control point (cx, cy) * - `type: 'cubic'` – two control points * - `type: 'elbow'` – right-angle segments with a configurable bend position */ type ArrowPathType = { type: 'straight'; } | { type: 'quadratic'; cx: number; cy: number; } | { type: 'cubic'; cx1: number; cy1: number; cx2: number; cy2: number; } | { type: 'elbow'; midRatio: number; }; /** * The default straight arrow path. */ declare const defaultArrowPath: ArrowPathType; /** * Snap detection result when hovering near a connectable shape. */ interface SnapResult { /** The shape we're snapping to */ elementId: string; /** The specific connection point (may be null for closest-edge) */ pointId: string | null; /** The snapped world-coordinate */ point: Point; /** Distance from the pointer to the snap point */ distance: number; } /** The options object for stroke generation. */ interface StrokeOptions { /** The base size (diameter) of the stroke. */ size?: number; /** The effect of pressure on the stroke's size. */ thinning?: number; /** How much to soften the stroke's edges. */ smoothing?: number; /** How much to streamline the stroke. */ streamline?: number; /** An easing function to apply to each point's pressure. */ easing?(pressure: number): number; /** Whether to simulate pressure based on velocity. */ simulatePressure?: boolean; /** Cap, taper and easing for the start of the line. */ start?: { cap?: boolean; taper?: number | boolean; easing?(distance: number): number; }; /** Cap, taper and easing for the end of the line. */ end?: { cap?: boolean; taper?: number | boolean; easing?(distance: number): number; }; /** Whether to handle the points as a completed stroke. */ last?: boolean; } interface PenElement extends BaseElement { type: ElementType.Pen; points: [number, number][]; pathOptions?: StrokeOptions; isComplete?: boolean; isClosed?: boolean; } interface ImageElement extends BaseElement { type: ElementType.Image; width: number; height: number; src: string | ArrayBuffer; } interface LineElement extends BaseElement { type: ElementType.Line; x1: number; y1: number; x2: number; y2: number; } declare enum ArrowheadType { None = "none", Arrow = "arrow", OpenArrow = "open-arrow", Diamond = "diamond", OpenDiamond = "open-diamond", Circle = "circle", OpenCircle = "open-circle", Bar = "bar" } interface ArrowheadConfig { type: ArrowheadType; } interface ArrowElement extends BaseElement { type: ElementType.Arrow; x1: number; y1: number; x2: number; y2: number; startHead: ArrowheadConfig; endHead: ArrowheadConfig; startBinding: ArrowBinding | null; endBinding: ArrowBinding | null; pathType: ArrowPathType; } interface TextElement extends BaseElement { type: ElementType.Text; text: string; selection?: { start: number; end: number; }; scaleX: number; scaleY: number; } interface EllipseElement extends BaseElement { type: ElementType.Ellipse; cx: number; cy: number; rx: number; ry: number; } interface RectangleElement extends BaseElement { type: ElementType.Rectangle; width: number; height: number; rx: number; } interface WhiteboardEventPayload { type: T; payload: WhiteboardEventPayloads[T]; timestamp: number; } interface DebounceConfig { debounceTime: number; distinctUntilChanged?: boolean; comparator?: (prev: T, curr: T) => boolean; } declare class EventBusService implements OnDestroy { private eventSubject; private readonly eventSignals; private readonly lastEventInternal; readonly lastEvent: _angular_core.Signal | undefined>; private readonly defaultDebounceConfigs; ngOnDestroy(): void; emit(type: T, payload?: WhiteboardEventPayloads[T]): void; listen(): Observable>; getEventSignal(eventType: T): _angular_core.Signal; getAllEventsSignal(): _angular_core.Signal | undefined>; on(eventType: T, debounceConfig?: DebounceConfig): Observable; listenToMultiple(events: T[]): Observable<{ type: T; payload: WhiteboardEventPayloads[T]; timestamp: number; }>; destroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } declare class ConfigService { private eventBusService; private config; private editorConfig; constructor(eventBusService: EventBusService); getConfig(): Readonly; /** * Resolve the post-draw "select after draw" behaviour for an element type. Honours the * `selectAfterDraw` config (global boolean or per-type object); falls back to the element's * own default when the config is omitted (or has no entry for that type). */ resolveSelectAfterDraw(type: ElementType, fallback: boolean): boolean; getConfigSignal(): _angular_core.Signal; getEditorConfig(): Readonly; getEditorConfigSignal(): _angular_core.Signal; updateConfig(partialConfig: Partial, emitEvent?: boolean): void; isConfigDifferent(key: keyof WhiteboardConfig, value: WhiteboardConfig[keyof WhiteboardConfig]): boolean; updateConfigValue(key: keyof WhiteboardConfig, value: WhiteboardConfig[keyof WhiteboardConfig]): void; updateEditorConfigValue(key: keyof EditorConfig, value: EditorConfig[keyof EditorConfig]): void; checkAndUpdateConfig(key: keyof WhiteboardConfig, value: WhiteboardConfig[keyof WhiteboardConfig]): void; getConfigValue(key: K): WhiteboardConfig[K]; setConfigValue(key: K, value: WhiteboardConfig[K]): void; getConfigKeys(): (keyof WhiteboardConfig)[]; getConfigValues(): WhiteboardConfig[keyof WhiteboardConfig][]; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** Standard CSS cursor types and custom SVG cursors for whiteboard tools. */ declare enum CursorType { Default = "default", Pointer = "pointer", None = "none", ContextMenu = "context-menu", Help = "help", Progress = "progress", Wait = "wait", Crosshair = "crosshair", Cell = "cell", Text = "text", VerticalText = "vertical-text", Grab = "grab", Grabbing = "grabbing", Move = "move", AllScroll = "all-scroll", NResize = "n-resize", SResize = "s-resize", EResize = "e-resize", WResize = "w-resize", NEResize = "ne-resize", NWResize = "nw-resize", SEResize = "se-resize", SWResize = "sw-resize", EWResize = "ew-resize", NSResize = "ns-resize", NESWResize = "nesw-resize", NWSEResize = "nwse-resize", Copy = "copy", Alias = "alias", NoDrop = "no-drop", NotAllowed = "not-allowed", ZoomIn = "zoom-in", ZoomOut = "zoom-out", ColResize = "col-resize", RowResize = "row-resize", Pencil = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PHBhdGggZmlsbD0iIzAwMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjAuNSIgZD0ibTE2LjMxOCA2LjExLTMuNTM2LTMuNTM1IDEuNDE1LTEuNDE0Yy42My0uNjMgMi4wNzMtLjc1NSAyLjgyOCAwbC43MDcuNzA3Yy43NTUuNzU1LjYzMSAyLjE5OCAw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uNzkgMi44MyAwbDMuNTMtMy41My00Ljk1LTQuOTUtNC45NSA0Ljk1eiIvPjwvc3ZnPg==') 12 12, auto", Highlighter = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cmVjdCB4PSI0IiB5PSIxMCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjgiIGZpbGw9IiMwMDAiIG9wYWNpdHk9IjAuNiIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjAuNSIvPjxwYXRoIGQ9Ik0yIDIwaDIwdjNIMnoiIGZpbGw9IiMwMDAiIG9wYWNpdHk9IjAuOCIvPjwvc3ZnPg==') 12 24, auto", TextCursor = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjMDAwIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMC41IiBkPSJNNSA0djNoNS41djEyaDNWN0gxOVY0SDV6Ii8+PC9zdmc+') 12 0, text", Shape = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cmVjdCB4PSIzIiB5PSIzIiB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==') 12 12, crosshair", Arrow = "url('data:image/svg+xml;base64,PHN2ZyB4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 12 12, none", Image = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cmVjdCB4PSIzIiB5PSIzIiB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iOC41IiBjeT0iOC41IiByPSIxLjUiIGZpbGw9IiMwMDAiLz48cG9seWxpbmUgcG9pbnRzPSIyMSAxNSAxNSA5IDkgMTUgNiAxMiAzIDE1IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==') 12 12, crosshair", Dot = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48Y2lyY2xlIGN4PSIxMCIgY3k9IjEwIiByPSIyIiBmaWxsPSIjMDAwIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMSIvPjwvc3ZnPg==') 10 10, crosshair", Plus = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjMDAwIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMC41IiBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==') 12 12, crosshair", Line = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48bGluZSB4MT0iMyIgeTE9IjIxIiB4Mj0iMjEiIHkyPSIzIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PGNpcmNsZSBjeD0iMyIgY3k9IjIxIiByPSIyIiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMjEiIGN5PSIzIiByPSIyIiBmaWxsPSIjMDAwIi8+PC9zdmc+') 12 12, crosshair" } interface BatchHandle { execute: () => void; clear: () => void; } declare class ApiService { private elementsService; private canvasService; private selectionService; private toolsService; private ioService; private historyService; private zoomService; private panService; private layerService; private configService; private clipboardService; private eventBusService; readonly elements: Signal; readonly draftElements: Signal; readonly allElements: Signal; readonly selectedElements: Signal; readonly config: Signal; readonly elementsCount: Signal; readonly hasElements: Signal; readonly selectedTool: Signal; readonly availableTools: Signal; readonly layers: Signal; readonly activeLayerId: Signal; readonly activeLayer: Signal; setElements(elements: WhiteboardElement[]): void; getElements(): WhiteboardElement[]; addElements(elements: WhiteboardElement[]): void; updateElements(elements: Array & { id: string; }>): void; removeElements(elements: WhiteboardElement[]): void; clear(): void; clearAll(): void; addElement(element: WhiteboardElement): void; updateElement(element: WhiteboardElement): void; removeElementsByIds(elementIds: string[]): void; getElementById(id: string): WhiteboardElement | undefined; getElementsByIds(ids: string[]): WhiteboardElement[]; getNextZIndex(): number; getAllElements(): WhiteboardElement[]; getDraftElements(): WhiteboardElement[]; addDraftElements(elements: WhiteboardElement[]): void; updateDraftElements(elements: Partial[]): void; removeDraftElements(elementIds: string[]): void; commitDraftElements(): void; elementExists(elementId: string): boolean; selectElements(elementsOrIds: WhiteboardElement | WhiteboardElement[] | string | string[], append?: boolean): void; /** * Apply the post-draw behaviour for a freshly drawn element: when `selectAfterDraw` resolves * true (config override or the element's own default), select it and activate the Select tool; * when false, leave it unselected so the drawing tool stays active. Called by the tools on * pointer-up — the single place the "select + switch to Select vs keep drawing" decision lives. */ finalizeDraw(element: WhiteboardElement): void; deselectElement(elementOrId: WhiteboardElement | string): void; toggleSelection(elementOrId: WhiteboardElement | string): void; clearSelection(): void; selectAll(): void; getSelectedElements(): WhiteboardElement[]; updateSelectedElements(partialElement: Partial): void; removeSelectedElements(): void; isSelected(elementOrId: WhiteboardElement | string): boolean; clearSelectionBox(): void; transformSelectedElements(transformFn: (elements: WhiteboardElement[]) => WhiteboardElement[]): void; setSelectionBox(selectionBox: SelectionBox): void; updateBoundingBox(): void; getBoundingBox(): BoundingBox | null; setBoundingBox(bbox: BoundingBox | null): void; getClipboardInfo(): ClipboardInfo | null; copyElements(): void; cutElements(): void; pasteElements(): void; duplicateElements(): void; deleteSelectedElements(): void; bringToFront(): void; bringForward(): void; sendBackward(): void; sendToBack(): void; groupSelectedElements(): void; ungroupSelectedElements(): void; lockElements(): void; unlockElements(): void; alignElements(alignment: AlignmentType): void; distributeHorizontally(): void; distributeVertically(): void; flipHorizontal(): void; flipVertical(): void; moveSelectedElements(dx: number, dy: number): void; rotateSelectedElements(angle: number): void; scaleSelectedElements(factor: number): void; initializeWhiteboard(svgContainer: SVGSVGElement): void; getCanvas(): SVGSVGElement; setCanvasDimensions(width: number, height: number): void; centerCanvas(): void; fullScreen(): void; exitFullScreen(defaultWidth?: number, defaultHeight?: number): void; resetCanvas(): void; setZoom(zoom: number): void; zoomIn(): void; zoomOut(): void; resetZoom(): void; zoomToFit(): void; zoomToSelection(): void; zoomToRegion(x: number, y: number, width: number, height: number): void; pan(dx: number, dy: number): void; panTo(x: number, y: number): void; resetPan(): void; save(format?: FormatType, name?: string): Promise; addImage(imageInfo: AddImage): void; importImageFile(file: File, x?: number, y?: number): Promise; exportData(): string; importData(jsonData: string): void; exportAsPNG(name?: string): Promise; exportAsSVG(name?: string): Promise; exportAsJSON(name?: string): void; undo(): boolean; redo(): boolean; getCanUndoSignal(): Signal; getCanRedoSignal(): Signal; clearHistory(): void; recordElementCreation(before: WhiteboardElement[], after: WhiteboardElement[]): void; /** * Begin a history batch: while active, element-change recordings are coalesced * so a multi-step gesture (e.g. a drag, resize or rotate spanning many frames) * is committed as a single undo entry. Pair every call with the returned * handle's execute()/clear(). */ startBatch(description: string, before: WhiteboardElement[]): BatchHandle; /** * Record the final state of an in-progress history batch. Call before the * handle's execute(). */ completeBatch(after: WhiteboardElement[]): void; recordElementUpdate(before: WhiteboardElement[], after: WhiteboardElement[]): void; recordElementDeletion(before: WhiteboardElement[], after: WhiteboardElement[]): void; recordClear(before: WhiteboardElement[], after: WhiteboardElement[]): void; recordChange(before: WhiteboardElement[], after: WhiteboardElement[], description: string): void; getConfig(): WhiteboardConfig; updateConfig(config: Partial): void; updateConfigValue(key: K, value: WhiteboardConfig[K]): void; addLayer(name?: string): WhiteboardLayer; removeLayer(id: string): boolean; duplicateLayer(id: string): void; setActiveLayer(id: string): boolean; getActiveLayerId(): string; toggleLayerVisibility(id: string): boolean; toggleLayerLock(id: string): boolean; renameLayer(id: string, name: string): boolean; setLayerOpacity(id: string, opacity: number): boolean; setLayerBlendMode(id: string, blendMode: BlendMode): boolean; moveLayerUp(id: string): boolean; moveLayerDown(id: string): boolean; reorderLayersByIndex(previousIndex: number, currentIndex: number): boolean; toggleGrid(): void; toggleSnapToGrid(): void; setGridSize(size: number): void; setActiveTool(tool: ToolType): void; getActiveTool(): ToolType; setToolEnabled(toolType: ToolType, enabled: boolean): boolean; setEnabledTools(toolTypes: ToolType[]): void; setCursor(cursor: CursorType): void; resetCursor(): void; screenToCanvas(screenX: number, screenY: number): { x: number; y: number; }; canvasToScreen(canvasX: number, canvasY: number): { x: number; y: number; }; getSelectionBoxSignal(): Signal; getBoundingBoxSignal(): Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } interface WhiteboardElementStyle { strokeWidth?: number; strokeColor?: string; fill?: string; lineJoin?: LineJoin; lineCap?: LineCap; fontSize?: number; fontFamily?: string; fontStyle?: 'normal' | 'italic'; fontWeight?: 'normal' | 'bold'; color?: string; dasharray?: string; dashoffset?: number; opacity?: number; } declare const defaultElementStyle: WhiteboardElementStyle; declare const defaultTextElementStyle: WhiteboardElementStyle; declare enum ElementType { Pen = "pen", Rectangle = "rectangle", Ellipse = "ellipse", Line = "line", Arrow = "arrow", Text = "text", Image = "image" } type WhiteboardElements = { [ElementType.Pen]: PenElement; [ElementType.Rectangle]: RectangleElement; [ElementType.Ellipse]: EllipseElement; [ElementType.Line]: LineElement; [ElementType.Arrow]: ArrowElement; [ElementType.Text]: TextElement; [ElementType.Image]: ImageElement; }; type WhiteboardElement = WhiteboardElements[keyof WhiteboardElements]; type ElementByType = WhiteboardElements[T]; interface BaseElement { type: ElementType; id: string; x: number; y: number; style: WhiteboardElementStyle; rotation: number; opacity: number; zIndex: number; scaleX?: number; scaleY?: number; layerId?: string; groupId?: string; locked?: boolean; isDeleting?: boolean; selectAfterDraw?: boolean; } interface ElementUtil { create(props: Partial): T; resize(element: T, direction: Direction, dx: number, dy: number): T; getBounds(element: T): Bounds; hitTest(element: T, pointA: Point, pointB: Point, threshold: number): boolean; } interface PointerInfo { x: number; y: number; clientX: number; clientY: number; pageX: number; pageY: number; movementX: number; movementY: number; pressure: number; tangentialPressure: number; tiltX: number; tiltY: number; twist: number; width: number; height: number; pointerType: string; pointerId: number; isPrimary: boolean; button: -1 | 0 | 1 | 2 | 3 | 4; buttons: number; shiftKey: boolean; ctrlKey: boolean; altKey: boolean; metaKey: boolean; eventType: string; isDoubleClick?: boolean; timeStamp: number; target: EventTarget | null; } declare enum ToolType { Hand = "hand", Select = "select", Pen = "pen", Rectangle = "rectangle", Image = "image", Line = "line", Arrow = "arrow", Ellipse = "ellipse", Text = "text", Eraser = "eraser", ZoomArea = "zoomArea" } interface ToolConfig { id: string; type: ToolType; name: string; description?: string; icon?: string; enabled: boolean; order?: number; permissions?: string[]; customData?: Record; } type Tool = { type: ToolType; activate(): void; deactivate(): void; handlePointerDown?(event: PointerInfo): void; handlePointerMove?(event: PointerInfo): void; handlePointerUp?(event: PointerInfo): void; handleKeyDown?(event: KeyboardEvent): void; handleKeyUp?(event: KeyboardEvent): void; onActivate?(): void; onDeactivate?(): void; isEditing?: boolean; }; /** Event types that can occur in ng-whiteboard. */ declare enum WhiteboardEvent { Ready = "ready", Destroyed = "destroyed", DrawStart = "drawStart", Drawing = "drawing", DrawEnd = "drawEnd", ElementsAdded = "elementsAdded", ElementsUpdated = "elementsUpdated", ElementsSelected = "elementsSelected", ElementsRemoved = "elementsRemoved", ElementDoubleClicked = "elementDoubleClicked", Undo = "undo", Redo = "redo", Clear = "clear", DataChange = "dataChange", Save = "save", ImageAdded = "imageAdded", ToolChange = "toolChange", ConfigChange = "configChange", ZoomChange = "zoomChange" } type WhiteboardEventPayloads = { [WhiteboardEvent.Ready]: void; [WhiteboardEvent.Destroyed]: void; [WhiteboardEvent.DrawStart]: { x: number; y: number; }; [WhiteboardEvent.Drawing]: { x: number; y: number; }; [WhiteboardEvent.DrawEnd]: void; [WhiteboardEvent.ElementsAdded]: WhiteboardElement[]; [WhiteboardEvent.ElementsUpdated]: WhiteboardElement[]; [WhiteboardEvent.ElementsSelected]: WhiteboardElement[] | null; [WhiteboardEvent.ElementsRemoved]: WhiteboardElement[]; [WhiteboardEvent.ElementDoubleClicked]: { target: EventTarget | null; clientX: number; clientY: number; }; [WhiteboardEvent.Undo]: void; [WhiteboardEvent.Redo]: void; [WhiteboardEvent.Clear]: void; [WhiteboardEvent.DataChange]: WhiteboardElement[]; [WhiteboardEvent.Save]: string; [WhiteboardEvent.ImageAdded]: string | ArrayBuffer; [WhiteboardEvent.ToolChange]: ToolType; [WhiteboardEvent.ConfigChange]: WhiteboardConfig; [WhiteboardEvent.ZoomChange]: { zoom: number; }; }; type WhiteboardEventType = [WhiteboardEvent.Ready] | [WhiteboardEvent.Destroyed] | [WhiteboardEvent.DrawStart] | [WhiteboardEvent.Drawing] | [WhiteboardEvent.DrawEnd] | [WhiteboardEvent.ElementsAdded] | [WhiteboardEvent.ElementsUpdated] | [WhiteboardEvent.ElementsSelected] | [WhiteboardEvent.ElementsRemoved] | [WhiteboardEvent.ElementDoubleClicked] | [WhiteboardEvent.Undo] | [WhiteboardEvent.Redo] | [WhiteboardEvent.Clear] | [WhiteboardEvent.DataChange] | [WhiteboardEvent.Save] | [WhiteboardEvent.ImageAdded] | [WhiteboardEvent.ToolChange] | [WhiteboardEvent.ConfigChange] | [WhiteboardEvent.ZoomChange]; /** Predefined pen configurations for different drawing styles. */ /** Available pen types. */ declare enum PenType { Pen = "pen", Marker = "marker", Highlighter = "highlighter", Brush = "brush", Pencil = "pencil" } /** Pen thickness options. */ declare enum PenThickness { ExtraFine = "extra-fine",// 1px Fine = "fine",// 2px Medium = "medium",// 4px Thick = "thick",// 8px ExtraThick = "extra-thick" } /** Complete pen preset configuration. */ interface PenPreset { id: string; name: string; type: PenType; thickness: PenThickness; strokeColor?: string; strokeWidth?: number; lineCap?: LineCap; lineJoin?: LineJoin; dasharray?: string; dashoffset?: number; opacity?: number; strokeOptions: StrokeOptions; display: { description: string; icon?: string; preview?: string; }; } /** Size mappings for different thickness levels. */ declare const THICKNESS_SIZES: Record; /** Stroke width mappings for different thickness levels. */ declare const THICKNESS_STROKE_WIDTHS: Record; /** Predefined pen presets. */ declare const PEN_PRESETS_MAP: Record; /** Array version for backward compatibility. */ declare const PEN_PRESETS: PenPreset[]; declare const PEN_PRESETS_BY_TYPE_THICKNESS: Record; /** Default pen preset. */ declare const DEFAULT_PEN_PRESET: PenPreset; /** Get preset by type and thickness combination. */ declare function getPenPresetByTypeAndThickness(type: PenType, thickness: PenThickness): PenPreset | undefined; /** Get first available preset for a pen type with preferred thickness. */ declare function getPresetForType(type: PenType, preferredThickness?: PenThickness): PenPreset; /** Default SVG icons for whiteboard tools. */ declare const TOOL_ICONS: Record; interface ClipboardData { elements: WhiteboardElement[]; timestamp: number; } interface ClipboardInfo { elementCount: number; timestamp: number; } /** CSS Blend Modes. */ type BlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity'; /** Blend mode display information for UI. */ interface BlendModeOption { value: BlendMode; label: string; description: string; category: 'normal' | 'darken' | 'lighten' | 'contrast' | 'component'; } /** Core Layer Model. */ interface WhiteboardLayer { id: string; name: string; visible: boolean; locked: boolean; zIndex: number; elements: string[]; opacity?: number; blendMode?: BlendMode; } /** Layer Management State. */ interface LayerState { layers: WhiteboardLayer[]; activeLayerId: string; } /** Available blend modes with metadata for UI display. */ declare const BLEND_MODES: BlendModeOption[]; /** * Service providing a clean API for interacting with whiteboard instances. * * Key concepts: * - Each whiteboard component has a unique boardId * - Methods accept an optional boardId parameter to target a specific board * - Use signals(boardId) to get reactive signals for a specific board * * @example * ```typescript * class MyComponent { * boardId = 'my-board'; * layers = this.whiteboardService.signals(this.boardId).layers; * elements = this.whiteboardService.signals(this.boardId).elements; * * clear() { * this.whiteboardService.clear(this.boardId); * } * } * ``` */ declare class NgWhiteboardService { private readonly instanceService; private activeBoardId; /** * Set the active board. Methods without boardId parameter will use this board. * @param boardId - The ID of the board to make active, or null to clear active board */ setActiveBoard(boardId: string | null): void; /** * Get the currently active board ID */ getActiveBoard(): string | null; /** * Get the API instance for a specific board, or the active board if no boardId provided. * @param boardId - Optional board ID. If not provided, uses the active board. * @throws Error if boardId is not provided and no active board is set. * @throws Error if the specified board is not found. */ private getApi; /** * Get reactive signals for a specific board. * These signals are bound to the specified board and will update when that board's data changes. * Signals are lazy and won't throw errors until actually accessed. * * @param boardId - The unique identifier of the whiteboard * @returns Object containing all reactive signals for the board * * @example * ```typescript * class MyComponent { * boardId = 'my-board'; * private signals = this.whiteboardService.signals(this.boardId); * layers = this.signals.layers; * elements = this.signals.elements; * } * ``` */ signals(boardId: string): { elements: Signal; selectedElements: Signal; config: Signal; elementsCount: Signal; hasElements: Signal; selectedTool: Signal; availableTools: Signal; layers: Signal; activeLayerId: Signal; activeLayer: Signal; canUndo: Signal; canRedo: Signal; selectionBox: Signal; boundingBox: Signal; }; /** * Get all registered whiteboard instance IDs. */ getAllBoards(): ReadonlyArray; /** * Get the total number of registered whiteboard instances. */ getBoardCount(): number; /** * Check if a whiteboard with the given ID exists. */ hasBoard(boardId: string): boolean; /** * Set elements for the whiteboard. */ setElements(elements: WhiteboardElement[]): void; /** * Get all elements from the whiteboard. */ getElements(): WhiteboardElement[]; /** * Add new elements to the whiteboard. */ addElements(elements: WhiteboardElement[]): void; /** * Update multiple elements. */ updateElements(elements: Array & { id: string; }>): void; /** * Remove elements from the whiteboard. */ removeElements(elements: WhiteboardElement[]): void; /** * Clear all elements from the whiteboard. */ clear(): void; /** * Clear all elements and selection. */ clearAll(): void; /** * Add a single element to the whiteboard. */ addElement(element: WhiteboardElement): void; /** * Update an existing element. */ updateElement(element: WhiteboardElement): void; /** * Remove elements by their IDs. */ removeElementsByIds(elementIds: string[]): void; /** * Get element by ID. */ getElementById(id: string): WhiteboardElement | undefined; /** * Get multiple elements by their IDs. */ getElementsByIds(ids: string[]): WhiteboardElement[]; /** * Get next available Z-index. */ getNextZIndex(): number; /** * Check if an element exists. */ elementExists(elementId: string): boolean; /** * Select elements on the whiteboard. */ selectElements(elementsOrIds: WhiteboardElement | WhiteboardElement[] | string | string[], append?: boolean): void; /** * Deselect an element. */ deselectElement(elementOrId: WhiteboardElement | string): void; /** * Toggle element selection. */ toggleSelection(elementOrId: WhiteboardElement | string): void; /** * Clear the selection. */ clearSelection(): void; /** * Select all elements. */ selectAll(): void; /** * Get currently selected elements. */ getSelectedElements(): WhiteboardElement[]; /** * Update selected elements with partial properties. */ updateSelectedElements(partialElement: Partial): void; /** * Remove selected elements. */ removeSelectedElements(): void; /** * Check if an element is selected. */ isSelected(elementOrId: WhiteboardElement | string): boolean; /** * Clear the selection box. */ clearSelectionBox(): void; /** * Transform selected elements using a transformation function. */ transformSelectedElements(transformFn: (elements: WhiteboardElement[]) => WhiteboardElement[]): void; /** * Set the selection box. */ setSelectionBox(selectionBox: SelectionBox): void; /** * Update bounding box for selected elements. */ updateBoundingBox(): void; /** * Get clipboard information. */ getClipboardInfo(): ClipboardInfo | null; /** * Copy selected elements to clipboard. */ copyElements(): void; /** * Cut selected elements. */ cutElements(): void; /** * Paste elements from clipboard. */ pasteElements(): void; /** * Duplicate selected elements. */ duplicateElements(): void; /** * Delete selected elements. */ deleteSelectedElements(): void; /** * Bring selected elements to front. */ bringToFront(): void; /** * Bring selected elements forward by one level. */ bringForward(): void; /** * Send selected elements backward by one level. */ sendBackward(): void; /** * Send selected elements to back. */ sendToBack(): void; /** * Group selected elements. */ groupSelectedElements(): void; /** * Ungroup selected elements. */ ungroupSelectedElements(): void; /** * Lock selected elements. */ lockElements(): void; /** * Unlock selected elements. */ unlockElements(): void; /** * Align selected elements. */ alignElements(alignment: AlignmentType): void; /** * Get the canvas SVG element. */ getCanvas(): SVGSVGElement; /** * Set canvas dimensions. */ setCanvasDimensions(width: number, height: number): void; /** * Center the canvas. */ centerCanvas(): void; /** * Toggle fullscreen mode. */ fullScreen(): void; /** * Exit fullscreen mode. */ exitFullScreen(defaultWidth?: number, defaultHeight?: number): void; /** * Reset canvas to default state. */ resetCanvas(): void; /** * Set zoom level. */ setZoom(zoom: number): void; /** * Zoom in. */ zoomIn(): void; /** * Zoom out. */ zoomOut(): void; /** * Reset zoom to default. */ resetZoom(): void; /** * Zoom to fit all elements. */ zoomToFit(): void; /** * Zoom to fit selected elements. */ zoomToSelection(): void; /** * Pan the canvas by delta values. */ pan(dx: number, dy: number): void; /** * Pan to a specific position. */ panTo(x: number, y: number): void; /** * Reset pan to default. */ resetPan(): void; /** * Save the whiteboard in the specified format. */ save(format?: FormatType, name?: string): Promise; /** * Add an image to the whiteboard. */ addImage(imageInfo: AddImage): void; /** * Import an image from a file. */ importImageFile(file: File, x?: number, y?: number): Promise; /** * Export whiteboard data as JSON. */ exportData(): string; /** * Import whiteboard data from JSON. */ importData(jsonData: string): void; /** * Undo the last action. */ undo(): boolean; /** * Redo the last undone action. */ redo(): boolean; /** * Get signal for undo availability. */ getCanUndoSignal(): Signal; /** * Get signal for redo availability. */ getCanRedoSignal(): Signal; /** * Clear undo/redo history. */ clearHistory(): void; /** * Get current whiteboard configuration. */ getConfig(): WhiteboardConfig; /** * Update whiteboard configuration. */ updateConfig(config: Partial): void; /** * Update a single configuration value. */ updateConfigValue(key: K, value: WhiteboardConfig[K]): void; /** * Add a new layer. */ addLayer(name?: string): void; /** * Remove a layer by ID. */ removeLayer(id: string): boolean; /** * Duplicate a layer with all its elements and properties. */ duplicateLayer(id: string): void; /** * Set the active layer. */ setActiveLayer(id: string): boolean; /** * Get the active layer ID. */ getActiveLayerId(): string; /** * Toggle layer visibility. */ toggleLayerVisibility(id: string): boolean; /** * Toggle layer lock state. */ toggleLayerLock(id: string): boolean; /** * Rename a layer. */ renameLayer(id: string, name: string): boolean; /** * Set layer opacity (0-1). */ setLayerOpacity(id: string, opacity: number): boolean; /** * Set layer blend mode. */ setLayerBlendMode(id: string, blendMode: BlendMode): boolean; /** * Move layer up in z-order. */ moveLayerUp(id: string): boolean; /** * Move layer down in z-order. */ moveLayerDown(id: string): boolean; /** * Reorder layers by index position. * * @example * ```typescript * this.whiteboardService.reorderLayersByIndex(2, 0); * ``` */ reorderLayersByIndex(previousIndex: number, currentIndex: number): boolean; /** * Toggle grid visibility. */ toggleGrid(): void; /** * Toggle snap to grid. */ toggleSnapToGrid(): void; /** * Set grid size. */ setGridSize(size: number): void; /** * Set the active drawing tool. */ setActiveTool(tool: ToolType): void; /** * Get the currently active tool. */ getActiveTool(): ToolType; /** * Enable or disable a specific tool. */ setToolEnabled(toolType: ToolType, enabled: boolean): boolean; /** * Set which tools should be enabled. */ setEnabledTools(toolTypes: ToolType[]): void; /** * Set cursor explicitly. */ setCursor(cursor: CursorType): void; /** * Reset cursor to default. */ resetCursor(): void; /** * Convert screen coordinates to canvas coordinates. */ screenToCanvas(screenX: number, screenY: number): { x: number; y: number; }; /** * Convert canvas coordinates to screen coordinates. */ canvasToScreen(canvasX: number, canvasY: number): { x: number; y: number; }; /** * Get selection box signal. */ getSelectionBoxSignal(): Signal; /** * Get bounding box signal. */ getBoundingBoxSignal(): Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** * Main whiteboard component providing a canvas with drawing tools and configuration options. * * Handles whiteboard initialization, event management, and configuration updates. */ declare class NgWhiteboardComponent implements OnInit, OnDestroy { private configService; private apiService; private toolsService; private eventBusService; private cd; private instanceService; /** * Unique identifier for this whiteboard instance. * Auto-generated if not provided. */ boardId: string; /** * Whiteboard configuration options. */ set config(value: Partial); get config(): WhiteboardConfig; /** * Whiteboard data elements. */ set data(data: WhiteboardElement[]); /** * Active drawing tool. */ set selectedTool(tool: ToolType); /** * Emitted when the whiteboard component is ready. */ ready: EventEmitter; /** * Emitted when the whiteboard is destroyed. */ destroyed: EventEmitter; /** * Emitted when the user starts drawing. */ drawStart: EventEmitter<{ x: number; y: number; }>; /** * Emitted while the user is drawing. */ drawing: EventEmitter<{ x: number; y: number; }>; /** * Emitted when the user stops drawing. */ drawEnd: EventEmitter; /** * Emitted when elements are added. */ elementsAdded: EventEmitter; /** * Emitted when elements are updated. */ elementsUpdated: EventEmitter; /** * Emitted when elements are selected or deselected. */ elementsSelected: EventEmitter; /** * Emitted when elements are removed. */ elementsRemoved: EventEmitter; /** * Emitted when an element is double-clicked. */ elementDoubleClicked: EventEmitter<{ target: EventTarget | null; clientX: number; clientY: number; }>; /** * Emitted when an undo action is triggered. */ undo: EventEmitter; /** * Emitted when a redo action is triggered. */ redo: EventEmitter; /** * Emitted when the whiteboard is cleared. */ clear: EventEmitter; /** * Emitted when the whiteboard data changes. */ dataChange: EventEmitter; /** * Emitted when the whiteboard content is saved. */ save: EventEmitter; /** * Emitted when an image is added. */ imageAdded: EventEmitter; /** * Emitted when the selected drawing tool changes. */ selectedToolChange: EventEmitter; /** * Emitted when the configuration changes. */ configChange: EventEmitter>; /** * Emitted when zoom-related configuration changes. */ zoomChange: EventEmitter<{ zoom: number; center: boolean; canvasWidth: number; canvasHeight: number; }>; private readonly eventsMap; private eventsSubscription?; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { ActionType, AlignmentType, ApiService, BLEND_MODES, ConfigService, CursorType, DEFAULT_PEN_PRESET, Direction, ElementType, FormatType, LineCap, LineJoin, NgWhiteboardComponent, NgWhiteboardService, PEN_PRESETS, PEN_PRESETS_BY_TYPE_THICKNESS, PEN_PRESETS_MAP, PenThickness, PenType, THICKNESS_SIZES, THICKNESS_STROKE_WIDTHS, TOOL_ICONS, ToolType, WhiteboardEvent, defaultArrowConfig, defaultArrowPath, defaultElementStyle, defaultTextElementStyle, getPenPresetByTypeAndThickness, getPresetForType }; export type { AddImage, ArrowBinding, ArrowConfig, ArrowHeadStyle, ArrowLineStyle, ArrowPathType, BaseElement, BlendMode, BlendModeOption, BoundingBox, Bounds, ClipboardData, ClipboardInfo, ConnectionPoint, EditorConfig, ElementByType, ElementUtil, LayerState, PenPreset, Point, PointerInfo, Priority, ResizeElement, SelectAfterDrawConfig, SelectionBox, SnapResult, Tool, ToolConfig, WhiteboardAction, WhiteboardConfig, WhiteboardElement, WhiteboardElementStyle, WhiteboardElements, WhiteboardEventPayloads, WhiteboardEventType, WhiteboardLayer };