Skip to content

BlockSuite API Documentation / @blocksuite/block-std / ViewStore

Class: ViewStore

Constructors

new ViewStore(std)

new ViewStore(std): ViewStore

Parameters

std: BlockStdScope

Returns

ViewStore

Source

packages/framework/block-std/src/view/view-store.ts:43

Properties

_blockMap

private readonly _blockMap: Map<string, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Source

packages/framework/block-std/src/view/view-store.ts:8


_widgetMap

private readonly _widgetMap: Map<string, WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>>

Source

packages/framework/block-std/src/view/view-store.ts:9


std

std: BlockStdScope

Source

packages/framework/block-std/src/view/view-store.ts:43

Methods

calculatePath()

calculatePath(node): string[]

Parameters

node: BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string> | WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

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:33


deleteWidget()

deleteWidget(node): void

Parameters

node: WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Returns

void

Source

packages/framework/block-std/src/view/view-store.ts:37


fromPath()

fromPath(path): null | BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>

Parameters

path: 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:21


getParent()

getParent(path): null | BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>

Parameters

path: string[]

Returns

null | BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>

Source

packages/framework/block-std/src/view/view-store.ts:111


getWidget()

getWidget(widgetName, hostBlockId): null | WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Parameters

widgetName: string

hostBlockId: string

Returns

null | WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Source

packages/framework/block-std/src/view/view-store.ts:25


mount()

mount(): void

Returns

void

Source

packages/framework/block-std/src/view/view-store.ts:118


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:11


setWidget()

setWidget(node): void

Parameters

node: WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Returns

void

Source

packages/framework/block-std/src/view/view-store.ts:15


unmount()

unmount(): void

Returns

void

Source

packages/framework/block-std/src/view/view-store.ts:120


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>>

Parameters

type: "widget"

path: string[]

Returns

null | WidgetElement<BlockModel<object>, BlockElement<BlockModel<object>, BlockService<BlockModel<object>>, string>>

Source

packages/framework/block-std/src/view/view-store.ts:64


walkThrough()

walkThrough(fn, path): void

Parameters

fn

path: string[]= []

Returns

void

Source

packages/framework/block-std/src/view/view-store.ts:77