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

    Interface TextEditDep

    Dep for enterTextEditAction.

    Wrap the return value of useTextEdit / useSceneTextEdit to source this dep. The isTextNode predicate is optional — when absent the action fires unconditionally (the binding spec acts as the gate).

    const textEdit = useSceneTextEdit({ scene, container });
    useDepSource('textEdit', () => ({
    startEdit: textEdit.startEdit,
    isTextNode: (id) => scene.get(id as NodeId)?.data?.kind === 'text',
    }));
    interface TextEditDep {
        isTextNode?(id: string): boolean;
        startEdit(id: string, opts?: { caret?: number | "all" }): void;
    }
    Index

    Methods

    • Optional predicate: returns true when the node with id is a text node. When absent the action fires on any selected node (binding spec is the gate). When present and returning false, the invocation is a no-op.

      Parameters

      • id: string

      Returns boolean