Skip to content

API > @blocksuite/store > Space

Class: Space<State> ​

Extended By ​

Constructors ​

constructor ​

new Space<State>( id, doc, awarenessStore): Space< State >

Type parameters ​

ParameterDefault
State extends Record< string, unknown >Record< string, any >

Parameters ​

ParameterType
idstring
docBlockSuiteDoc
awarenessStoreAwarenessStore< BlockSuiteFlags >

Returns ​

Space< State >

Defined In ​

packages/store/src/workspace/space.ts:32

Properties ​

_loaded ​

private _loaded: boolean

Defined In ​

packages/store/src/workspace/space.ts:20


_onLoadSlot ​

private _onLoadSlot: Slot< void >

Defined In ​

packages/store/src/workspace/space.ts:22


_proxy ​

protected readonly _proxy: State

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

Defined In ​

packages/store/src/workspace/space.ts:28


_yBlocks ​

protected readonly _yBlocks: Map< State[keyof State] >

Defined In ​

packages/store/src/workspace/space.ts:30


_ySpaceDoc ​

protected readonly _ySpaceDoc: Doc

Defined In ​

packages/store/src/workspace/space.ts:29


awarenessStore ​

readonly awarenessStore: AwarenessStore< BlockSuiteFlags >

Defined In ​

packages/store/src/workspace/space.ts:18


doc ​

readonly doc: BlockSuiteDoc

Defined In ​

packages/store/src/workspace/space.ts:17


id ​

readonly id: string

Defined In ​

packages/store/src/workspace/space.ts:16

Accessors ​

loaded ​

get loaded(): boolean

Defined In ​

packages/store/src/workspace/space.ts:43


spaceDoc ​

get spaceDoc(): Doc

Defined In ​

packages/store/src/workspace/space.ts:47

Methods ​

_initSubDoc ​

private _initSubDoc(): Doc

Returns ​

Doc

Defined In ​

packages/store/src/workspace/space.ts:84


_onSubdocEvent ​

private _onSubdocEvent(__namedParameters): void

Parameters ​

ParameterType
__namedParametersobject
__namedParameters.loadedSet< Doc >

Returns ​

void

Defined In ​

packages/store/src/workspace/space.ts:101


clear ​

clear(): void

Returns ​

void

Defined In ​

packages/store/src/workspace/space.ts:80


destroy ​

destroy(): void

Returns ​

void

Defined In ​

packages/store/src/workspace/space.ts:74


remove ​

remove(): void

Returns ​

void

Defined In ​

packages/store/src/workspace/space.ts:69


transact ​

transact(fn, shouldTransact = true): void

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

Parameters ​

ParameterTypeDefault value
fnfunctionundefined
shouldTransactbooleantrue

Returns ​

void

Defined In ​

packages/store/src/workspace/space.ts:116


waitForLoaded ​

waitForLoaded(): Promise< Space< State > >

Returns ​

Promise< Space< State > >

Defined In ​

packages/store/src/workspace/space.ts:51