CoreMedia CKEditor 5 Plugins
    Preparing search index...

    Interface ConversionListener

    Listener regarding the import-process, which may intervene some conversion steps and provide a different behavior.

    interface ConversionListener {
        appended?: (
            parentNode: Node,
            childNode: Node,
            context: ConversionContext,
        ) => void;
        imported?: (
            importedNode: Node,
            context: ConversionContext,
        ) => Node | typeof skip | undefined;
        importedWithChildren?: (
            importedNode: Node,
            context: ConversionContext,
        ) => Node | typeof skip | undefined;
        prepare?: (originalNode: Node) => void;
    }

    Implemented by

    Index

    Properties

    appended?: (
        parentNode: Node,
        childNode: Node,
        context: ConversionContext,
    ) => void

    Called as soon as a node got attached to the DOM.

    Note on context: The source node references the related representation of parentNode in the original document.

    Type Declaration

      • (parentNode: Node, childNode: Node, context: ConversionContext): void
      • Parameters

        • parentNode: Node

          parent node child got appended to

        • childNode: Node

          child node that got appended

        • context: ConversionContext

          current conversion context

        Returns void

    imported?: (
        importedNode: Node,
        context: ConversionContext,
    ) => Node | typeof skip | undefined

    Provides the possibility to handle a just imported node. The node is neither attached to DOM, nor children are available.

    Type Declaration

      • (importedNode: Node, context: ConversionContext): Node | typeof skip | undefined
      • Parameters

        • importedNode: Node

          the just imported node

        • context: ConversionContext

          current conversion context

        Returns Node | typeof skip | undefined

        the node to continue with in further processing or a signal what to do instead; if method is not defined or undefined is returned, processing continues with the original node.

    importedWithChildren?: (
        importedNode: Node,
        context: ConversionContext,
    ) => Node | typeof skip | undefined

    Provides the opportunity to handle a just imported node, having its children processed. The node is not attached to the DOM yet, though.

    Type Declaration

      • (importedNode: Node, context: ConversionContext): Node | typeof skip | undefined
      • Parameters

        • importedNode: Node

          imported node, possibly with children

        • context: ConversionContext

          current conversion context

        Returns Node | typeof skip | undefined

        the node to attach to the DOM eventually; or a corresponding signal what to do instead; undefined or not implemented would continue processing with the importedNode

    prepare?: (originalNode: Node) => void

    Prior to importing the original node, you may want to modify it. Note that allowed modification is limited, though.

    Type Declaration

      • (originalNode: Node): void
      • Parameters

        • originalNode: Node

          original (mutable!) node

        Returns void