BlockSuite API Documentation / @blocksuite/block-std / ViewStore
Class: ViewStore
Constructors
new ViewStore(std)
new ViewStore(
std
):ViewStore
Parameters
• std: BlockStdScope
Returns
Source
packages/framework/block-std/src/view/view-store.ts:25
Properties
_cachedPath
private
_cachedPath:Map
<Node
,NodeView
[]>
Source
packages/framework/block-std/src/view/view-store.ts:21
_cachedTree
private
_cachedTree:null
|NodeViewTree
=null
Source
packages/framework/block-std/src/view/view-store.ts:20
_observer
private
_observer:MutationObserver
Source
packages/framework/block-std/src/view/view-store.ts:22
std
std:
BlockStdScope
Source
packages/framework/block-std/src/view/view-store.ts:25
viewSpec
readonly
viewSpec:Set
<BlockSuiteViewSpec
<any
>>
Source
packages/framework/block-std/src/view/view-store.ts:23
Methods
_calculateNodeViewPath()
private
_calculateNodeViewPath(node
):NodeView
[]
Parameters
• node: Node
Returns
NodeView
[]
Source
packages/framework/block-std/src/view/view-store.ts:65
_getViewSpec()
private
_getViewSpec(type
):undefined
|BlockSuiteViewSpec
<any
>
Parameters
• type: string
Returns
undefined
| BlockSuiteViewSpec
<any
>
Source
packages/framework/block-std/src/view/view-store.ts:61
_indexOf()
private
_indexOf(path
,parent
):number
Parameters
• path: string
[]
• parent: NodeViewTree
Returns
number
Source
packages/framework/block-std/src/view/view-store.ts:321
calculatePath()
calculatePath(
node
):string
[]
Parameters
• node: Node
Returns
string
[]
Source
packages/framework/block-std/src/view/view-store.ts:56
findNext()
findNext(
path
,fn
):null
|NodeViewTree
Parameters
• path: string
[]
• fn
Returns
null
| NodeViewTree
Source
packages/framework/block-std/src/view/view-store.ts:247
findPrev()
findPrev(
path
,fn
):null
|NodeViewTree
Parameters
• path: string
[]
• fn
Returns
null
| NodeViewTree
Source
packages/framework/block-std/src/view/view-store.ts:192
fromPath()
fromPath(
path
):null
|NodeViewTree
<BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
> |WidgetElement
<BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>>>
Parameters
• path: string
[]
Returns
null
| NodeViewTree
<BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
> | WidgetElement
<BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>>>
Source
packages/framework/block-std/src/view/view-store.ts:129
getChildren()
getChildren(
path
):NodeViewTree
[]
Parameters
• path: string
[]
Returns
Source
packages/framework/block-std/src/view/view-store.ts:32
getNodeView()
getNodeView(
node
):null
|NodeView
Parameters
• node: Node
Returns
null
| NodeView
Source
packages/framework/block-std/src/view/view-store.ts:44
getNodeViewTree()
getNodeViewTree():
NodeViewTree
Returns
Source
packages/framework/block-std/src/view/view-store.ts:94
getParent()
getParent(
path
):null
|NodeViewTree
<BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
> |WidgetElement
<BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>>>
Parameters
• path: string
[]
Returns
null
| NodeViewTree
<BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
> | WidgetElement
<BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>>>
Source
packages/framework/block-std/src/view/view-store.ts:185
indexOf()
indexOf(
path
):number
Parameters
• path: string
[]
Returns
number
Source
packages/framework/block-std/src/view/view-store.ts:302
mount()
mount():
void
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:310
register()
register<
T
>(spec
):void
Type parameters
• T extends keyof NodeViewType
Parameters
• spec: View
[T
]
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:40
unmount()
unmount():
void
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:314
viewFromPath()
viewFromPath(type, path)
viewFromPath<
T
>(type
,path
):null
|SpecToNodeView
<View
[T
]>
Type parameters
• T extends keyof NodeViewType
Parameters
• type: T
• path: string
[]
Returns
null
| SpecToNodeView
<View
[T
]>
Source
packages/framework/block-std/src/view/view-store.ts:143
viewFromPath(type, path)
viewFromPath<
T
>(type
,path
):null
|SpecToNodeView
<T
>
Type parameters
• T extends BlockSuiteViewSpec
<any
>
Parameters
• type: string
• path: string
[]
Returns
null
| SpecToNodeView
<T
>
Source
packages/framework/block-std/src/view/view-store.ts:147
walkThrough()
walkThrough(
fn
,path
):void
Parameters
• fn
• path: string
[]= []
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:162