A media file entry representing one file uploaded via MediaManager.insert. It maps to a directory on GCS hosting different variant of the uploaded file.

interface MediaEntry {
    getFile: (variant?: string) => File;
    getUrl: (variant?: string) => string;
    id: string;
    type: MediaType;
    variants: string[];
}

Properties

getFile: (variant?: string) => File

Returns the variant file's GCS File. Throws if the provided variant does not exist on GCS.

Type declaration

    • (variant?: string): File
    • Parameters

      • Optionalvariant: string

        The name of the variant. Defaults to original if not provided.

      Returns File

getUrl: (variant?: string) => string

Variant file's public URL. Throws if the provided variant does not exist on GCS.

Type declaration

    • (variant?: string): string
    • Parameters

      • Optionalvariant: string

        The name of the variant. Defaults to original if not provided.

      Returns string

id: string

The unique ID for the media entry. The ID is considered opaque; Applications should not try to decipher this ID.

type: MediaType
variants: string[]

Variants that exist on GCS for this media entry