Skip to content

API > @blocksuite/store > Job

Class: Job ​

Constructors ​

constructor ​

new Job(__namedParameters): Job

Parameters ​

ParameterType
__namedParametersJobConfig

Returns ​

Job

Defined In ​

packages/store/src/transformer/job.ts:47

Properties ​

_assetsManager ​

private readonly _assetsManager: AssetsManager

Defined In ​

packages/store/src/transformer/job.ts:38


_slots ​

private readonly _slots: JobSlots

Defined In ​

packages/store/src/transformer/job.ts:40


_workspace ​

private readonly _workspace: Workspace

Defined In ​

packages/store/src/transformer/job.ts:37

Accessors ​

assets ​

get assets(): Map< string, Blob >

Defined In ​

packages/store/src/transformer/job.ts:64


assetsManager ​

get assetsManager(): AssetsManager

Defined In ​

packages/store/src/transformer/job.ts:60

Methods ​

_blockToSnapshot ​

private _blockToSnapshot(model): Promise< BlockSnapshot >

Parameters ​

ParameterType
modelBaseBlockModel< object >

Returns ​

Promise< BlockSnapshot >

Defined In ​

packages/store/src/transformer/job.ts:126


_exportPageMeta ​

private _exportPageMeta(page): PageMeta

Parameters ​

ParameterType
pagePage

Returns ​

PageMeta

Defined In ​

packages/store/src/transformer/job.ts:100


_getSchema ​

private _getSchema(flavour): object

Parameters ​

ParameterType
flavourstring

Returns ​

model ​

model: { flavour: string; role: "root" | "hub" | "content"; parent?: string[] | undefined; children?: string[] | undefined; props?: ((args_0: InternalPrimitives, ...args_1: unknown[]) => Record<...>) | undefined; toModel?: ((...args: unknown[]) => BaseBlockModel<...>) | undefined; }

onUpgrade ​

optional onUpgrade: function

Parameters ​
ParameterType
...args[any, number, number, ...unknown[]]
Returns ​

void

transformer ​

optional transformer: function

Parameters ​
ParameterType
...argsunknown[]
Returns ​

BaseBlockTransformer< object >

version ​

version: number

Defined In ​

packages/store/src/transformer/job.ts:72


_getTransformer ​

private _getTransformer(schema): BaseBlockTransformer< object >

Parameters ​

ParameterType
schemaobject
schema.model`{ flavour: string; role: "root"
schema.onUpgrade?function
schema.transformer?function
schema.versionnumber

Returns ​

BaseBlockTransformer< object >

Defined In ​

packages/store/src/transformer/job.ts:78


_getWorkspaceMeta ​

private _getWorkspaceMeta(): object

Returns ​

blockVersions ​

blockVersions: object

pageVersion ​

pageVersion: number

pages ​

pages: PageMeta[]

properties ​

properties: PagesPropertiesMeta

workspaceVersion ​

workspaceVersion: number

Defined In ​

packages/store/src/transformer/job.ts:82


_importPageMeta ​

private _importPageMeta(page, meta): void

Parameters ​

ParameterType
pagePage
metaPageMeta

Returns ​

void

Defined In ​

packages/store/src/transformer/job.ts:112


_snapshotToBlock ​

private _snapshotToBlock( snapshot, page, parent?, index?): Promise< BaseBlockModel< object > >

Parameters ​

ParameterType
snapshotBlockSnapshot
pagePage
parent?string
index?number

Returns ​

Promise< BaseBlockModel< object > >

Defined In ​

packages/store/src/transformer/job.ts:165


blockToSnapshot ​

blockToSnapshot(model): Promise< BlockSnapshot >

Parameters ​

ParameterType
modelBaseBlockModel< object >

Returns ​

Promise< BlockSnapshot >

Defined In ​

packages/store/src/transformer/job.ts:158


pageToSnapshot ​

pageToSnapshot(page): Promise< PageSnapshot >

Parameters ​

ParameterType
pagePage

Returns ​

Promise< PageSnapshot >

Defined In ​

packages/store/src/transformer/job.ts:228


reset ​

reset(): void

Returns ​

void

Defined In ​

packages/store/src/transformer/job.ts:68


sliceToSnapshot ​

sliceToSnapshot(slice): Promise< SliceSnapshot >

Parameters ​

ParameterType
sliceSlice

Returns ​

Promise< SliceSnapshot >

Defined In ​

packages/store/src/transformer/job.ts:313


snapshotToBlock ​

snapshotToBlock( snapshot, page, parent?, index?): Promise< BaseBlockModel< object > >

Parameters ​

ParameterType
snapshotBlockSnapshot
pagePage
parent?string
index?number

Returns ​

Promise< BaseBlockModel< object > >

Defined In ​

packages/store/src/transformer/job.ts:216


snapshotToPage ​

snapshotToPage(snapshot): Promise< Page >

Parameters ​

ParameterType
snapshotPageSnapshot

Returns ​

Promise< Page >

Defined In ​

packages/store/src/transformer/job.ts:252


snapshotToSlice ​

snapshotToSlice( snapshot, page, parent?, index?): Promise< Slice >

Parameters ​

ParameterType
snapshotSliceSnapshot
pagePage
parent?string
index?number

Returns ​

Promise< Slice >

Defined In ​

packages/store/src/transformer/job.ts:348


snapshotToWorkspaceInfo ​

snapshotToWorkspaceInfo(snapshot): void

Parameters ​

ParameterType
snapshotWorkspaceInfoSnapshot

Returns ​

void

Defined In ​

packages/store/src/transformer/job.ts:291


workspaceInfoToSnapshot ​

workspaceInfoToSnapshot(): WorkspaceInfoSnapshot

Returns ​

WorkspaceInfoSnapshot

Defined In ​

packages/store/src/transformer/job.ts:272