Skip to content

Type Editor


Type Editor / @type-editor/viewdesc / ViewDescUpdater / ViewDescUpdater

Class: ViewDescUpdater

Defined in: ViewDescUpdater.ts:24

Constructors

Constructor

ts
new ViewDescUpdater(viewDesc, view): ViewDescUpdater;

Defined in: ViewDescUpdater.ts:30

Parameters

ParameterType
viewDescViewDesc
viewPmEditorView

Returns

ViewDescUpdater

Methods

update()

ts
static update(
   viewDesc,
   view,
   node,
   outerDeco,
   innerDeco): boolean;

Defined in: ViewDescUpdater.ts:46

If this desc must be updated to match the given node decoration, do so and return true.

Parameters

ParameterTypeDescription
viewDescViewDescView desc to update (changes as we enter/exit marks)
viewPmEditorViewThe editor view
nodeNode_2The new node
outerDecoreadonly PmDecoration[]New outer decorations
innerDecoDecorationSourceNew inner decorations

Returns

boolean

True if update succeeded


updateChildren()

ts
static updateChildren(
   viewDesc,
   view,
   pos): void;

Defined in: ViewDescUpdater.ts:65

Syncs this.children to match this.node.content and the local decorations, possibly introducing nesting for marks. Then, in a separate step, syncs the DOM inside this.contentDOM to this.children.

Parameters

ParameterTypeDescription
viewDescViewDescView desc to update (changes as we enter/exit marks)
viewPmEditorViewThe editor view
posnumber-

Returns

void