Skip to main content

BaseStaticNodeConfig

type

This is the type of LexicalNode.$config() that can be overridden by subclasses. Concrete nodes are keyed by their string `type`. An abstract base class (such as ElementNode or DecoratorNode) has no concrete node `type`, so when it needs to declare configuration that is shared with its concrete subclasses (for example required RequiredNodeStateConfig state or a `$transform`) it is keyed instead by a well-known symbol, by convention `Symbol.for(<NodeClassName>)` (e.g. `Symbol.for('ElementNode')`). The descriptive, globally-registered symbol keeps the config easy to find in a debugger and can never collide with a real node `type`.

type BaseStaticNodeConfig = { readonly [K in string | symbol]?: undefined | StaticNodeConfigValue<LexicalNode, K>; }

Import

import { BaseStaticNodeConfig } from '@modular/sdk/editor';