pub type CodeHighlighterExtensionType = LexicalExtension<CodeHighlighterConfig, CodeHighlighterOutput, ()>;Expand description
CodePrismExtension, over the configured tokenizer.
Aliased Type§
pub struct CodeHighlighterExtensionType {Show 18 fields
pub name: String,
pub conflicts_with: Vec<String>,
pub dependencies: Vec<AnyLexicalExtensionArgument>,
pub peer_dependencies: Vec<NormalizedPeerDependency>,
pub config: CodeHighlighterConfig,
pub merge_config: Option<Rc<dyn Fn(&CodeHighlighterConfig, &CodeHighlighterConfigOverrides) -> CodeHighlighterConfig>>,
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, &CodeHighlighterConfig, &ExtensionInitState) -> Result<(), LexicalError>>>,
pub build: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionBuildState<()>) -> Result<CodeHighlighterOutput, LexicalError>>>,
pub register: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionRegisterState<(), CodeHighlighterOutput>) -> Result<Box<dyn FnOnce()>, LexicalError>>>,
pub after_registration: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionRegisterState<(), CodeHighlighterOutput>) -> Result<Box<dyn FnOnce()>, LexicalError>>>,
}Fields§
§name: Stringname: 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: CodeHighlighterConfigconfig: the default config.
merge_config: Option<Rc<dyn Fn(&CodeHighlighterConfig, &CodeHighlighterConfigOverrides) -> CodeHighlighterConfig>>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: HtmlConfightml: exportDOM overrides by node type and import conversions.
init: Option<Rc<dyn Fn(&mut InitialEditorConfig, &CodeHighlighterConfig, &ExtensionInitState) -> Result<(), LexicalError>>>§build: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionBuildState<()>) -> Result<CodeHighlighterOutput, LexicalError>>>§register: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionRegisterState<(), CodeHighlighterOutput>) -> Result<Box<dyn FnOnce()>, LexicalError>>>§after_registration: Option<Rc<dyn Fn(&Editor, &CodeHighlighterConfig, &ExtensionRegisterState<(), CodeHighlighterOutput>) -> Result<Box<dyn FnOnce()>, LexicalError>>>