Function image

  • Fetches the image at the specified input URL and returns a promise of an HTML image element.

    If init is specified, sets any additional properties on the image before loading.

    Parameters

    • url: string

      A valid URL string.

    • Optional init: Partial<HTMLImageElement>

      An optional object of image properties to set.

    Returns Promise<HTMLImageElement>