Skip to content

API > @blocksuite/store > Workspace

Class: Workspace ​

Extends ​

  • WorkspaceAddonType

Constructors ​

constructor ​

new Workspace(storeOptions): Workspace

Parameters ​

ParameterType
storeOptionsWorkspaceOptions

Returns ​

Workspace

Overrides ​

WorkspaceAddonType.constructor

Defined In ​

packages/store/src/workspace/workspace.ts:33

Properties ​

_schema ​

protected readonly _schema: Schema

Defined In ​

packages/store/src/workspace/workspace.ts:23


_store ​

protected _store: Store

Defined In ​

packages/store/src/workspace/workspace.ts:21


blob ​

blob: BlobManager

Defined In ​

packages/store/src/workspace/addon/type.ts:6

Inherited from ​

WorkspaceAddonType.blob


exportJSX ​

exportJSX: function

Parameters ​

ParameterType
blockId?string
pageId?string

Returns ​

JSXElement

Defined In ​

packages/store/src/workspace/addon/type.ts:14

Inherited from ​

WorkspaceAddonType.exportJSX


exportPageSnapshot ​

exportPageSnapshot: function

Parameters ​

ParameterType
pageIdstring

Returns ​

Record< string, unknown >

Defined In ​

packages/store/src/workspace/addon/type.ts:12

Inherited from ​

WorkspaceAddonType.exportPageSnapshot


exportPageYDoc ​

exportPageYDoc: function

Parameters ​

ParameterType
pageIdstring

Returns ​

void

Defined In ​

packages/store/src/workspace/addon/type.ts:13

Inherited from ​

WorkspaceAddonType.exportPageYDoc


importPageSnapshot ​

importPageSnapshot: function

Parameters ​

ParameterType
jsonunknown
pageIdstring

Returns ​

Promise< void >

Defined In ​

packages/store/src/workspace/addon/type.ts:11

Inherited from ​

WorkspaceAddonType.importPageSnapshot


indexer ​

indexer: Indexer

Defined In ​

packages/store/src/workspace/addon/type.ts:8

Inherited from ​

WorkspaceAddonType.indexer


meta ​

meta: WorkspaceMeta

Defined In ​

packages/store/src/workspace/workspace.ts:25


search: function

Parameters ​

ParameterType
queryQueryContent

Returns ​

Map< string, string >

Defined In ​

packages/store/src/workspace/addon/type.ts:9

Inherited from ​

WorkspaceAddonType.search


slots ​

slots: object

Type declaration ​

slots.pageAdded ​

pageAdded: Slot< string >

slots.pageRemoved ​

pageRemoved: Slot< string >

slots.pagesUpdated ​

pagesUpdated: Slot< void >

Defined In ​

packages/store/src/workspace/workspace.ts:27


Y ​

static Y: Y = Y

Defined In ​

packages/store/src/workspace/workspace.ts:20

Accessors ​

awarenessStore ​

get awarenessStore(): AwarenessStore< BlockSuiteFlags >

Defined In ​

packages/store/src/workspace/workspace.ts:61


doc ​

get doc(): BlockSuiteDoc

Defined In ​

packages/store/src/workspace/workspace.ts:73


id ​

get id(): string

Defined In ​

packages/store/src/workspace/workspace.ts:43


idGenerator ​

get idGenerator(): IdGenerator

Defined In ​

packages/store/src/workspace/workspace.ts:77


isEmpty ​

get isEmpty(): boolean

Defined In ​

packages/store/src/workspace/workspace.ts:47


pages ​

get pages(): Map< string, Page >

Defined In ​

packages/store/src/workspace/workspace.ts:69


providers ​

get providers(): DocProvider[]

Defined In ​

packages/store/src/workspace/workspace.ts:65


schema ​

get schema(): Schema

Defined In ​

packages/store/src/workspace/workspace.ts:81

Methods ​

_bindPageMetaEvents ​

private _bindPageMetaEvents(): void

Returns ​

void

Defined In ​

packages/store/src/workspace/workspace.ts:99


_hasPage ​

private _hasPage(pageId): boolean

Parameters ​

ParameterType
pageIdstring

Returns ​

boolean

Defined In ​

packages/store/src/workspace/workspace.ts:89


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 ​

ParameterType
optionsstring | {id: string;}

Returns ​

Page

Defined In ​

packages/store/src/workspace/workspace.ts:127


getPage ​

getPage(pageId): null | Page

Parameters ​

ParameterType
pageIdstring

Returns ​

null | Page

Defined In ​

packages/store/src/workspace/workspace.ts:93


registerProvider ​

registerProvider(providerCreator, id?): DocProvider

Parameters ​

ParameterType
providerCreatorDocProviderCreator
id?string

Returns ​

DocProvider

Defined In ​

packages/store/src/workspace/workspace.ts:85


removePage ​

removePage(pageId): void

Parameters ​

ParameterType
pageIdstring

Returns ​

void

Defined In ​

packages/store/src/workspace/workspace.ts:163


setPageMeta ​

setPageMeta(pageId, props): void

Update page meta state. Note that this intentionally does not mutate page state.

Parameters ​

ParameterType
pageIdstring
propsPartial< PageMeta >

Returns ​

void

Defined In ​

packages/store/src/workspace/workspace.ts:155