SchemaSetterField
interfaceA node field written directly on import.
Import
import { SchemaSetterField } from '@modular/sdk/editor';Members5
- field
string- getterTableoptional
never- methodoptional
stringThe accessor method this direct field access stands in for, when it is not the conventional `get<Prop>`/`set<Prop>` for the property. Naming one keeps a subclass in charge of its own property: if any class between the one that declared this field and the node's own class overrides that method, the field access is abandoned and the method is called instead. Leaving it out defers to the conventional name, which is what nearly every property wants — a node that predates its schema already has those accessors, and overriding `getStyle()` on a TextNode subclass is ordinary, so migrating a property to a field must not silently take that back. Name one only when the accessor is spelled differently, as TextNode's `text` is (`getTextContent`) and LinkNode's `url` is (`getURL`). A class with no such method defers to nothing, since both prototypes then resolve `undefined`.
- setterTableoptional
{ readonly [key: string]: unknown; }A lookup table from the serialized value to the stored one — the inverse of SchemaGetterField.getterTable, for the import direction. The parsed value is the key, so the schema still owns the domain: only a value the schema admitted is ever looked up.
- whenoptional
neverA predicate gates the export direction only, so naming one here is the same mistake as naming the wrong table; see SchemaGetterField.setterTable.