BlockSuite API Documentation / @blocksuite/store / Job
Class: Job
Constructors
new Job()
new Job(
__namedParameters
):Job
Parameters
• __namedParameters: JobConfig
Returns
Source
packages/framework/store/src/transformer/job.ts:67
Properties
_adapterConfigs
private
readonly
_adapterConfigs:Map
<string
,string
>
Source
packages/framework/store/src/transformer/job.ts:58
_assetsManager
private
readonly
_assetsManager:AssetsManager
Source
packages/framework/store/src/transformer/job.ts:56
_collection
private
readonly
_collection:DocCollection
Source
packages/framework/store/src/transformer/job.ts:54
_slots
private
readonly
_slots:JobSlots
Source
packages/framework/store/src/transformer/job.ts:60
Accessors
adapterConfigs
get
adapterConfigs():Map
<string
,string
>
Returns
Map
<string
, string
>
Source
packages/framework/store/src/transformer/job.ts:50
assets
get
assets():Map
<string
,Blob
>
Returns
Map
<string
, Blob
>
Source
packages/framework/store/src/transformer/job.ts:46
assetsManager
get
assetsManager():AssetsManager
Returns
Source
packages/framework/store/src/transformer/job.ts:42
collection
get
collection():DocCollection
Returns
Source
packages/framework/store/src/transformer/job.ts:38
Methods
_blockToSnapshot()
private
_blockToSnapshot(model
):Promise
<BlockSnapshot
>
Parameters
• model: DraftModel
Returns
Promise
<BlockSnapshot
>
Source
packages/framework/store/src/transformer/job.ts:133
_exportDocMeta()
private
_exportDocMeta(doc
):DocMeta
Parameters
• doc: Doc
Returns
Source
packages/framework/store/src/transformer/job.ts:106
_getCollectionMeta()
private
_getCollectionMeta():object
Returns
object
pageVersion
pageVersion:
number
pages
pages:
DocMeta
[]
properties
properties:
DocsPropertiesMeta
workspaceVersion
workspaceVersion:
number
Source
packages/framework/store/src/transformer/job.ts:91
_getSchema()
private
_getSchema(flavour
):object
Parameters
• flavour: string
Returns
object
model
model:
object
model.children?
optional
children:string
[] =ContentSchema
model.flavour
flavour:
string
=FlavourSchema
model.parent?
optional
parent:string
[] =ParentSchema
model.props()?
optional
props: (...args
) =>Record
<string
,any
>
Parameters
• ...args: [InternalPrimitives
, ...unknown[]
]
Returns
Record
<string
, any
>
model.role
role:
"root"
|"hub"
|"content"
=RoleSchema
model.toModel()?
optional
toModel: (...args
) =>BlockModel
<object
>
Parameters
• ...args: unknown
[]
Returns
BlockModel
<object
>
onUpgrade()?
optional
onUpgrade: (...args
) =>void
Parameters
• ...args: [any
, number
, number
, ...unknown[]
]
Returns
void
transformer()?
optional
transformer: (...args
) =>BaseBlockTransformer
<object
>
Parameters
• ...args: unknown
[]
Returns
BaseBlockTransformer
<object
>
version
version:
number
Source
packages/framework/store/src/transformer/job.ts:81
_getTransformer()
private
_getTransformer(schema
):BaseBlockTransformer
<object
>
Parameters
• schema
• schema.model= undefined
• schema.model.children?: string
[]= ContentSchema
• schema.model.flavour: string
= FlavourSchema
• schema.model.parent?: string
[]= ParentSchema
• schema.model.props?= undefined
• schema.model.role: "root"
| "hub"
| "content"
= RoleSchema
• schema.model.toModel?= undefined
• schema.onUpgrade?= undefined
• schema.transformer?= undefined
• schema.version: number
= undefined
Returns
BaseBlockTransformer
<object
>
Source
packages/framework/store/src/transformer/job.ts:87
_importDocMeta()
private
_importDocMeta(doc
,meta
):void
Parameters
• doc: Doc
• meta: DocMeta
Returns
void
Source
packages/framework/store/src/transformer/job.ts:118
_snapshotToBlock()
private
_snapshotToBlock(snapshot
,doc
,parent
?,index
?):Promise
<BlockModel
<object
>>
Parameters
• snapshot: BlockSnapshot
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<BlockModel
<object
>>
Source
packages/framework/store/src/transformer/job.ts:163
blockToSnapshot()
blockToSnapshot(
model
):Promise
<BlockSnapshot
>
Parameters
• model: DraftModel
Returns
Promise
<BlockSnapshot
>
Source
packages/framework/store/src/transformer/job.ts:218
collectionInfoToSnapshot()
collectionInfoToSnapshot():
CollectionInfoSnapshot
Returns
Source
packages/framework/store/src/transformer/job.ts:312
docToSnapshot()
docToSnapshot(
doc
):Promise
<DocSnapshot
>
Parameters
• doc: Doc
Returns
Promise
<DocSnapshot
>
Source
packages/framework/store/src/transformer/job.ts:268
reset()
reset():
void
Returns
void
Source
packages/framework/store/src/transformer/job.ts:214
sliceToSnapshot()
sliceToSnapshot(
slice
):Promise
<SliceSnapshot
>
Parameters
• slice: Slice
Returns
Promise
<SliceSnapshot
>
Source
packages/framework/store/src/transformer/job.ts:353
snapshotToBlock()
snapshotToBlock(
snapshot
,doc
,parent
?,index
?):Promise
<BlockModel
<object
>>
Parameters
• snapshot: BlockSnapshot
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<BlockModel
<object
>>
Source
packages/framework/store/src/transformer/job.ts:256
snapshotToCollectionInfo()
snapshotToCollectionInfo(
snapshot
):void
Parameters
• snapshot: CollectionInfoSnapshot
Returns
void
Source
packages/framework/store/src/transformer/job.ts:331
snapshotToDoc()
snapshotToDoc(
snapshot
):Promise
<Doc
>
Parameters
• snapshot: DocSnapshot
Returns
Promise
<Doc
>
Source
packages/framework/store/src/transformer/job.ts:292
snapshotToModelData()
snapshotToModelData(
snapshot
):Promise
<SnapshotReturn
<object
>>
Parameters
• snapshot: BlockSnapshot
Returns
Promise
<SnapshotReturn
<object
>>
Source
packages/framework/store/src/transformer/job.ts:225
snapshotToSlice()
snapshotToSlice(
snapshot
,doc
,parent
?,index
?):Promise
<Slice
>
Parameters
• snapshot: SliceSnapshot
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<Slice
>
Source
packages/framework/store/src/transformer/job.ts:382
walk()
walk(
snapshot
,callback
):void
Parameters
• snapshot: DocSnapshot
• callback
Returns
void
Source
packages/framework/store/src/transformer/job.ts:244