BlockSuite API Documentation / @blocksuite/store / Workspace
Class: Workspace
Extends
WorkspaceAddonType
Constructors
new Workspace(storeOptions)
new Workspace(
storeOptions
):Workspace
Parameters
• storeOptions: WorkspaceOptions
Returns
Overrides
WorkspaceAddonType.constructor
Source
packages/framework/store/src/workspace/workspace.ts:32
Properties
_schema
protected
readonly
_schema:Schema
Source
packages/framework/store/src/workspace/workspace.ts:22
_store
protected
_store:Store
Source
packages/framework/store/src/workspace/workspace.ts:20
blob
blob:
BlobManager
Inherited from
WorkspaceAddonType.blob
Source
packages/framework/store/src/workspace/addon/type.ts:6
exportJSX
exportJSX: (
blockId
?,pageId
?) =>JSXElement
Parameters
• blockId?: string
• pageId?: string
Returns
JSXElement
Inherited from
WorkspaceAddonType.exportJSX
Source
packages/framework/store/src/workspace/addon/type.ts:12
importPageSnapshot
importPageSnapshot: (
json
,pageId
) =>Promise
<void
>
Parameters
• json: unknown
• pageId: string
Returns
Promise
<void
>
Inherited from
WorkspaceAddonType.importPageSnapshot
Source
packages/framework/store/src/workspace/addon/type.ts:11
indexer
indexer:
Indexer
Inherited from
WorkspaceAddonType.indexer
Source
packages/framework/store/src/workspace/addon/type.ts:8
meta
meta:
WorkspaceMeta
Source
packages/framework/store/src/workspace/workspace.ts:24
search
search: (
query
) =>Map
<string
,string
>
Parameters
• query: QueryContent
Returns
Map
<string
, string
>
Inherited from
WorkspaceAddonType.search
Source
packages/framework/store/src/workspace/addon/type.ts:9
slots
slots:
Object
Type declaration
pageAdded
pageAdded:
Slot
<string
>
pageRemoved
pageRemoved:
Slot
<string
>
pagesUpdated
pagesUpdated:
Slot
<void
>
Source
packages/framework/store/src/workspace/workspace.ts:26
Y
static
Y:Y
=Y
Source
packages/framework/store/src/workspace/workspace.ts:19
Accessors
awarenessStore
get
awarenessStore():AwarenessStore
<BlockSuiteFlags
>
Returns
AwarenessStore
<BlockSuiteFlags
>
Source
packages/framework/store/src/workspace/workspace.ts:64
awarenessSync
get
awarenessSync():AwarenessEngine
Returns
AwarenessEngine
Source
packages/framework/store/src/workspace/workspace.ts:88
doc
get
doc():BlockSuiteDoc
Returns
Source
packages/framework/store/src/workspace/workspace.ts:72
docSync
get
docSync():DocEngine
Returns
DocEngine
Source
packages/framework/store/src/workspace/workspace.ts:84
id
get
id():string
Returns
string
Source
packages/framework/store/src/workspace/workspace.ts:42
idGenerator
get
idGenerator():IdGenerator
Returns
Source
packages/framework/store/src/workspace/workspace.ts:76
isEmpty
get
isEmpty():boolean
Returns
boolean
Source
packages/framework/store/src/workspace/workspace.ts:46
pages
get
pages():Map
<string
,Page
>
Returns
Map
<string
, Page
>
Source
packages/framework/store/src/workspace/workspace.ts:68
schema
get
schema():Schema
Returns
Source
packages/framework/store/src/workspace/workspace.ts:80
store
get
store():Store
Returns
Source
packages/framework/store/src/workspace/workspace.ts:60
Methods
_bindPageMetaEvents()
private
_bindPageMetaEvents():void
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:102
_hasPage()
private
_hasPage(pageId
):boolean
Parameters
• pageId: string
Returns
boolean
Source
packages/framework/store/src/workspace/workspace.ts:92
canGracefulStop()
canGracefulStop():
void
Verify that all data has been successfully saved to the primary storage. Return true if the data transfer is complete and it is secure to terminate the synchronization operation.
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:190
createPage()
createPage(
options
):Page
By default, only an empty page will be created. If the init
parameter is passed, a surface
, note
, and paragraph
block will be created in the page simultaneously.
Parameters
• options: string
| Object
= {}
Returns
Source
packages/framework/store/src/workspace/workspace.ts:130
forceStop()
forceStop():
void
Terminate the data sync process forcefully, which may cause data loss. It is advised to invoke canGracefulStop
before calling this method.
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:205
getPage()
getPage(
pageId
):null
|Page
Parameters
• pageId: string
Returns
null
| Page
Source
packages/framework/store/src/workspace/workspace.ts:96
removePage()
removePage(
pageId
):void
Parameters
• pageId: string
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:166
setPageMeta()
setPageMeta(
pageId
,props
):void
Update page meta state. Note that this intentionally does not mutate page state.
Parameters
• pageId: string
• props: Partial
<PageMeta
>
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:158
start()
start():
void
Start the data sync process
Returns
void
Source
packages/framework/store/src/workspace/workspace.ts:181
waitForGracefulStop()
waitForGracefulStop(
abort
?):Promise
<void
>
Wait for all data has been successfully saved to the primary storage.
Parameters
• abort?: AbortSignal
Returns
Promise
<void
>
Source
packages/framework/store/src/workspace/workspace.ts:197
waitForSynced()
waitForSynced():
Promise
<unknown
>
Returns
Promise
<unknown
>
Source
packages/framework/store/src/workspace/workspace.ts:210
Generated using TypeDoc and typedoc-plugin-markdown.