Skip to content

BlockSuite API Documentation / @blocksuite/store / BlockCollection

Class: BlockCollection

Constructors

new BlockCollection()

new BlockCollection(__namedParameters): BlockCollection

Parameters

__namedParameters: DocOptions

Returns

BlockCollection

Defined in

packages/framework/store/src/store/doc/block-collection.ts:225

Properties

_yBlocks

protected readonly _yBlocks: YMap<YBlock>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:120


_ySpaceDoc

protected readonly _ySpaceDoc: Doc

Internal

Used for convenient access to the underlying Yjs map, can be used interchangeably with ySpace

Defined in

packages/framework/store/src/store/doc/block-collection.ts:126


awarenessStore

readonly awarenessStore: AwarenessStore<BlockSuiteFlags>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:128


id

readonly id: string

Defined in

packages/framework/store/src/store/doc/block-collection.ts:130


rootDoc

readonly rootDoc: BlockSuiteDoc

Defined in

packages/framework/store/src/store/doc/block-collection.ts:132


slots

readonly slots: object

historyUpdated

historyUpdated: Slot<void>

yBlockUpdated

yBlockUpdated: Slot<object | object>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:134

Accessors

awarenessSync

get awarenessSync(): AwarenessEngine

Returns

AwarenessEngine

Defined in

packages/framework/store/src/store/doc/block-collection.ts:149


blobSync

get blobSync(): BlobEngine

Returns

BlobEngine

Defined in

packages/framework/store/src/store/doc/block-collection.ts:153


canRedo

get canRedo(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:157


canRedo$

get canRedo$(): Signal<boolean>

Returns

Signal<boolean>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:161


canUndo

get canUndo(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:165


canUndo$

get canUndo$(): Signal<boolean>

Returns

Signal<boolean>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:169


collection

get collection(): DocCollection

Returns

DocCollection

Defined in

packages/framework/store/src/store/doc/block-collection.ts:173


crud

get crud(): DocCRUD

Returns

DocCRUD

Defined in

packages/framework/store/src/store/doc/block-collection.ts:177


docSync

get docSync(): DocEngine

Returns

DocEngine

Defined in

packages/framework/store/src/store/doc/block-collection.ts:181


history

get history(): UndoManager

Returns

UndoManager

Defined in

packages/framework/store/src/store/doc/block-collection.ts:185


isEmpty

get isEmpty(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:189


loaded

get loaded(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:193


meta

get meta(): undefined | DocMeta

Returns

undefined | DocMeta

Defined in

packages/framework/store/src/store/doc/block-collection.ts:197


readonly

get readonly(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:201


ready

get ready(): boolean

Returns

boolean

Defined in

packages/framework/store/src/store/doc/block-collection.ts:205


schema

get schema(): Schema

Returns

Schema

Defined in

packages/framework/store/src/store/doc/block-collection.ts:209


spaceDoc

get spaceDoc(): Doc

Returns

Doc

Defined in

packages/framework/store/src/store/doc/block-collection.ts:213


Text

get Text(): typeof Text

Returns

typeof Text

Defined in

packages/framework/store/src/store/doc/block-collection.ts:217


yBlocks

get yBlocks(): YMap<YBlock>

Returns

YMap<YBlock>

Defined in

packages/framework/store/src/store/doc/block-collection.ts:221

Methods

captureSync()

captureSync(): void

Capture current operations to undo stack synchronously.

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:304


clear()

clear(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:308


clearQuery()

clearQuery(query, readonly?): void

Parameters

query: Query

readonly?: boolean

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:312


destroy()

destroy(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:318


dispose()

dispose(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:324


generateBlockId()

generateBlockId(): string

Returns

string

Defined in

packages/framework/store/src/store/doc/block-collection.ts:334


getDoc()

getDoc(__namedParameters): Doc

Parameters

__namedParameters: GetDocOptions = {}

Returns

Doc

Defined in

packages/framework/store/src/store/doc/block-collection.ts:338


load()

load(initFn?): this

Parameters

initFn?

Returns

this

Defined in

packages/framework/store/src/store/doc/block-collection.ts:360


redo()

redo(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:391


remove()

remove(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:399


resetHistory()

resetHistory(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:404


transact()

transact(fn, shouldTransact): void

If shouldTransact is false, the transaction will not be push to the history stack.

Parameters

fn

shouldTransact: boolean = ...

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:411


undo()

undo(): void

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:428


withoutTransact()

withoutTransact(callback): void

Parameters

callback

Returns

void

Defined in

packages/framework/store/src/store/doc/block-collection.ts:436