@witchcraft/editor
    Preparing search index...

    Type Alias Command<TRegularArgs, TFuncArgs>

    type Command<
        TRegularArgs extends any[] = any[],
        TFuncArgs extends
            (editor: Editor, ...args: any[]) => any[] = (
            editor: Editor,
            ...args: any[],
        ) => any[],
    > = {
        args?: TRegularArgs
        | TFuncArgs;
        canShow?: (editorstate: EditorState) => boolean;
        command: keyof ChainedCommands;
        description?: string;
        icon?:
            | (new () => any)
            | FunctionalComponent
            | {
                component: (new () => any) | FunctionalComponent;
                props?: Record<string, any>;
            };
        title: string;
        type: "command";
    }

    Type Parameters

    • TRegularArgs extends any[] = any[]
    • TFuncArgs extends (editor: Editor, ...args: any[]) => any[] = (editor: Editor, ...args: any[]) => any[]
    Index

    Properties

    Args to pass to the command.

    A function to determine those args can also be passed instead.

    What context is provided to the function depends on the meny.

    canShow?: (editorstate: EditorState) => boolean

    Determines whether the entry should be shown.

    Note that while one can just use tiptap's can() method, some commands are expensive to execute, so it's better to just do a more generic lightweight check in those situations.

    command: keyof ChainedCommands
    description?: string
    icon?:
        | (new () => any)
        | FunctionalComponent
        | {
            component: (new () => any) | FunctionalComponent;
            props?: Record<string, any>;
        }
    title: string
    type: "command"