Trevixal API
    Preparing search index...

    Interface InlineDecoration

    An inline range in a textblock rendered with an extra class (search match, …).

    interface InlineDecoration {
        attrs?: Readonly<Record<string, string>>;
        className: string;
        from: number;
        style?: string;
        to: number;
        widget?: () => HTMLElement;
    }
    Index
    attrs?: Readonly<Record<string, string>>

    Extra attributes on the decorated span, data- keys for a feature to recognise its own spans by, title, role.

    A decoration that can only set a class name can be seen but not identified: the painted span carries nothing linking it back to whatever produced it, so a hover card or a click menu has no way to know which of a block's decorations the pointer is over.

    className: string
    from: number
    style?: string

    Extra inline CSS on the decorated span (a per-range highlight colour, …).

    to: number
    widget?: () => HTMLElement

    Zero-width widget rendered at from (requires from === to), e.g. a marker pinned to one position. The element is wrapped in a non-editable span the position mapper skips.