Skip to content

API > @blocksuite/blocks > BaseService

Class: BaseService<BlockModel> ​

Constructors ​

constructor ​

new BaseService<BlockModel>(): BaseService< BlockModel >

Type parameters ​

ParameterDefault
BlockModel extends BaseBlockModel< object >BaseBlockModel< object >

Returns ​

BaseService< BlockModel >

Methods ​

block2Json ​

block2Json( block, children, begin?, end?): SerializedBlock

Parameters ​

ParameterType
blockBlockModel
childrenSerializedBlock[]
begin?number
end?number

Returns ​

SerializedBlock

Defined In ​

packages/blocks/src/_legacy/service/service.ts:71


block2Text ​

block2Text(block, __namedParameters = {}): string

Parameters ​

ParameterType
blockBlockModel
__namedParametersBlockTransformContext

Returns ​

string

Defined In ​

packages/blocks/src/_legacy/service/service.ts:51


block2html ​

block2html( block, __namedParameters = {}, _blobMap?): Promise< string >

Parameters ​

ParameterType
blockBlockModel
__namedParametersBlockTransformContext
_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 ​

ParameterType
blockBlockModel
__namedParametersBlockTransformContext
_blobMap?Map< string, string >

Returns ​

Promise< string >

Defined In ​

packages/blocks/src/_legacy/service/service.ts:59


getBlobType ​

protected getBlobType(blob): Promise< string >

Parameters ​

ParameterType
blobBlob

Returns ​

Promise< string >

Defined In ​

packages/blocks/src/_legacy/service/service.ts:203


json2Block ​

json2Block( focusedBlockModel, pastedBlocks, textRangePoint?): Promise< void >

Parameters ​

ParameterType
focusedBlockModelBlockModel
pastedBlocksSerializedBlock[]
textRangePoint?TextRangePoint

Returns ​

Promise< void >

Defined In ​

packages/blocks/src/_legacy/service/service.ts:89


onBlockPasted ​

onBlockPasted(_model, _clipboardData): Promise< void >

Parameters ​

ParameterType
_modelBlockModel
_clipboardDataRecord< string, unknown >

Returns ​

Promise< void >

Defined In ​

packages/blocks/src/_legacy/service/service.ts:97


templateResult2String ​

templateResult2String(temp): string

Parameters ​

ParameterType
tempTemplateResult

Returns ​

string

Defined In ​

packages/blocks/src/_legacy/service/service.ts:25


deltaLeaf2Html ​

private static deltaLeaf2Html(block, deltaLeaf): string

Parameters ​

ParameterType
blockBaseBlockModel< object >
deltaLeafDeltaOperation

Returns ​

string

Defined In ​

packages/blocks/src/_legacy/service/service.ts:103


deltaLeaf2markdown ​

private static deltaLeaf2markdown(block, deltaLeaf): string

Parameters ​

ParameterType
blockBaseBlockModel< object >
deltaLeafDeltaOperation

Returns ​

string

Defined In ​

packages/blocks/src/_legacy/service/service.ts:153