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<{ id: string; type: "add"; } | { id: string; type: "delete"; }>

Defined in

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

Accessors

awarenessSync

Get Signature

get awarenessSync(): AwarenessEngine

Returns

AwarenessEngine

Defined in

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


blobSync

Get Signature

get blobSync(): BlobEngine

Returns

BlobEngine

Defined in

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


canRedo

Get Signature

get canRedo(): boolean

Returns

boolean

Defined in

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


canRedo$

Get Signature

get canRedo$(): Signal<boolean>

Returns

Signal<boolean>

Defined in

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


canUndo

Get Signature

get canUndo(): boolean

Returns

boolean

Defined in

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


canUndo$

Get Signature

get canUndo$(): Signal<boolean>

Returns

Signal<boolean>

Defined in

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


collection

Get Signature

get collection(): DocCollection

Returns

DocCollection

Defined in

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


crud

Get Signature

get crud(): DocCRUD

Returns

DocCRUD

Defined in

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


docSync

Get Signature

get docSync(): DocEngine

Returns

DocEngine

Defined in

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


history

Get Signature

get history(): UndoManager

Returns

UndoManager

Defined in

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


isEmpty

Get Signature

get isEmpty(): boolean

Returns

boolean

Defined in

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


loaded

Get Signature

get loaded(): boolean

Returns

boolean

Defined in

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


meta

Get Signature

get meta(): undefined | DocMeta

Returns

undefined | DocMeta

Defined in

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


readonly

Get Signature

get readonly(): boolean

Returns

boolean

Defined in

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


ready

Get Signature

get ready(): boolean

Returns

boolean

Defined in

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


schema

Get Signature

get schema(): Schema

Returns

Schema

Defined in

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


spaceDoc

Get Signature

get spaceDoc(): Doc

Returns

Doc

Defined in

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


Text

Get Signature

get Text(): typeof Text

Returns

typeof Text

Defined in

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


yBlocks

Get Signature

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?

() => void

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

() => void

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

() => void

Returns

void

Defined in

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