weasel API - v0.8.0
    Preparing search index...

    Interface UseClipboardOpsOptions

    Options for useClipboardOps.

    interface UseClipboardOpsOptions {
        getDropPoint?: () => { worldX: number; worldY: number } | null;
        getSelection: () => NodeId[];
        jsonReplacer?: Replacer;
        onPaste?: (newIds: NodeId[]) => void;
        pasteLabel?: string;
        produceFlavors?: (snapshot: ClipboardSnapshot) => Record<string, string>;
    }
    Index

    Properties

    getDropPoint?: () => { worldX: number; worldY: number } | null

    Pulled once per paste() call. When non-null, threaded to commitPaste as ctx.dropPoint; adapters typically use it as the cluster origin (ignoring offset). When null/undefined, the hook falls back to the existing cascade-offset behavior.

    getSelection: () => NodeId[]

    How the hook reads "current selection" for copy. The kit doesn't assume a global selection store; each consumer wires this.

    jsonReplacer?: Replacer

    Replacer for the kit-default JSON flavor (typed arrays etc.). Ignored when produceFlavors is supplied.

    onPaste?: (newIds: NodeId[]) => void

    Called after a successful paste with the ids of the newly inserted objects.

    pasteLabel?: string

    Label for the history entry produced by paste. Default 'Paste'.

    produceFlavors?: (snapshot: ClipboardSnapshot) => Record<string, string>

    Produce the OS-clipboard flavor map for a copied snapshot. Keys are MIME types, values the serialized payload. The kit default emits application/x-weasel-clipboard+json plus text/plain carrying the same JSON. Apps override to add richer flavors (e.g. real SVG) or to replace the text flavor. Return an empty object to skip the OS write entirely.