Trilium Frontend API
    Preparing search index...

    Interface CollectionBindToChain<S, T>

    An object returned by the module:utils/collection~Collection#bindTo bindTo() method providing functions that specify the type of the binding.

    See the module:utils/collection~Collection#bindTo bindTo() documentation for examples.

    interface CollectionBindToChain<S, T> {
        as(Class: new (item: S) => T): void;
        using(callbackOrProperty: keyof S | ((item: S) => T)): void;
    }

    Type Parameters

    • S
    • T
    Index

    Methods

    Methods

    • Creates the class factory binding in which items of the source collection are passed to the constructor of the specified class.

      Parameters

      • Class: new (item: S) => T

        The class constructor used to create instances in the factory.

      Returns void

    • Creates a callback or a property binding.

      Parameters

      • callbackOrProperty: keyof S | ((item: S) => T)

        When the function is passed, it should return the collection items. When the string is provided, the property value is used to create the bound collection items.

      Returns void