BlockSuite API Documentation / @blocksuite/store / BlockCollection
Class: BlockCollection
Extends
Space
<FlatBlockMap
>
Constructors
new BlockCollection()
new BlockCollection(
__namedParameters
):BlockCollection
Parameters
• __namedParameters: DocOptions
Returns
Overrides
Source
packages/framework/store/src/store/doc/block-collection.ts:137
Properties
_collection
private
readonly
_collection:DocCollection
Source
packages/framework/store/src/store/doc/block-collection.ts:104
_docCRUD
private
readonly
_docCRUD:DocCRUD
Source
packages/framework/store/src/store/doc/block-collection.ts:108
_docMap
private
_docMap:object
false
false:
WeakMap
<BlockSelector
,Doc
>
true
true:
WeakMap
<BlockSelector
,Doc
>
undefined
undefined:
WeakMap
<BlockSelector
,Doc
>
Source
packages/framework/store/src/store/doc/block-collection.ts:117
_history
private
_history:UndoManager
Source
packages/framework/store/src/store/doc/block-collection.ts:110
_idGenerator
private
readonly
_idGenerator:IdGenerator
Source
packages/framework/store/src/store/doc/block-collection.ts:106
_ready
private
_ready:boolean
=false
Indicate whether the block tree is ready
Source
packages/framework/store/src/store/doc/block-collection.ts:113
_shouldTransact
private
_shouldTransact:boolean
=true
Source
packages/framework/store/src/store/doc/block-collection.ts:115
_yBlocks
Inherited from
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
Inherited from
Source
packages/framework/store/src/store/space.ts:35
awarenessStore
readonly
awarenessStore:AwarenessStore
<BlockSuiteFlags
>
Inherited from
Source
packages/framework/store/src/store/space.ts:43
id
readonly
id:string
Inherited from
Source
packages/framework/store/src/store/space.ts:39
rootDoc
readonly
rootDoc:BlockSuiteDoc
Inherited from
Source
packages/framework/store/src/store/space.ts:41
slots
readonly
slots:object
historyUpdated
historyUpdated:
Slot
<void
>
yBlockUpdated
yBlockUpdated:
Slot
<object
|object
>
Source
packages/framework/store/src/store/doc/block-collection.ts:123
Accessors
Text
get
Text(): typeofText
Returns
typeof Text
Source
packages/framework/store/src/store/doc/block-collection.ts:100
awarenessSync
get
awarenessSync():AwarenessEngine
Returns
AwarenessEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:66
blobSync
get
blobSync():BlobEngine
Returns
BlobEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:70
canRedo
get
canRedo():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:93
canUndo
get
canUndo():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:86
collection
get
collection():DocCollection
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:58
crud
get
crud():DocCRUD
Returns
DocCRUD
Source
packages/framework/store/src/store/doc/block-collection.ts:54
docSync
get
docSync():DocEngine
Returns
DocEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:62
history
get
history():UndoManager
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:50
isEmpty
get
isEmpty():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:82
loaded
get
loaded():boolean
Returns
boolean
Source
packages/framework/store/src/store/space.ts:19
meta
get
meta():undefined
|DocMeta
Returns
undefined
| DocMeta
Source
packages/framework/store/src/store/doc/block-collection.ts:78
readonly
get
readonly():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:42
ready
get
ready():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:46
schema
get
schema():Schema
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:74
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
_getReadonlyKey()
private
_getReadonlyKey(readonly
?):"undefined"
|"true"
|"false"
Parameters
• readonly?: boolean
Returns
"undefined"
| "true"
| "false"
Source
packages/framework/store/src/store/doc/block-collection.ts:150
_handleVersion()
private
_handleVersion():void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:208
_handleYBlockAdd()
private
_handleYBlockAdd(id
):void
Parameters
• id: string
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:171
_handleYBlockDelete()
private
_handleYBlockDelete(id
):void
Parameters
• id: string
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:175
_handleYEvent()
private
_handleYEvent(event
):void
Parameters
• event: YEvent
<Text
| Array
<unknown
> | YBlock
>
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:179
_handleYEvents()
private
_handleYEvents(events
):void
Parameters
• events: YEvent
<Text
| YBlock
>[]
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:204
_historyObserver()
private
_historyObserver():void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:167
_initYBlocks()
private
_initYBlocks():void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:154
captureSync()
captureSync():
void
Capture current operations to undo stack synchronously.
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:276
clear()
clear():
void
Returns
void
Inherited from
Source
packages/framework/store/src/store/space.ts:105
clearSelector()
clearSelector(
selector
,readonly
?):void
Parameters
• selector: BlockSelector
• readonly?: boolean
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:240
destroy()
destroy():
void
Returns
void
Inherited from
Source
packages/framework/store/src/store/space.ts:99
dispose()
dispose():
void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:312
generateBlockId()
generateBlockId():
string
Returns
string
Source
packages/framework/store/src/store/doc/block-collection.ts:284
getDoc()
getDoc(
__namedParameters
):Doc
Parameters
• __namedParameters: GetDocOptions
= {}
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:220
load()
load(
initFn
?):this
Parameters
• initFn?
Returns
this
Overrides
Source
packages/framework/store/src/store/doc/block-collection.ts:288
redo()
redo():
void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:267
remove()
remove():
void
Returns
void
Inherited from
Source
packages/framework/store/src/store/space.ts:94
resetHistory()
resetHistory():
void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:280
transact()
transact(
fn
,shouldTransact
):void
If shouldTransact
is false
, the transaction will not be push to the history stack.
Parameters
• fn
• shouldTransact: boolean
= undefined
Returns
void
Overrides
Source
packages/framework/store/src/store/doc/block-collection.ts:252
undo()
undo():
void
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:259
withoutTransact()
withoutTransact(
callback
):void
Parameters
• callback
Returns
void
Source
packages/framework/store/src/store/doc/block-collection.ts:246