Skip to content

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

Class: ViewStore

Constructors

new ViewStore()

new ViewStore(std): ViewStore

Parameters

std: BlockStdScope

Returns

ViewStore

Source

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

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

Source

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


std

std: BlockStdScope

Source

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

Methods

calculatePath()

calculatePath(model): string[]

Parameters

model: BlockModel<object>

Returns

string[]

Source

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


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


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


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


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


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


mount()

mount(): void

Returns

void

Source

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


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


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


unmount()

unmount(): void

Returns

void

Source

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


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

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


walkThrough()

walkThrough(fn, path?): void

Parameters

fn

path?: null | string

Returns

void

Source

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