BlockSuite API Documentation / @blocksuite/store / BlockSuiteDoc
Class: BlockSuiteDoc
Extends
Doc
Constructors
new BlockSuiteDoc()
new BlockSuiteDoc(
opts
?):BlockSuiteDoc
Parameters
• opts?: DocOpts
configuration
Returns
Inherited from
Y.Doc.constructor
Defined in
node_modules/.pnpm/[email protected]/node_modules/yjs/dist/src/utils/Doc.d.ts:35
Accessors
spaces
get
spaces():YMap
<Doc
>
Returns
YMap
<Doc
>
Defined in
packages/framework/store/src/yjs/doc.ts:16
Methods
getArrayProxy()
getArrayProxy<
Key
,Value
>(key
):Value
Type Parameters
• Key extends string
• Value extends unknown
[] = never
Parameters
• key: Key
Returns
Value
Defined in
packages/framework/store/src/yjs/doc.ts:20
getMapProxy()
getMapProxy<
Key
,Value
>(key
):Value
Type Parameters
• Key extends string
• Value extends Record
<string
, unknown
> = never
Parameters
• key: Key
Returns
Value
Defined in
packages/framework/store/src/yjs/doc.ts:30
toJSON()
toJSON():
Record
<string
,any
>
Converts the entire document into a js object, recursively traversing each yjs type Doesn't log types that have not been defined (using ydoc.getType(..)).
Returns
Record
<string
, any
>
Deprecated
Do not use this method and rather call toJSON directly on the shared types.
Overrides
Y.Doc.toJSON
Defined in
packages/framework/store/src/yjs/doc.ts:44
transact()
transact<
T
>(f
,origin
?):T
Changes that happen inside of a transaction are bundled. This means that the observer fires after the transaction is finished and that all changes that happened inside of the transaction are sent as one message to the other peers.
Type Parameters
• T
Parameters
• f
The function that should be executed as a transaction
• origin?: string
| number
Origin of who started the transaction. Will be stored on transaction.origin
Returns
T
T
Overrides
Y.Doc.transact
Defined in
packages/framework/store/src/yjs/doc.ts:57