Skip to content

API > @blocksuite/virgo > VirgoHookService

Class: VirgoHookService<TextAttributes> ​

Constructors ​

constructor ​

new VirgoHookService<TextAttributes>(editor, hooks = {}): VirgoHookService< 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 >
hooksobject
hooks.beforeinput?function
hooks.compositionEnd?function

Returns ​

VirgoHookService< TextAttributes >

Defined In ​

packages/virgo/src/services/hook.ts:29

Properties ​

editor ​

readonly editor: VEditor< TextAttributes >

Defined In ​

packages/virgo/src/services/hook.ts:30


hooks ​

readonly hooks: object = {}

Type declaration ​

hooks.beforeinput ​

optional beforeinput: function

Parameters ​
ParameterType
propsVBeforeinputHookCtx< TextAttributes >
Returns ​

null | VBeforeinputHookCtx< TextAttributes >

hooks.compositionEnd ​

optional compositionEnd: function

Parameters ​
ParameterType
propsVCompositionEndHookCtx< TextAttributes >
Returns ​

null | VCompositionEndHookCtx< TextAttributes >

Defined In ​

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