$create
functionCreate an node from its class. This directly constructs the final `withKlass` node type, skipping the intermediate steps where each replaced node would be created and then immediately discarded — once per configured replacement of that node. A deprecated `replace` given without a `withKlass` is the one case that cannot be resolved ahead of construction, since only its `with` function knows what to build. Such a replacement is still applied, the old way, to the node this constructs. This does not support any arguments to the constructor. Setters can be used to initialize your node, and they can be chained. You can of course write your own mutliple-argument functions to wrap that.
Import
import { $create } from '@modular/sdk/editor';Notes
- example
- ```ts function $createTokenText(text: string): TextNode { return $create(TextNode).setTextContent(text).setMode('token'); } ```