Trilium Frontend API
    Preparing search index...

    Type Alias DowncastAttributeElementCreatorFunction

    DowncastAttributeElementCreatorFunction: (
        attributeValue: any,
        conversionApi: DowncastConversionApi,
        data: {
            attributeKey: string;
            attributeNewValue: unknown;
            attributeOldValue: unknown;
            item: ModelItem | ModelSelection | ModelDocumentSelection;
            range: ModelRange;
        },
    ) => ViewAttributeElement
    | null

    A view element creator function that takes the model attribute value and module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API as parameters and returns a view attribute element.

    Type Declaration

      • (
            attributeValue: any,
            conversionApi: DowncastConversionApi,
            data: {
                attributeKey: string;
                attributeNewValue: unknown;
                attributeOldValue: unknown;
                item: ModelItem | ModelSelection | ModelDocumentSelection;
                range: ModelRange;
            },
        ): ViewAttributeElement
        | null
      • Parameters

        • attributeValue: any

          The model attribute value to be converted to the view attribute element.

        • conversionApi: DowncastConversionApi

          The conversion interface.

        • data: {
              attributeKey: string;
              attributeNewValue: unknown;
              attributeOldValue: unknown;
              item: ModelItem | ModelSelection | ModelDocumentSelection;
              range: ModelRange;
          }

          Additional information about the change (same as for module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute attribute event).

          • attributeKey: string

            Attribute key.

          • attributeNewValue: unknown

            New attribute value.

          • attributeOldValue: unknown

            Attribute value before the change. This is null when selection attribute is converted.

          • item: ModelItem | ModelSelection | ModelDocumentSelection

            Changed item or converted selection.

          • range: ModelRange

            Range spanning over changed item or selection range.

        Returns ViewAttributeElement | null

        The view attribute element.

    • module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement
    • module:engine/conversion/downcasthelpers~wrap