Trilium Frontend API
    Preparing search index...

    Interface TransactionSpec

    Describes a transaction when calling the EditorState.update method.

    interface TransactionSpec {
        annotations?: Annotation<any> | readonly Annotation<any>[];
        changes?: ChangeSpec;
        effects?: StateEffect<any> | readonly StateEffect<any>[];
        filter?: boolean;
        scrollIntoView?: boolean;
        selection?: EditorSelection | { anchor: number; head?: number };
        sequential?: boolean;
        userEvent?: string;
    }
    Index

    Properties

    annotations?: Annotation<any> | readonly Annotation<any>[]

    Set annotations for this transaction.

    changes?: ChangeSpec

    The changes to the document made by this transaction.

    effects?: StateEffect<any> | readonly StateEffect<any>[]

    Attach state effects to this transaction. Again, when they contain positions and this same spec makes changes, those positions should refer to positions in the updated document.

    filter?: boolean

    By default, transactions can be modified by change filters and transaction filters. You can set this to false to disable that. This can be necessary for transactions that, for example, include annotations that must be kept consistent with their changes.

    scrollIntoView?: boolean

    When set to true, the transaction is marked as needing to scroll the current selection into view.

    selection?: EditorSelection | { anchor: number; head?: number }

    When set, this transaction explicitly updates the selection. Offsets in this selection should refer to the document as it is after the transaction.

    sequential?: boolean

    Normally, when multiple specs are combined (for example by EditorState.update), the positions in changes are taken to refer to the document positions in the initial document. When a spec has sequental set to true, its positions will be taken to refer to the document created by the specs before it instead.

    userEvent?: string

    Shorthand for annotations: Transaction.userEvent.of(...).