Trilium Frontend API
    Preparing search index...

    Interface DowncastConversionApi

    Conversion interface that is registered for given module:engine/conversion/downcastdispatcher~DowncastDispatcher and is passed as one of parameters when module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher fires its events.

    interface DowncastConversionApi {
        consumable: ModelConsumable;
        dispatcher: DowncastDispatcher;
        mapper: Mapper;
        options: Record<string, unknown>;
        schema: ModelSchema;
        writer: ViewDowncastWriter;
        canReuseView(element: ViewElement): boolean;
        convertAttributes(item: ModelItem): void;
        convertChildren(element: ModelElement): void;
        convertItem(item: ModelItem): void;
    }
    Index

    Properties

    consumable: ModelConsumable

    Stores the information about what parts of a processed model item are still waiting to be handled. After a piece of a model item was converted, an appropriate consumable value should be module:engine/conversion/modelconsumable~ModelConsumable#consume consumed.

    dispatcher: DowncastDispatcher

    The module:engine/conversion/downcastdispatcher~DowncastDispatcher instance.

    mapper: Mapper

    The module:engine/conversion/mapper~Mapper instance.

    options: Record<string, unknown>

    An object with an additional configuration which can be used during the conversion process. Available only for data downcast conversion.

    schema: ModelSchema

    The module:engine/model/schema~ModelSchema instance set for the model that is downcast.

    The module:engine/view/downcastwriter~ViewDowncastWriter instance used to manipulate the data during conversion.

    Methods

    • Parameters

      Returns boolean

    • Triggers conversion of attributes of a specified item.

      Parameters

      • item: ModelItem

        The model item to trigger attribute conversion on.

      Returns void

    • Triggers conversion of children of a specified element.

      Parameters

      • element: ModelElement

        The model element to trigger children insert conversion on.

      Returns void

    • Triggers conversion of a specified item. This conversion is triggered within (as a separate process of) the parent conversion.

      Parameters

      • item: ModelItem

        The model item to trigger nested insert conversion on.

      Returns void