Skip to main content

decorations

ai-research-agent / editor/modules/decorations

Functions

applyDecorations()

function applyDecorations(
vnode,
attributes,
defaultClasses?): VNode

Parameters

ParameterType

vnode

VNode

attributes

undefined | default

defaultClasses?

string[]

Returns

VNode


decorations()

function decorations(editor): DecorationsModule

Parameters

ParameterType

editor

Editor

Returns

DecorationsModule

Classes

DecorateEvent

Extends

  • Event

Constructors

new DecorateEvent()
new DecorateEvent(type, init): DecorateEvent
Parameters
ParameterType

type

string

init

DecorateEventInit

Returns

DecorateEvent

Overrides

Event.constructor

Properties

change?
optional change: default;
changedLines?
optional changedLines: default[];
doc
doc: default;
old
old: default;

Decorator

Constructors

new Decorator()
new Decorator(
name,
doc,
decoration,
apply,
remove): Decorator
Parameters
ParameterType

name

string

doc

default

decoration

undefined | default

apply

(name, updates) => void

remove

(name) => void

Returns

Decorator

Methods

apply()
apply(): void
Returns

void

clear()
clear(range?): Decorator
Parameters
ParameterType

range?

EditorRange

Returns

Decorator

clearLine()
clearLine(value): Decorator
Parameters
ParameterType

value

string | number | default

Returns

Decorator

clearLines()
clearLines(lines): Decorator
Parameters
ParameterType

lines

default[]

Returns

Decorator

decorateLine()
decorateLine(range, decoration): Decorator
Parameters
ParameterType

range

number | EditorRange

decoration

Decorations

Returns

Decorator

decorateText()
decorateText(range, decoration): Decorator
Parameters
ParameterType

range

EditorRange

decoration

Decorations

Returns

Decorator

getDecoration()
getDecoration(): default
Returns

default

hasDecorations()
hasDecorations(): boolean
Returns

boolean

insertDecoration()
insertDecoration(at, decoration): Decorator
Parameters
ParameterType

at

number

decoration

Decorations

Returns

Decorator

invert()
invert(range?): default
Parameters
ParameterType

range?

EditorRange

Returns

default

remove()
remove(): void
Returns

void

Properties

change
change: default;

Interfaces

DecorateEventInit

Extends

  • EventInit

Properties

change?
optional change: default;
changedLines?
optional changedLines: default[];
doc
doc: default;
old
old: default;

Decorations

Indexable

[attributeName: string]: any

Properties

class?
optional class: string;
style?
optional style: string;

DecorationsModule

Methods

destroy()
destroy(): void
Returns

void

init()
init(): void
Returns

void

Properties

clearDecorations()
clearDecorations: () => void;
Returns

void

doc
readonly doc: default;
gatherDecorations()
gatherDecorations: (change?, changedLines?) => void;
Parameters
ParameterType

change?

default

changedLines?

default[]

Returns

void

getDecorator()
getDecorator: (name) => Decorator;
Parameters
ParameterType

name

string

Returns

Decorator

old
readonly old: default;
removeDecorations()
removeDecorations: (name) => boolean;
Parameters
ParameterType

name

string

Returns

boolean