Skip to content

BlockSuite API Documentation / @blocksuite/store / ASTWalker

Class: ASTWalker<ONode, TNode>

Type parameters

ONode extends object

TNode extends object | never

Constructors

new ASTWalker(undefined)

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

Returns

ASTWalker<ONode, TNode>

Source

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

Properties

_enter

private _enter: undefined | WalkerFn<ONode, TNode>

Source

packages/framework/store/src/adapter/base.ts:97


_isONode()

private _isONode: (node) => node is ONode

Parameters

node: unknown

Returns

node is ONode

Source

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


_leave

private _leave: undefined | WalkerFn<ONode, TNode>

Source

packages/framework/store/src/adapter/base.ts:98


context

private context: ASTWalkerContext<TNode>

Source

packages/framework/store/src/adapter/base.ts:101

Methods

_visit()

private _visit(o): Promise<void>

Parameters

o: NodeProps<ONode>

Returns

Promise<void>

Source

packages/framework/store/src/adapter/base.ts:130


setEnter()

setEnter(fn): void

Parameters

fn: WalkerFn<ONode, TNode>

Returns

void

Source

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


setLeave()

setLeave(fn): void

Parameters

fn: WalkerFn<ONode, TNode>

Returns

void

Source

packages/framework/store/src/adapter/base.ts:111


setONodeTypeGuard()

setONodeTypeGuard(fn): void

Parameters

fn

Returns

void

Source

packages/framework/store/src/adapter/base.ts:115


walk()

walk(oNode, tNode): Promise<TNode>

Parameters

oNode: ONode

tNode: TNode

Returns

Promise<TNode>

Source

packages/framework/store/src/adapter/base.ts:119


walkONode()

walkONode(oNode): Promise<void>

Parameters

oNode: ONode

Returns

Promise<void>

Source

packages/framework/store/src/adapter/base.ts:126