BlockSuite API Documentation / @blocksuite/block-std / ViewStore
Class: ViewStore
Constructors
new ViewStore()
new ViewStore(
std
):ViewStore
Parameters
• std: BlockStdScope
Returns
Source
packages/framework/block-std/src/view/view-store.ts:11
Properties
_blockMap
private
readonly
_blockMap:Map
<string
,BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>>
Source
packages/framework/block-std/src/view/view-store.ts:7
_widgetMap
private
readonly
_widgetMap:Map
<string
,WidgetElement
<BlockModel
<object
>,BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>,BlockService
<BlockModel
<object
>>>>
Source
packages/framework/block-std/src/view/view-store.ts:9
std
std:
BlockStdScope
Source
packages/framework/block-std/src/view/view-store.ts:11
Methods
calculatePath()
calculatePath(
model
):string
[]
Parameters
• model: BlockModel
<object
>
Returns
string
[]
Source
packages/framework/block-std/src/view/view-store.ts:45
deleteBlock()
deleteBlock(
node
):void
Parameters
• node: BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:35
deleteWidget()
deleteWidget(
node
):void
Parameters
• node: WidgetElement
<BlockModel
<object
>, BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>, BlockService
<BlockModel
<object
>>>
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:39
fromPath()
fromPath(
path
):null
|BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>
Parameters
• path: undefined
| null
| string
Returns
null
| BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>
Source
packages/framework/block-std/src/view/view-store.ts:55
getBlock()
getBlock(
id
):null
|BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>
Parameters
• id: string
Returns
null
| BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>
Source
packages/framework/block-std/src/view/view-store.ts:23
getWidget()
getWidget(
widgetName
,hostBlockId
):null
|WidgetElement
<BlockModel
<object
>,BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>,BlockService
<BlockModel
<object
>>>
Parameters
• widgetName: string
• hostBlockId: string
Returns
null
| WidgetElement
<BlockModel
<object
>, BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>, BlockService
<BlockModel
<object
>>>
Source
packages/framework/block-std/src/view/view-store.ts:27
mount()
mount():
void
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:111
setBlock()
setBlock(
node
):void
Parameters
• node: BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:13
setWidget()
setWidget(
node
):void
Parameters
• node: WidgetElement
<BlockModel
<object
>, BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>, BlockService
<BlockModel
<object
>>>
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:17
unmount()
unmount():
void
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:113
viewFromPath()
viewFromPath(type, path)
viewFromPath(
type
,path
):null
|BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>
Parameters
• type: "block"
• path: string
[]
Returns
null
| BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>
Source
packages/framework/block-std/src/view/view-store.ts:63
viewFromPath(type, path)
viewFromPath(
type
,path
):null
|WidgetElement
<BlockModel
<object
>,BlockElement
<BlockModel
<object
>,BlockService
<BlockModel
<object
>>,string
>,BlockService
<BlockModel
<object
>>>
Parameters
• type: "widget"
• path: string
[]
Returns
null
| WidgetElement
<BlockModel
<object
>, BlockElement
<BlockModel
<object
>, BlockService
<BlockModel
<object
>>, string
>, BlockService
<BlockModel
<object
>>>
Source
packages/framework/block-std/src/view/view-store.ts:64
walkThrough()
walkThrough(
fn
,path
?):void
Parameters
• fn
• path?: null
| string
Returns
void
Source
packages/framework/block-std/src/view/view-store.ts:77