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