Skip to content

API > @blocksuite/store > ASTWalker

Class: ASTWalker<ONode, TNode> ​

Constructors ​

constructor ​

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

Type parameters ​

Parameter
ONode extends object
TNode extends object

Returns ​

ASTWalker< ONode, TNode >

Defined In ​

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

Properties ​

_enter ​

private _enter: undefined | WalkerFn< ONode, TNode >

Defined In ​

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


_isONode ​

private _isONode: function

Parameters ​

ParameterType
nodeunknown

Returns ​

node is ONode

Defined In ​

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


_leave ​

private _leave: undefined | WalkerFn< ONode, TNode >

Defined In ​

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


context ​

private context: ASTWalkerContext< TNode >

Defined In ​

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

Methods ​

_visit ​

private _visit(o): Promise< void >

Parameters ​

ParameterType
oNodeProps< ONode >

Returns ​

Promise< void >

Defined In ​

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


setEnter ​

setEnter(fn): void

Parameters ​

ParameterType
fnWalkerFn< ONode, TNode >

Returns ​

void

Defined In ​

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


setLeave ​

setLeave(fn): void

Parameters ​

ParameterType
fnWalkerFn< ONode, TNode >

Returns ​

void

Defined In ​

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


setONodeTypeGuard ​

setONodeTypeGuard(fn): void

Parameters ​

ParameterType
fnfunction

Returns ​

void

Defined In ​

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


walk ​

walk(oNode, tNode): Promise< TNode >

Parameters ​

ParameterType
oNodeONode
tNodeTNode

Returns ​

Promise< TNode >

Defined In ​

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