Skip to main content

CodeExtensionType

Type Alias CodeExtensionType 

Source
pub type CodeExtensionType = LexicalExtension;
Expand description

CodeExtension.

Aliased Type§

pub struct CodeExtensionType {
Show 18 fields pub name: String, pub conflicts_with: Vec<String>, pub dependencies: Vec<AnyLexicalExtensionArgument>, pub peer_dependencies: Vec<NormalizedPeerDependency>, pub config: (), pub merge_config: Option<Rc<dyn Fn(&(), &())>>, pub nodes: Vec<NodeClass>, pub namespace: Option<String>, pub editable: Option<bool>, pub on_warn: Option<Rc<dyn Fn(LexicalError, &Editor) -> Result<(), LexicalError>>>, pub initial_editor_state: Option<InitialEditorStateType>, pub theme: Option<Object>, pub parent_editor: Option<Editor>, pub html: HtmlConfig, pub init: Option<Rc<dyn Fn(&mut InitialEditorConfig, &(), &ExtensionInitState) -> Result<(), LexicalError>>>, pub build: Option<Rc<dyn Fn(&Editor, &(), &ExtensionBuildState<()>) -> Result<(), LexicalError>>>, pub register: Option<Rc<dyn Fn(&Editor, &(), &ExtensionRegisterState<(), ()>) -> Result<Box<dyn FnOnce()>, LexicalError>>>, pub after_registration: Option<Rc<dyn Fn(&Editor, &(), &ExtensionRegisterState<(), ()>) -> Result<Box<dyn FnOnce()>, LexicalError>>>,
}

Fields§

§name: String

name: unique in an editor.

§conflicts_with: Vec<String>

conflictsWith: names of extensions this one can’t be built with.

§dependencies: Vec<AnyLexicalExtensionArgument>

dependencies: other extensions, optionally with config overrides.

§peer_dependencies: Vec<NormalizedPeerDependency>

peerDependencies: extensions, by name, this one configures or reads when another extension brings them.

§config: ()

config: the default config.

§merge_config: Option<Rc<dyn Fn(&(), &())>>

mergeConfig; without it, ExtensionConfigBase::shallow_merge.

§nodes: Vec<NodeClass>

nodes: node classes, and node replacements as NodeClasses (LexicalNodeReplacement).

§namespace: Option<String>

namespace: the editor’s namespace; the last extension that sets it wins.

§editable: Option<bool>

editable: whether the editor starts editable; the last extension that sets it wins.

§on_warn: Option<Rc<dyn Fn(LexicalError, &Editor) -> Result<(), LexicalError>>>

onWarn: the last extension that sets it wins.

§initial_editor_state: Option<InitialEditorStateType>

$initialEditorState.

§theme: Option<Object>

theme, merged into the themes of the extensions before it.

§parent_editor: Option<Editor>

parentEditor: the editor to nest the new one in.

§html: HtmlConfig

html: exportDOM overrides by node type and import conversions.

§init: Option<Rc<dyn Fn(&mut InitialEditorConfig, &(), &ExtensionInitState) -> Result<(), LexicalError>>>§build: Option<Rc<dyn Fn(&Editor, &(), &ExtensionBuildState<()>) -> Result<(), LexicalError>>>§register: Option<Rc<dyn Fn(&Editor, &(), &ExtensionRegisterState<(), ()>) -> Result<Box<dyn FnOnce()>, LexicalError>>>§after_registration: Option<Rc<dyn Fn(&Editor, &(), &ExtensionRegisterState<(), ()>) -> Result<Box<dyn FnOnce()>, LexicalError>>>