Skip to content

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

Class: ViewStore ​

Contents ​

Constructors ​

new ViewStore(std) ​

new ViewStore(std): ViewStore

Parameters ​

• std: BlockStdProvider

Returns ​

ViewStore

Source ​

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

Properties ​

_cachedPath ​

private _cachedPath: Map<Node, NodeView[]>

Source ​

block-std/src/view/view-store.ts:21


_cachedTree ​

private _cachedTree: null | NodeViewTree = null

Source ​

block-std/src/view/view-store.ts:20


_observer ​

private _observer: MutationObserver

Source ​

block-std/src/view/view-store.ts:22


std ​

std: BlockStdProvider

Source ​

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


viewSpec ​

readonly viewSpec: Set<BlockSuiteViewSpec<any>>

Source ​

block-std/src/view/view-store.ts:23

Methods ​

_calculateNodeViewPath() ​

private _calculateNodeViewPath(node): NodeView[]

Parameters ​

• node: Node

Returns ​

NodeView[]

Source ​

block-std/src/view/view-store.ts:65


_getViewSpec() ​

private _getViewSpec(type): undefined | BlockSuiteViewSpec<any>

Parameters ​

• type: string

Returns ​

undefined | BlockSuiteViewSpec<any>

Source ​

block-std/src/view/view-store.ts:61


_indexOf() ​

private _indexOf(path, parent): number

Parameters ​

• path: string[]

• parent: NodeViewTree

Returns ​

number

Source ​

block-std/src/view/view-store.ts:321


calculatePath() ​

calculatePath(node): string[]

Parameters ​

• node: Node

Returns ​

string[]

Source ​

block-std/src/view/view-store.ts:56


findNext() ​

findNext(path, fn): null | NodeViewTree

Parameters ​

• path: string[]

• fn: (nodeView, index, parent) => undefined | null | true

Returns ​

null | NodeViewTree

Source ​

block-std/src/view/view-store.ts:247


findPrev() ​

findPrev(path, fn): null | NodeViewTree

Parameters ​

• path: string[]

• fn: (nodeView, index, parent) => undefined | null | true

Returns ​

null | NodeViewTree

Source ​

block-std/src/view/view-store.ts:192


fromPath() ​

fromPath(path): null | NodeViewTree<unknown>

Parameters ​

• path: string[]

Returns ​

null | NodeViewTree<unknown>

Source ​

block-std/src/view/view-store.ts:129


getChildren() ​

getChildren(path): NodeViewTree[]

Parameters ​

• path: string[]

Returns ​

NodeViewTree[]

Source ​

block-std/src/view/view-store.ts:32


getNodeView() ​

getNodeView(node): null | NodeView

Parameters ​

• node: Node

Returns ​

null | NodeView

Source ​

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


getNodeViewTree() ​

getNodeViewTree(): NodeViewTree

Returns ​

NodeViewTree

Source ​

block-std/src/view/view-store.ts:94


getParent() ​

getParent(path): null | NodeViewTree<unknown>

Parameters ​

• path: string[]

Returns ​

null | NodeViewTree<unknown>

Source ​

block-std/src/view/view-store.ts:185


indexOf() ​

indexOf(path): number

Parameters ​

• path: string[]

Returns ​

number

Source ​

block-std/src/view/view-store.ts:302


mount() ​

mount(): void

Returns ​

void

Source ​

block-std/src/view/view-store.ts:310


register() ​

register<T>(spec): void

Type parameters ​

• T extends never

Parameters ​

• spec: View[T]

Returns ​

void

Source ​

block-std/src/view/view-store.ts:40


unmount() ​

unmount(): void

Returns ​

void

Source ​

block-std/src/view/view-store.ts:314


viewFromPath() ​

viewFromPath(type, path) ​

viewFromPath<T>(type, path): null | SpecToNodeView<View[T]>

Type parameters ​

• T extends never

Parameters ​

• type: T

• path: string[]

Returns ​

null | SpecToNodeView<View[T]>

Source ​

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 ​

block-std/src/view/view-store.ts:147


walkThrough() ​

walkThrough(fn, path): void

Parameters ​

• fn: (nodeView, index, parent) => undefined | null | true

• path: string[]= []

Returns ​

void

Source ​

block-std/src/view/view-store.ts:162


Generated using typedoc-plugin-markdown and TypeDoc