API > @blocksuite/blocks > BaseService
Class: BaseService<BlockModel>
​
Constructors ​
constructor ​
new BaseService<
BlockModel
>():BaseService
<BlockModel
>
Type parameters ​
Parameter | Default |
---|---|
BlockModel extends BaseBlockModel < object > | BaseBlockModel < object > |
Returns ​
BaseService
< BlockModel
>
Methods ​
block2Json ​
block2Json(
block
,children
,begin
?,end
?):SerializedBlock
Parameters ​
Parameter | Type |
---|---|
block | BlockModel |
children | SerializedBlock [] |
begin ? | number |
end ? | number |
Returns ​
Defined In ​
packages/blocks/src/_legacy/service/service.ts:71
block2Text ​
block2Text(
block
,__namedParameters
={}
):string
Parameters ​
Parameter | Type |
---|---|
block | BlockModel |
__namedParameters | BlockTransformContext |
Returns ​
string
Defined In ​
packages/blocks/src/_legacy/service/service.ts:51
block2html ​
block2html(
block
,__namedParameters
={}
,_blobMap
?):Promise
<string
>
Parameters ​
Parameter | Type |
---|---|
block | BlockModel |
__namedParameters | BlockTransformContext |
_blobMap ? | Map < string , string > |
Returns ​
Promise
< string
>
Defined In ​
packages/blocks/src/_legacy/service/service.ts:39
block2markdown ​
block2markdown(
block
,__namedParameters
={}
,_blobMap
?):Promise
<string
>
Parameters ​
Parameter | Type |
---|---|
block | BlockModel |
__namedParameters | BlockTransformContext |
_blobMap ? | Map < string , string > |
Returns ​
Promise
< string
>
Defined In ​
packages/blocks/src/_legacy/service/service.ts:59
getBlobType ​
protected
getBlobType(blob
):Promise
<string
>
Parameters ​
Parameter | Type |
---|---|
blob | Blob |
Returns ​
Promise
< string
>
Defined In ​
packages/blocks/src/_legacy/service/service.ts:203
json2Block ​
json2Block(
focusedBlockModel
,pastedBlocks
,textRangePoint
?):Promise
<void
>
Parameters ​
Parameter | Type |
---|---|
focusedBlockModel | BlockModel |
pastedBlocks | SerializedBlock [] |
textRangePoint ? | TextRangePoint |
Returns ​
Promise
< void
>
Defined In ​
packages/blocks/src/_legacy/service/service.ts:89
onBlockPasted ​
onBlockPasted(
_model
,_clipboardData
):Promise
<void
>
Parameters ​
Parameter | Type |
---|---|
_model | BlockModel |
_clipboardData | Record < string , unknown > |
Returns ​
Promise
< void
>
Defined In ​
packages/blocks/src/_legacy/service/service.ts:97
templateResult2String ​
templateResult2String(
temp
):string
Parameters ​
Parameter | Type |
---|---|
temp | TemplateResult |
Returns ​
string
Defined In ​
packages/blocks/src/_legacy/service/service.ts:25
deltaLeaf2Html ​
private
static
deltaLeaf2Html(block
,deltaLeaf
):string
Parameters ​
Parameter | Type |
---|---|
block | BaseBlockModel < object > |
deltaLeaf | DeltaOperation |
Returns ​
string
Defined In ​
packages/blocks/src/_legacy/service/service.ts:103
deltaLeaf2markdown ​
private
static
deltaLeaf2markdown(block
,deltaLeaf
):string
Parameters ​
Parameter | Type |
---|---|
block | BaseBlockModel < object > |
deltaLeaf | DeltaOperation |
Returns ​
string
Defined In ​
packages/blocks/src/_legacy/service/service.ts:153