@umbraco-cms/backoffice
    Preparing search index...

    Interface MarkConfig<Options, Storage>

    interface MarkConfig<Options = any, Storage = any> {
        addAttributes?: (
            this: {
                editor?: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => {} | Attributes);
                storage: Storage;
            },
        ) => {}
        | Attributes;
        addCommands?: (
            this: {
                editor: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => ReturnType<Required<T>[P]>);
                storage: Storage;
                type: MarkType;
            },
        ) => Partial<RawCommands>;
        addExtensions?: (
            this: {
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => Extensions);
                storage: Storage;
            },
        ) => Extensions;
        addGlobalAttributes?: (
            this: {
                extensions: (Mark<any, any> | Node<any, any>)[];
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => GlobalAttributes);
                storage: Storage;
            },
        ) => GlobalAttributes;
        addInputRules?: (
            this: {
                editor: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => InputRule[]);
                storage: Storage;
                type: MarkType;
            },
        ) => InputRule[];
        addKeyboardShortcuts?: (
            this: {
                editor: Editor;
                name: string;
                options: Options;
                parent:
                    | undefined
                    | ((...args: []) => { [key: string]: KeyboardShortcutCommand });
                storage: Storage;
                type: MarkType;
            },
        ) => { [key: string]: KeyboardShortcutCommand };
        addMarkView?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }) => MarkViewRenderer<MarkViewRendererProps>) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                ) => MarkViewRenderer
            );
        addOptions?: (
            this: { name: string; parent: undefined | ((...args: []) => Options) },
        ) => Options;
        addPasteRules?: (
            this: {
                editor: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => PasteRule[]);
                storage: Storage;
                type: MarkType;
            },
        ) => PasteRule[];
        addProseMirrorPlugins?: (
            this: {
                editor: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => Plugin<any>[]);
                storage: Storage;
                type: MarkType;
            },
        ) => Plugin<any>[];
        addStorage?: (
            this: {
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => Storage);
            },
        ) => Storage;
        code?: | boolean
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean) | undefined;
                    storage: Storage;
                },
            ) => boolean
        );
        excludes?: | string
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: string | ((this: { name: string; options: Options; storage: Storage; parent: string | ... | undefined; editor?: Editor | undefined; }) => string | undefined) | undefined;
                    storage: Storage;
                },
            ) => undefined
            | string
        );
        exitable?: boolean | (() => boolean);
        extendMarkSchema?:
            | null
            | (
                (
                    this: {
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; }, extension: Mark<any, any>) => Record<string, any>) | null | undefined;
                        storage: Storage;
                    },
                    extension: Mark,
                ) => Record<string, any>
            );
        extendNodeSchema?:
            | null
            | (
                (
                    this: {
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; }, extension: Node<any, any>) => Record<string, any>) | null | undefined;
                        storage: Storage;
                    },
                    extension: Node,
                ) => Record<string, any>
            );
        group?:
            | string
            | (
                (
                    this: {
                        editor?: Editor;
                        name: string;
                        options: Options;
                        parent: string | ((this: { name: string; options: Options; storage: Storage; parent: string | ... | undefined; editor?: Editor | undefined; }) => string | undefined) | undefined;
                        storage: Storage;
                    },
                ) => undefined
                | string
            );
        inclusive?:
            | boolean
            | (
                (
                    this: {
                        editor?: Editor;
                        name: string;
                        options: Options;
                        parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean | undefined) | undefined;
                        storage: Storage;
                    },
                ) => undefined
                | boolean
            );
        keepOnSplit?: boolean | (() => boolean);
        name: string;
        onBeforeCreate?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: { editor: Editor; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: { editor: Editor },
                ) => void
            );
        onBlur?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; event: FocusEvent; transaction: Transaction; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: { editor: Editor; event: FocusEvent; transaction: Transaction },
                ) => void
            );
        onCreate?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: { editor: Editor; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: { editor: Editor },
                ) => void
            );
        onDestroy?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: void) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: void,
                ) => void
            );
        onFocus?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; event: FocusEvent; transaction: Transaction; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: { editor: Editor; event: FocusEvent; transaction: Transaction },
                ) => void
            );
        onSelectionUpdate?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: { editor: Editor; transaction: Transaction },
                ) => void
            );
        onTransaction?:
            | null
            | (
                (
                    this: {
                        editor: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; appendedTransactions: Transaction[]; }) => void) | null | undefined;
                        storage: Storage;
                        type: MarkType;
                    },
                    event: {
                        appendedTransactions: Transaction[];
                        editor: Editor;
                        transaction: Transaction;
                    },
                ) => void
            );
        onUpdate?: | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; appendedTransactions: Transaction[]; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: {
                    appendedTransactions: Transaction[];
                    editor: Editor;
                    transaction: Transaction;
                },
            ) => void
        );
        parseHTML?: (
            this: {
                editor?: Editor;
                name: string;
                options: Options;
                parent: undefined | ((...args: []) => undefined | readonly ParseRule[]);
                storage: Storage;
            },
        ) => undefined
        | readonly ParseRule[];
        priority?: number;
        renderHTML?:
            | null
            | (
                (
                    this: {
                        editor?: Editor;
                        name: string;
                        options: Options;
                        parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; editor?: Editor | undefined; }, props: { mark: Mark; HTMLAttributes: Record<string, any>; }) => DOMOutputSpec) | null | undefined;
                        storage: Storage;
                    },
                    props: { HTMLAttributes: Record<string, any>; mark: Mark },
                ) => DOMOutputSpec
            );
        spanning?:
            | boolean
            | (
                (
                    this: {
                        editor?: Editor;
                        name: string;
                        options: Options;
                        parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean | undefined) | undefined;
                        storage: Storage;
                    },
                ) => undefined
                | boolean
            );
    }

    Type Parameters

    • Options = any
    • Storage = any

    Hierarchy

    Index

    Properties

    addAttributes?: (
        this: {
            editor?: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => {} | Attributes);
            storage: Storage;
        },
    ) => {}
    | Attributes

    Attributes

    addCommands?: (
        this: {
            editor: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => ReturnType<Required<T>[P]>);
            storage: Storage;
            type: MarkType;
        },
    ) => Partial<RawCommands>

    This function adds commands to the editor

    addCommands() {
    return {
    myCommand: () => ({ chain }) => chain().setMark('type', 'foo').run(),
    }
    }
    addExtensions?: (
        this: {
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => Extensions);
            storage: Storage;
        },
    ) => Extensions

    This function adds additional extensions to the editor. This is useful for building extension kits.

    addExtensions() {
    return [
    BulletList,
    OrderedList,
    ListItem
    ]
    }
    addGlobalAttributes?: (
        this: {
            extensions: (Mark<any, any> | Node<any, any>)[];
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => GlobalAttributes);
            storage: Storage;
        },
    ) => GlobalAttributes

    This function adds globalAttributes to specific nodes.

    addGlobalAttributes() {
    return [
    {
    // Extend the following extensions
    types: [
    'heading',
    'paragraph',
    ],
    // … with those attributes
    attributes: {
    textAlign: {
    default: 'left',
    renderHTML: attributes => ({
    style: `text-align: ${attributes.textAlign}`,
    }),
    parseHTML: element => element.style.textAlign || 'left',
    },
    },
    },
    ]
    }
    addInputRules?: (
        this: {
            editor: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => InputRule[]);
            storage: Storage;
            type: MarkType;
        },
    ) => InputRule[]

    This function adds input rules to the editor.

    addInputRules() {
    return [
    markInputRule({
    find: inputRegex,
    type: this.type,
    }),
    ]
    },
    addKeyboardShortcuts?: (
        this: {
            editor: Editor;
            name: string;
            options: Options;
            parent:
                | undefined
                | ((...args: []) => { [key: string]: KeyboardShortcutCommand });
            storage: Storage;
            type: MarkType;
        },
    ) => { [key: string]: KeyboardShortcutCommand }

    This function registers keyboard shortcuts.

    addKeyboardShortcuts() {
    return {
    'Mod-l': () => this.editor.commands.toggleBulletList(),
    }
    },
    addMarkView?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }) => MarkViewRenderer<MarkViewRendererProps>) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
            ) => MarkViewRenderer
        )

    Mark View

    addOptions?: (
        this: { name: string; parent: undefined | ((...args: []) => Options) },
    ) => Options

    This method will add options to this extension

    addOptions() {
    return {
    myOption: 'foo',
    myOtherOption: 10,
    }
    addPasteRules?: (
        this: {
            editor: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => PasteRule[]);
            storage: Storage;
            type: MarkType;
        },
    ) => PasteRule[]

    This function adds paste rules to the editor.

    addPasteRules() {
    return [
    markPasteRule({
    find: pasteRegex,
    type: this.type,
    }),
    ]
    },
    addProseMirrorPlugins?: (
        this: {
            editor: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => Plugin<any>[]);
            storage: Storage;
            type: MarkType;
        },
    ) => Plugin<any>[]

    This function adds Prosemirror plugins to the editor

    addProseMirrorPlugins() {
    return [
    customPlugin(),
    ]
    }
    addStorage?: (
        this: {
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => Storage);
        },
    ) => Storage

    The default storage this extension can save data to.

    defaultStorage: {
    prefetchedUsers: [],
    loading: false,
    }
    code?:
        | boolean
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean) | undefined;
                    storage: Storage;
                },
            ) => boolean
        )

    Code

    excludes?:
        | string
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: string | ((this: { name: string; options: Options; storage: Storage; parent: string | ... | undefined; editor?: Editor | undefined; }) => string | undefined) | undefined;
                    storage: Storage;
                },
            ) => undefined
            | string
        )

    Excludes

    exitable?: boolean | (() => boolean)

    Marks this Mark as exitable

    extendMarkSchema?:
        | null
        | (
            (
                this: {
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; }, extension: Mark<any, any>) => Record<string, any>) | null | undefined;
                    storage: Storage;
                },
                extension: Mark,
            ) => Record<string, any>
        )

    This function extends the schema of the mark.

    extendMarkSchema() {
    return {
    group: 'inline',
    selectable: false,
    }
    }
    extendNodeSchema?:
        | null
        | (
            (
                this: {
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; }, extension: Node<any, any>) => Record<string, any>) | null | undefined;
                    storage: Storage;
                },
                extension: Node,
            ) => Record<string, any>
        )

    This function extends the schema of the node.

    extendNodeSchema() {
    return {
    group: 'inline',
    selectable: false,
    }
    }
    group?:
        | string
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: string | ((this: { name: string; options: Options; storage: Storage; parent: string | ... | undefined; editor?: Editor | undefined; }) => string | undefined) | undefined;
                    storage: Storage;
                },
            ) => undefined
            | string
        )

    Group

    inclusive?:
        | boolean
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean | undefined) | undefined;
                    storage: Storage;
                },
            ) => undefined
            | boolean
        )

    Inclusive

    keepOnSplit?: boolean | (() => boolean)

    Keep mark after split node

    name: string

    The extension name - this must be unique. It will be used to identify the extension.

    'myExtension'
    
    onBeforeCreate?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: { editor: Editor; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: { editor: Editor },
            ) => void
        )

    The editor is not ready yet.

    onBlur?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; event: FocusEvent; transaction: Transaction; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: { editor: Editor; event: FocusEvent; transaction: Transaction },
            ) => void
        )

    The editor isn’t focused anymore.

    onCreate?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: { editor: Editor; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: { editor: Editor },
            ) => void
        )

    The editor is ready.

    onDestroy?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | null | undefined; }, event: void) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: void,
            ) => void
        )

    The editor is destroyed.

    onFocus?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; event: FocusEvent; transaction: Transaction; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: { editor: Editor; event: FocusEvent; transaction: Transaction },
            ) => void
        )

    The editor is focused.

    onSelectionUpdate?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: { editor: Editor; transaction: Transaction },
            ) => void
        )

    The selection has changed.

    onTransaction?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; appendedTransactions: Transaction[]; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: {
                    appendedTransactions: Transaction[];
                    editor: Editor;
                    transaction: Transaction;
                },
            ) => void
        )

    The editor state has changed.

    onUpdate?:
        | null
        | (
            (
                this: {
                    editor: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; editor: Editor; type: MarkType; parent: ... | ... 1 more ... | undefined; }, event: { editor: Editor; transaction: Transaction; appendedTransactions: Transaction[]; }) => void) | null | undefined;
                    storage: Storage;
                    type: MarkType;
                },
                event: {
                    appendedTransactions: Transaction[];
                    editor: Editor;
                    transaction: Transaction;
                },
            ) => void
        )

    The content has changed.

    parseHTML?: (
        this: {
            editor?: Editor;
            name: string;
            options: Options;
            parent: undefined | ((...args: []) => undefined | readonly ParseRule[]);
            storage: Storage;
        },
    ) => undefined
    | readonly ParseRule[]

    Parse HTML

    priority?: number

    The priority of your extension. The higher, the earlier it will be called and will take precedence over other extensions with a lower priority.

    100
    
    101
    
    renderHTML?:
        | null
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: ((this: { name: string; options: Options; storage: Storage; parent: ... | null | undefined; editor?: Editor | undefined; }, props: { mark: Mark; HTMLAttributes: Record<string, any>; }) => DOMOutputSpec) | null | undefined;
                    storage: Storage;
                },
                props: { HTMLAttributes: Record<string, any>; mark: Mark },
            ) => DOMOutputSpec
        )

    Render HTML

    spanning?:
        | boolean
        | (
            (
                this: {
                    editor?: Editor;
                    name: string;
                    options: Options;
                    parent: boolean | ((this: { name: string; options: Options; storage: Storage; parent: boolean | ... | undefined; editor?: Editor | undefined; }) => boolean | undefined) | undefined;
                    storage: Storage;
                },
            ) => undefined
            | boolean
        )

    Spanning