Skip to content

API > @blocksuite/virgo > VirgoAttributeService

Class: VirgoAttributeService<TextAttributes> ​

Constructors ​

constructor ​

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

Type parameters ​

Parameter
TextAttributes extends {bold: null | true; code: null | true; italic: null | true; link: null | string; strike: null | true; underline: null | true;}

Parameters ​

ParameterType
editorVEditor< TextAttributes >

Returns ​

VirgoAttributeService< TextAttributes >

Defined In ​

packages/virgo/src/services/attribute.ts:21

Properties ​

_attributeRenderer ​

private _attributeRenderer: AttributeRenderer< TextAttributes >

Defined In ​

packages/virgo/src/services/attribute.ts:15


_attributeSchema ​

private _attributeSchema: ZodType< TextAttributes, ZodTypeDef, unknown >

Defined In ​

packages/virgo/src/services/attribute.ts:18


_marks ​

private _marks: null | TextAttributes = null

Defined In ​

packages/virgo/src/services/attribute.ts:13


editor ​

readonly editor: VEditor< TextAttributes >

Defined In ​

packages/virgo/src/services/attribute.ts:21

Accessors ​

attributeRenderer ​

get attributeRenderer(): AttributeRenderer< TextAttributes >

Defined In ​

packages/virgo/src/services/attribute.ts:27


marks ​

get marks(): null | TextAttributes

Defined In ​

packages/virgo/src/services/attribute.ts:23

Methods ​

getFormat ​

getFormat(vRange, loose = false): TextAttributes

Parameters ​

ParameterTypeDefault value
vRangeVRangeundefined
loosebooleanfalse

Returns ​

TextAttributes

Defined In ​

packages/virgo/src/services/attribute.ts:49


normalizeAttributes ​

normalizeAttributes(textAttributes?): undefined | TextAttributes

Parameters ​

ParameterType
textAttributes?TextAttributes

Returns ​

undefined | TextAttributes

Defined In ​

packages/virgo/src/services/attribute.ts:89


resetMarks ​

resetMarks(): void

Returns ​

void

Defined In ​

packages/virgo/src/services/attribute.ts:35


setAttributeRenderer ​

setAttributeRenderer(renderer): void

Parameters ​

ParameterType
rendererAttributeRenderer< TextAttributes >

Returns ​

void

Defined In ​

packages/virgo/src/services/attribute.ts:45


setAttributeSchema ​

setAttributeSchema(schema): void

Parameters ​

ParameterType
schemaZodType< TextAttributes, ZodTypeDef, unknown >

Returns ​

void

Defined In ​

packages/virgo/src/services/attribute.ts:39


setMarks ​

setMarks(marks): void

Parameters ​

ParameterType
marksTextAttributes

Returns ​

void

Defined In ​

packages/virgo/src/services/attribute.ts:31