Hiyve Components - v1.0.0
    Preparing search index...

    Interface WhiteboardAddinInterface

    Complete add-in interface

    interface WhiteboardAddinInterface {
        createObject: (
            type: string,
            options: Record<string, unknown>,
        ) => WhiteboardObject | null;
        description?: string;
        enabled: boolean;
        exportData: () => unknown;
        getContextMenuItems: (object: WhiteboardObject) => ContextMenuItem[];
        getObjectTypes: () => string[];
        getToolbarButtons: () => ToolbarButton[];
        icon?: ReactNode;
        id: string;
        importData: (data: unknown) => void;
        name: string;
        onMessage?: (message: unknown, fromUserId: string) => void;
        onMount: (context: WhiteboardAddinContext) => void;
        onObjectAdded?: (object: WhiteboardObject) => void;
        onObjectLoaded?: (object: WhiteboardObject) => void;
        onObjectModified?: (object: WhiteboardObject) => void;
        onObjectRemoved?: (object: WhiteboardObject) => void;
        onSelectionChanged?: (objects: WhiteboardObject[]) => void;
        onUnmount: () => void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    createObject: (
        type: string,
        options: Record<string, unknown>,
    ) => WhiteboardObject | null

    Create an object of a specific type

    description?: string

    Description

    enabled: boolean

    Whether the add-in is currently enabled

    exportData: () => unknown

    Export add-in data for saving

    getContextMenuItems: (object: WhiteboardObject) => ContextMenuItem[]

    Get context menu items for an object

    getObjectTypes: () => string[]

    Get object types this add-in handles

    getToolbarButtons: () => ToolbarButton[]

    Get toolbar buttons to add

    icon?: ReactNode

    Icon (MUI icon component or ReactNode)

    id: string

    Unique add-in ID

    importData: (data: unknown) => void

    Import add-in data on load

    name: string

    Display name

    onMessage?: (message: unknown, fromUserId: string) => void

    Called when a message is received from another user

    onMount: (context: WhiteboardAddinContext) => void

    Called when add-in is mounted/enabled

    onObjectAdded?: (object: WhiteboardObject) => void

    Called when an object is added to canvas

    onObjectLoaded?: (object: WhiteboardObject) => void

    Called when object is loaded from file

    onObjectModified?: (object: WhiteboardObject) => void

    Called when an object is modified

    onObjectRemoved?: (object: WhiteboardObject) => void

    Called when an object is removed

    onSelectionChanged?: (objects: WhiteboardObject[]) => void

    Called when selection changes

    onUnmount: () => void

    Called when add-in is unmounted/disabled