iink-ts - v5.0.0
    Preparing search index...

    Class AbstractCanvasAbstract

    Hierarchy (View Summary)

    Index
    • get cursorClasses(): string[]

      CSS classes toggled by setCursorStyle to reflect the current tool on the mounting root element. Default 2-state (draw/erase) set; override alongside getCursorClass for variants with additional tools.

      Returns string[]

    • Parameters

      • rootElement: HTMLElement
      • Optionaloptions: {
            configuration?: {
                layout?: {
                    "bottom-center"?: (string | undefined)[];
                    "bottom-left"?: (string | undefined)[];
                    "bottom-right"?: (string | undefined)[];
                    "middle-left"?: (string | undefined)[];
                    "middle-right"?: (string | undefined)[];
                    "top-center"?: (string | undefined)[];
                    "top-left"?: (string | undefined)[];
                    "top-right"?: (string | undefined)[];
                };
                logger?: {
                    CANVAS?: LoggerLevel;
                    CANVAS_EVENT?: LoggerLevel;
                    CLIENT?: LoggerLevel;
                    CONVERTER?: LoggerLevel;
                    GESTURE?: LoggerLevel;
                    GRABBER?: LoggerLevel;
                    HISTORY?: LoggerLevel;
                    JIIX_QUERY?: LoggerLevel;
                    KEYBOARD?: LoggerLevel;
                    MANAGER?: LoggerLevel;
                    MATH?: LoggerLevel;
                    MENU?: LoggerLevel;
                    MODEL?: LoggerLevel;
                    MOVE?: LoggerLevel;
                    RENDERER?: LoggerLevel;
                    SELECTION?: LoggerLevel;
                    SMARTGUIDE?: LoggerLevel;
                    SNAP?: LoggerLevel;
                    STYLE?: LoggerLevel;
                    SVGDEBUG?: LoggerLevel;
                    SYMBOL?: LoggerLevel;
                    SYNCHRONIZER?: LoggerLevel;
                    TEXT?: LoggerLevel;
                    TRANSFORMER?: LoggerLevel;
                    WRITE?: LoggerLevel;
                };
                ui?: { showConnectionState?: boolean };
            };
            override?: { cssClass?: string };
        }

      Returns AbstractCanvas

    • Returns Promise<void>

    • Force label fully inactive regardless of how many startOperation calls are pending. For level-triggered signals with a single external "done" event (e.g. the client's idle event) rather than one end call per start call.

      Parameters

      Returns void

    • Clears the rootElement.iink back-reference set in the constructor, guarded so it only clears the reference if it's still pointing at this instance — a newer canvas mounted on the same element (e.g. Canvas.load() replacing an instance) must not have its own reference clobbered by this (older) instance's destroy() running after the fact. Every destroy() implementation must call this, or the mounting DOM element keeps a strong reference to the entire destroyed canvas graph.

      Returns void

    • Returns Promise<void>

    • Mark one occurrence of label as finished. Must be paired with a prior startOperation.

      Parameters

      Returns void

    • The single class from cursorClasses that should be active for the current tool.

      Returns string

    • Whether label is currently active (at least one unmatched startOperation call).

      Parameters

      Returns boolean

    • Returns Promise<void>

    • Only relevant for WebSocket-backed canvas; other variants never call this.

      Parameters

      Returns void

    • Parameters

      • idle: boolean

      Returns void

      The client's idle event only fires in response to an explicit client.waitForIdle() call (a request/response pair, not a push notification) — it does NOT fire automatically after every addStrokes()/transform/etc. So it cannot be used to end a "Recognizing" operation reliably. This only preserves the public event.emitIdle passthrough for consumers who call waitForIdle() themselves.

    • Called once the canvas has connected to its backend for the first time.

      Returns void

    • Parameters

      • Optionaldims: { height?: number; width?: number }

      Returns Promise<void>

    • Resolves the target height/width for resize(): an explicit value wins, otherwise falls back to the mounting root element's computed size, clamped to minDimensions.

      Parameters

      • Optionalheight: number
      • Optionalwidth: number

      Returns { height: number; width: number }

    • Returns void

    • Mark label as active. Prefer trackOperation unless the operation isn't promise-shaped.

      Parameters

      Returns void

    • Returns void

    • Returns void

    • Common teardown shared by every variant's destroy(): stops the resize observer, removes all event listeners, and destroys the DOM layers and the renderer. Each variant calls this in addition to its own teardown (input-handler detach, client/menu/model/history cleanup, etc.) and must still call clearRootElementReference itself afterwards.

      Returns void

    • Run fn, marking label as an active operation for the duration (shown on the canvas state badge tooltip). Safe against overlapping/concurrent calls with the same or different labels, and against fn throwing (the operation is always ended).

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

    Event bus for subscribing to canvas lifecycle and content events.

    info?: TApiInfos

    Server API information (version, etc.) loaded on first connection.

    layers: CanvasLayer

    DOM layer manager handling rendering, UI, and modal elements.

    logger: Logger = ...

    Logger instance for this canvas.

    renderer: { destroy(): void }

    The variant's rendering backend, declared here only so teardownCommon can tear it down generically.