Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Image

Class representing an Image resource with helper functions. Image URL helper functions will take into consideration staging and custom hostname overrides.

Hierarchy

  • Media
    • Image

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

_meta

Metadata about the Media object

Protected config

defaultHost

defaultHost: string

Default host name to use when constructing a URL to the resource. Your application may override this value with a branded host name in the SDK configuration.

endpoint

endpoint: string

Name of the account to use when constructing a URL to the resource.

id

id: string

ID of the media object

name

name: string

Name of the media object to use when constructing a URL to the resource.

Methods

getHost

  • getHost(secure: boolean): string
  • Returns the hostname that should be used to load this media resource. The hostname will use the staging and media host overrides if specified otherwise it will use the defaultHost provided by the delivery API.

    Parameters

    • secure: boolean

    Returns string

toJSON

  • toJSON(): any

url

  • Returns a builder which can be used to construct a URL to this image resource. You can apply transformations such as resize and image format using the returned builder.

    image.thumbnail().width(500).build();

    Returns ImageUrlBuilder

Generated using TypeDoc