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
privatereadonly_collection:DocCollection
Source
packages/framework/store/src/store/doc/block-collection.ts:104
_docCRUD
privatereadonly_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
privatereadonly_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
protectedreadonly_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
readonlyawarenessStore:AwarenessStore<BlockSuiteFlags>
Inherited from
Source
packages/framework/store/src/store/space.ts:43
id
readonlyid:string
Inherited from
Source
packages/framework/store/src/store/space.ts:39
rootDoc
readonlyrootDoc:BlockSuiteDoc
Inherited from
Source
packages/framework/store/src/store/space.ts:41
slots
readonlyslots:object
historyUpdated
historyUpdated:
Slot<void>
yBlockUpdated
yBlockUpdated:
Slot<object|object>
Source
packages/framework/store/src/store/doc/block-collection.ts:123
Accessors
Text
getText(): typeofText
Returns
typeof Text
Source
packages/framework/store/src/store/doc/block-collection.ts:100
awarenessSync
getawarenessSync():AwarenessEngine
Returns
AwarenessEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:66
blobSync
getblobSync():BlobEngine
Returns
BlobEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:70
canRedo
getcanRedo():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:93
canUndo
getcanUndo():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:86
collection
getcollection():DocCollection
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:58
crud
getcrud():DocCRUD
Returns
DocCRUD
Source
packages/framework/store/src/store/doc/block-collection.ts:54
docSync
getdocSync():DocEngine
Returns
DocEngine
Source
packages/framework/store/src/store/doc/block-collection.ts:62
history
gethistory():UndoManager
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:50
isEmpty
getisEmpty():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:82
loaded
getloaded():boolean
Returns
boolean
Source
packages/framework/store/src/store/space.ts:19
meta
getmeta():undefined|DocMeta
Returns
undefined | DocMeta
Source
packages/framework/store/src/store/doc/block-collection.ts:78
readonly
getreadonly():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:42
ready
getready():boolean
Returns
boolean
Source
packages/framework/store/src/store/doc/block-collection.ts:46
schema
getschema():Schema
Returns
Source
packages/framework/store/src/store/doc/block-collection.ts:74
spaceDoc
getspaceDoc():Doc
Returns
Source
packages/framework/store/src/store/space.ts:23
yBlocks
getyBlocks():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