ExtendableConfig
@blockslides/core / ExtendableConfig
Interface: ExtendableConfig<Options, Storage, Config, PMType>
Defined in: blockslides/packages/core/src/Extendable.ts:29
Extended by
Type Parameters
Options
Options = any
Storage
Storage = any
Config
Config extends ExtensionConfig<Options, Storage> | NodeConfig<Options, Storage> | MarkConfig<Options, Storage> | ExtendableConfig<Options, Storage> = ExtendableConfig<Options, Storage, any, any>
PMType
PMType = any
Properties
name
name:
string
Defined in: blockslides/packages/core/src/Extendable.ts:50
The extension name - this must be unique. It will be used to identify the extension.
Example
'myExtension'
priority?
optionalpriority:number
Defined in: blockslides/packages/core/src/Extendable.ts:58
The priority of your extension. The higher, the earlier it will be called and will take precedence over other extensions with a lower priority.
Default
100
Example
101
addOptions()?
optionaladdOptions: (this) =>Options
Defined in: blockslides/packages/core/src/Extendable.ts:60
Parameters
this
name
string
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addOptions"]
Returns
Options
addStorage()?
optionaladdStorage: (this) =>Storage
Defined in: blockslides/packages/core/src/Extendable.ts:66
Parameters
this
name
string
options
Options
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addStorage"]
Returns
Storage
addGlobalAttributes()?
optionaladdGlobalAttributes: (this) =>GlobalAttributes
Defined in: blockslides/packages/core/src/Extendable.ts:72
Parameters
this
name
string
options
Options
storage
Storage
extensions
(Node<any, any> | Mark<any, any>)[]
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addGlobalAttributes"]
Returns
addCommands()?
optionaladdCommands: (this) =>Partial<RawCommands>
Defined in: blockslides/packages/core/src/Extendable.ts:80
Parameters
this
name
string
options
Options
storage
Storage
editor
type
PMType
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addCommands"]
Returns
Partial<RawCommands>
addKeyboardShortcuts()?
optionaladdKeyboardShortcuts: (this) =>object
Defined in: blockslides/packages/core/src/Extendable.ts:89
Parameters
this
name
string
options
Options
storage
Storage
editor
type
PMType
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addKeyboardShortcuts"]
Returns
object
addInputRules()?
optionaladdInputRules: (this) =>InputRule[]
Defined in: blockslides/packages/core/src/Extendable.ts:100
Parameters
this
name
string
options
Options
storage
Storage
editor
type
PMType
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addInputRules"]
Returns
addPasteRules()?
optionaladdPasteRules: (this) =>PasteRule[]
Defined in: blockslides/packages/core/src/Extendable.ts:109
Parameters
this
name
string
options
Options
storage
Storage
editor
type
PMType
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addPasteRules"]
Returns
addProseMirrorPlugins()?
optionaladdProseMirrorPlugins: (this) =>Plugin<any>[]
Defined in: blockslides/packages/core/src/Extendable.ts:118
Parameters
this
name
string
options
Options
storage
Storage
editor
type
PMType
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addProseMirrorPlugins"]
Returns
Plugin<any>[]
addExtensions()?
optionaladdExtensions: (this) =>Extensions
Defined in: blockslides/packages/core/src/Extendable.ts:127
Parameters
this
name
string
options
Options
storage
Storage
parent
Partial<{ [P in string | number | symbol]: Required<Config>[P] extends (args: any) => any ? (args: Parameters<any[any]>) => ReturnType<any[any]> : Config[P] }>["addExtensions"]
Returns
markdownTokenName?
optionalmarkdownTokenName:string
Defined in: blockslides/packages/core/src/Extendable.ts:134
parseMarkdown()?
optionalparseMarkdown: (token,helpers) =>MarkdownParseResult
Defined in: blockslides/packages/core/src/Extendable.ts:139
The parse function used by the markdown parser to convert markdown tokens to ProseMirror nodes.
Parameters
token
helpers
Returns
renderMarkdown()?
optionalrenderMarkdown: (node,helpers,ctx) =>string
Defined in: blockslides/packages/core/src/Extendable.ts:147
The serializer function used by the markdown serializer to convert ProseMirror nodes to markdown tokens.
Parameters
node
helpers
ctx
Returns
string
markdownTokenizer?
optionalmarkdownTokenizer:MarkdownTokenizer
Defined in: blockslides/packages/core/src/Extendable.ts:158
The markdown tokenizer responsible for turning a markdown string into tokens
Custom tokenizers are only needed when you want to parse non-standard markdown token.
markdownOptions?
optionalmarkdownOptions:object
Defined in: blockslides/packages/core/src/Extendable.ts:163
Optional markdown options for indentation
indentsContent?
optionalindentsContent:boolean
Defines if this markdown element should indent it's child elements
extendNodeSchema?
optionalextendNodeSchema: (this,extension) =>Record<string,any> |null
Defined in: blockslides/packages/core/src/Extendable.ts:180
This function extends the schema of the node.
Example
extendNodeSchema() {
return {
group: 'inline',
selectable: false,
}
}
extendMarkSchema?
optionalextendMarkSchema: (this,extension) =>Record<string,any> |null
Defined in: blockslides/packages/core/src/Extendable.ts:202
This function extends the schema of the mark.
Example
extendMarkSchema() {
return {
group: 'inline',
selectable: false,
}
}
onBeforeCreate?
optionalonBeforeCreate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:217
The editor is not ready yet.
onCreate?
optionalonCreate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:234
The editor is ready.
onUpdate?
optionalonUpdate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:251
The content has changed.
onSelectionUpdate?
optionalonSelectionUpdate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:268
The selection has changed.
onTransaction?
optionalonTransaction: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:285
The editor state has changed.
onFocus?
optionalonFocus: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:302
The editor is focused.
onBlur?
optionalonBlur: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:319
The editor isn’t focused anymore.
onDestroy?
optionalonDestroy: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:336
The editor is destroyed.