Sign up (with export icon)

image/image/converters

Api-module icon module

Functions

  • Chevron-right icon

    downcastImageAttribute( imageUtils, imageType, attributeKey ) → ( dispatcher: DowncastDispatcher ) => void
    internal

    Converter used to convert a given image attribute from the model to the view.

    Parameters

    imageUtils : ImageUtils
    imageType : 'imageBlock' | 'imageInline'

    The type of the image.

    attributeKey : string

    The name of the attribute to convert.

    Returns

    ( dispatcher: DowncastDispatcher ) => void
  • Chevron-right icon

    downcastSourcesAttribute( imageUtils ) → ( dispatcher: DowncastDispatcher ) => void
    internal

    Converts the source model attribute to the <picture><source /><source />...<img /></picture> view structure.

    Parameters

    imageUtils : ImageUtils

    Returns

    ( dispatcher: DowncastDispatcher ) => void
  • Chevron-right icon

    downcastSrcsetAttribute( imageUtils, imageType ) → ( dispatcher: DowncastDispatcher ) => void
    internal

    Converter used to convert the srcset model image attribute to the srcset and sizes attributes in the view.

    Parameters

    imageUtils : ImageUtils
    imageType : 'imageBlock' | 'imageInline'

    The type of the image.

    Returns

    ( dispatcher: DowncastDispatcher ) => void
  • Chevron-right icon

    upcastImageFigure( imageUtils ) → ( dispatcher: UpcastDispatcher ) => void
    internal

    Returns a function that converts the image view representation:

    <figure class="image"><img src="..." alt="..."></img></figure>
    
    Copy code

    to the model representation:

    <imageBlock src="..." alt="..."></imageBlock>
    
    Copy code

    The entire content of the <figure> element except the first <img> is being converted as children of the <imageBlock> model element.

    Parameters

    imageUtils : ImageUtils

    Returns

    ( dispatcher: UpcastDispatcher ) => void
  • Chevron-right icon

    upcastPicture( imageUtils ) → ( dispatcher: UpcastDispatcher ) => void
    internal

    Returns a function that converts the image view representation:

    <picture><source ... /><source ... />...<img ... /></picture>
    
    Copy code

    to the model representation as the sources attribute:

    <image[Block|Inline] ... sources="..."></image[Block|Inline]>
    
    Copy code

    Parameters

    imageUtils : ImageUtils

    Returns

    ( dispatcher: UpcastDispatcher ) => void