@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
53 lines (52 loc) • 1.4 kB
TypeScript
import { MediaSizes } from './MediaSizes';
export declare class Media {
readonly id: number;
readonly credit?: string;
readonly caption?: string;
readonly alt_text?: string;
readonly media_type?: string;
readonly mime_type?: string;
readonly sizes: MediaSizes;
constructor(data: any);
/**
* Get the ID of the media
* @returns The media ID
*/
getId(): number;
/**
* Get the credit information
* @returns The credit text or undefined
*/
getCredit(): string | undefined;
/**
* Get the caption text
* @returns The caption text or undefined
*/
getCaption(): string | undefined;
/**
* Get the alternative text
* @returns The alt text or undefined
*/
getAltText(): string | undefined;
/**
* Get the media type
* @returns The media type or undefined
*/
getMediaType(): string | undefined;
/**
* Get the MIME type
* @returns The MIME type or undefined
*/
getMimeType(): string | undefined;
/**
* Get the sizes of the media
* @returns The media sizes object
*/
getSizes(): MediaSizes;
/**
* Get the URL for a specific size
* @param size The desired size
* @returns The URL for the requested size or undefined
*/
getUrl(size?: 'full' | 'large' | 'medium' | 'thumbnail'): string | undefined;
}