Skip to content

BlockSuite API Documentation / @blocksuite/store / ASTWalker

Class: ASTWalker<ONode, TNode> ​

Contents ​

Type parameters ​

• ONode extends object

• TNode extends object

Constructors ​

new ASTWalker(undefined) ​

new ASTWalker<ONode, TNode>(): ASTWalker<ONode, TNode>

Returns ​

ASTWalker<ONode, TNode>

Source ​

packages/store/src/adapter/base.ts:91

Properties ​

_enter ​

private _enter: undefined | WalkerFn<ONode, TNode>

Source ​

packages/store/src/adapter/base.ts:85


_isONode ​

private _isONode: (node) => node is ONode

Parameters ​

• node: unknown

Returns ​

node is ONode

Source ​

packages/store/src/adapter/base.ts:87


_leave ​

private _leave: undefined | WalkerFn<ONode, TNode>

Source ​

packages/store/src/adapter/base.ts:86


context ​

private context: ASTWalkerContext<TNode>

Source ​

packages/store/src/adapter/base.ts:89

Methods ​

_visit() ​

private _visit(o): Promise<void>

Parameters ​

• o: NodeProps<ONode>

Returns ​

Promise<void>

Source ​

packages/store/src/adapter/base.ts:114


setEnter() ​

setEnter(fn): void

Parameters ​

• fn: WalkerFn<ONode, TNode>

Returns ​

void

Source ​

packages/store/src/adapter/base.ts:95


setLeave() ​

setLeave(fn): void

Parameters ​

• fn: WalkerFn<ONode, TNode>

Returns ​

void

Source ​

packages/store/src/adapter/base.ts:99


setONodeTypeGuard() ​

setONodeTypeGuard(fn): void

Parameters ​

• fn: (node) => node is ONode

Returns ​

void

Source ​

packages/store/src/adapter/base.ts:103


walk() ​

walk(oNode, tNode): Promise<TNode>

Parameters ​

• oNode: ONode

• tNode: TNode

Returns ​

Promise<TNode>

Source ​

packages/store/src/adapter/base.ts:107


Generated using typedoc-plugin-markdown and TypeDoc