BlockSuite API Documentation / @blocksuite/store / Space
Class: Space<State>
Extended by
Type parameters
• State extends Record
<string
, unknown
> = Record
<string
, any
>
Constructors
new Space()
new Space<
State
>(id
,rootDoc
,awarenessStore
):Space
<State
>
Parameters
• id: string
• rootDoc: BlockSuiteDoc
• awarenessStore: AwarenessStore
<BlockSuiteFlags
>
Returns
Space
<State
>
Source
packages/framework/store/src/store/space.ts:45
Properties
_loaded
private
_loaded:boolean
Source
packages/framework/store/src/store/space.ts:27
_onLoadSlot
private
_onLoadSlot:Slot
<void
>
Source
packages/framework/store/src/store/space.ts:29
_yBlocks
protected
readonly
_yBlocks:Map
<State
[keyofState
]>
Source
packages/framework/store/src/store/space.ts:37
_ySpaceDoc
Internal
protected
readonly
_ySpaceDoc:Doc
Used for convenient access to the underlying Yjs map, can be used interchangeably with ySpace
Source
packages/framework/store/src/store/space.ts:35
awarenessStore
readonly
awarenessStore:AwarenessStore
<BlockSuiteFlags
>
Source
packages/framework/store/src/store/space.ts:43
id
readonly
id:string
Source
packages/framework/store/src/store/space.ts:39
rootDoc
readonly
rootDoc:BlockSuiteDoc
Source
packages/framework/store/src/store/space.ts:41
Accessors
loaded
get
loaded():boolean
Returns
boolean
Source
packages/framework/store/src/store/space.ts:19
spaceDoc
get
spaceDoc():Doc
Returns
Source
packages/framework/store/src/store/space.ts:23
yBlocks
get
yBlocks():Map
<State
[keyofState
]>
Returns
Map
<State
[keyof State
]>
Source
packages/framework/store/src/store/space.ts:15
Methods
_initSubDoc()
private
_initSubDoc():Doc
Returns
Source
packages/framework/store/src/store/space.ts:59
_onSubdocEvent()
private
_onSubdocEvent(__namedParameters
):void
Parameters
• __namedParameters
• __namedParameters.loaded: Set
<Doc
>
Returns
void
Source
packages/framework/store/src/store/space.ts:76
clear()
clear():
void
Returns
void
Source
packages/framework/store/src/store/space.ts:105
destroy()
destroy():
void
Returns
void
Source
packages/framework/store/src/store/space.ts:99
load()
load():
Space
<State
>
Returns
Space
<State
>
Source
packages/framework/store/src/store/space.ts:88
remove()
remove():
void
Returns
void
Source
packages/framework/store/src/store/space.ts:94
transact()
transact(
fn
,shouldTransact
):void
If shouldTransact
is false
, the transaction will not be push to the history stack.
Parameters
• fn
• shouldTransact: boolean
= true
Returns
void
Source
packages/framework/store/src/store/space.ts:112