Skip to content

BlockSuite API Documentation / @blocksuite/inline / AttributeService

Class: AttributeService<TextAttributes>

Type parameters

TextAttributes extends BaseTextAttributes

Constructors

new AttributeService(editor)

new AttributeService<TextAttributes>(editor): AttributeService<TextAttributes>

Parameters

editor: InlineEditor<TextAttributes>

Returns

AttributeService<TextAttributes>

Source

packages/framework/inline/src/services/attribute.ts:21

Properties

_attributeRenderer

private _attributeRenderer: AttributeRenderer<TextAttributes>

Source

packages/framework/inline/src/services/attribute.ts:15


_attributeSchema

private _attributeSchema: ZodType<TextAttributes, ZodTypeDef, unknown>

Source

packages/framework/inline/src/services/attribute.ts:18


_marks

private _marks: null | TextAttributes = null

Source

packages/framework/inline/src/services/attribute.ts:13


editor

readonly editor: InlineEditor<TextAttributes>

Source

packages/framework/inline/src/services/attribute.ts:21

Accessors

attributeRenderer

get attributeRenderer(): AttributeRenderer<TextAttributes>

Returns

AttributeRenderer<TextAttributes>

Source

packages/framework/inline/src/services/attribute.ts:27


marks

get marks(): null | TextAttributes

Returns

null | TextAttributes

Source

packages/framework/inline/src/services/attribute.ts:23

Methods

getFormat()

getFormat(inlineRange, loose): TextAttributes

Parameters

inlineRange: InlineRange

loose: boolean= false

Returns

TextAttributes

Source

packages/framework/inline/src/services/attribute.ts:49


normalizeAttributes()

normalizeAttributes(textAttributes?): undefined | TextAttributes

Parameters

textAttributes?: TextAttributes

Returns

undefined | TextAttributes

Source

packages/framework/inline/src/services/attribute.ts:89


resetMarks()

resetMarks(): void

Returns

void

Source

packages/framework/inline/src/services/attribute.ts:35


setAttributeRenderer()

setAttributeRenderer(renderer): void

Parameters

renderer: AttributeRenderer<TextAttributes>

Returns

void

Source

packages/framework/inline/src/services/attribute.ts:45


setAttributeSchema()

setAttributeSchema(schema): void

Parameters

schema: ZodType<TextAttributes, ZodTypeDef, unknown>

Returns

void

Source

packages/framework/inline/src/services/attribute.ts:39


setMarks()

setMarks(marks): void

Parameters

marks: TextAttributes

Returns

void

Source

packages/framework/inline/src/services/attribute.ts:31