Dotloom TypeScript API
    Preparing search index...

    Interface PluginApi

    Context passed to plugin callbacks.

    interface PluginApi {
        editor: EditorCore | null;
        engine: DotloomEngine;
        on: <K extends keyof EventMap>(name: K, cb: Listener<K>) => () => void;
        pluginId: string;
        onDispose(fn: () => void): void;
    }
    Index
    editor: EditorCore | null
    on: <K extends keyof EventMap>(name: K, cb: Listener<K>) => () => void

    Subscribe to engine events; removed automatically when the plugin is disabled.

    Type Declaration

      • <K extends keyof EventMap>(name: K, cb: Listener<K>): () => void
      • Subscribe to an event; returns an unsubscribe function.

        Type Parameters

        • K extends keyof EventMap

        Parameters

        • name: K
        • cb: Listener<K>

        Returns () => void

    pluginId: string
    • Register a cleanup run on disable/unregister (GPU resources, DOM, timers).

      Parameters

      • fn: () => void

      Returns void