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