Skip to main content

getRegisteredSubtypeMap

function

Build a map from each registered node type to the set of registered node types that are it or extend it (including the type itself). For every node class in `nodes`, its prototype chain is walked and the class's own type is added to the bucket of each registered ancestor type it inherits from. The result lets callers expand a base node type to all of its registered subclass types up front, so a subclass instance can be matched by type without a runtime `instanceof`.

function getRegisteredSubtypeMap(nodes: Iterable<Klass<LexicalNode>>): Map<string, Set<string>>

Import

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