Interface: ExtensionSpec
What an extension contributes. Returned by the factory given to defineExtension().
Properties
| Property | Type | Description |
|---|---|---|
attributes? | NodeAttribute[] | Attributes added to node types defined by other extensions, such as text alignment on paragraphs and headings. Node types that are not in the schema are skipped. |
inputRules? | (ctx) => InputRule[] | Input rules that turn typed text into formatting, e.g. # into a heading. |
keymap? | (ctx) => Record<string, Command> | Key bindings, e.g. { 'Mod-b': toggleBold() }. |
marks? | Record<string, MarkSpec> | Mark types added to the schema, in order. |
name | string | Unique name. Two extensions with the same name are an error. |
nodes? | Record<string, NodeSpec> | Node types added to the schema, in order. |
plugins? | (ctx) => Plugin<any>[] | Extra ProseMirror plugins. |
priority? | number | Higher runs first for keymaps and plugins. Defaults to 100. |
requires? | string[] | Names of extensions that must also be present. |