Trilium Frontend API
    Preparing search index...

    Class StateEffect<Value>

    State effects can be used to represent additional effects associated with a transaction. They are often useful to model changes to custom state fields, when those changes aren't implicit in document or selection changes.

    Type Parameters

    • Value
    Index
    value: Value

    The value of this effect.

    appendConfig: StateEffectType<Extension>

    Append extensions to the top-level configuration of the editor.

    This effect can be used to reconfigure the root extensions of the editor. Doing this will discard any extensions appended, but does not reset the content of reconfigured compartments.

    • Map this effect through a position mapping. Will return undefined when that ends up deleting the effect.

      Parameters

      Returns StateEffect<Value>

    • Define a new effect type. The type parameter indicates the type of values that his effect holds. It should be a type that doesn't include undefined, since that is used in mapping to indicate that an effect is removed.

      Type Parameters

      • Value = null

      Parameters

      Returns StateEffectType<Value>

    • Map an array of effects through a change set.

      Parameters

      Returns readonly StateEffect<any>[]