Skip to content

Vizel API / core/src / VizelBlockPathSegment

Interface: VizelBlockPathSegment

Defined in: packages/core/src/utils/block-path.ts:12

A single segment of a block path produced by getVizelBlockPath.

Each segment describes one ancestor node between the document root and the cursor block, recorded in walk order (root first, current block last). The segment is intentionally lightweight: callers that need the underlying ProseMirror node can re-resolve from editor.state.doc at pos.

Properties

attrs?

ts
readonly optional attrs?: Readonly<Record<string, unknown>>;

Defined in: packages/core/src/utils/block-path.ts:22

Frozen shallow copy of the node's attrs, or undefined when the node carries no attributes. The object is Object.freezed to discourage mutation; ProseMirror's own attrs are never mutated through this path.


nodeType

ts
readonly nodeType: string;

Defined in: packages/core/src/utils/block-path.ts:14

ProseMirror node-type name (e.g. "doc", "bulletList", "paragraph").


pos

ts
readonly pos: number;

Defined in: packages/core/src/utils/block-path.ts:16

Document position where the node starts ($from.start(depth)-style).

Released under the MIT License.