@w0s/paapi-item-image-url-parser
Version:
Parsing a PA-API 5.0 Item Image URL
63 lines • 1.61 kB
TypeScript
/**
* Parsing a PA-API 5.0 Item Image URL
*/
export default class {
#private;
/**
* @param inputUrl - Image URL (e.g. new URL('https://m.media-amazon.com/images/I/5198TOs+rnL._SL160_.jpg') )
*/
constructor(inputUrl: URL);
/**
* Get the entire Image URL string
*
* @returns Image URL string
*/
toString(): string;
/**
* Get the entire Image URL
*
* @returns Image URL
*/
getURL(): URL;
/**
* Get the ID part of URL
*
* @returns ID of the image file name (e.g. '5198TOs+rnL')
*/
getId(): string;
/**
* Get the size part of URL
*
* @returns Image size (e.g. 160)
*/
getSize(): number | null;
/**
* Set the image size (Used to get images of different sizes)
*
* @param size - Image size (e.g. 160)
*/
setSize(size: number): void;
/**
* Remove the image size (Used to get the original size image)
*/
removeSize(): void;
/**
* Multiply the size of the image (Used to get images of different sizes)
*
* @param multiply - Numerical value to multiply the image size
*/
setSizeMultiply(multiply: number): void;
/**
* Division the size of the image (Used to get images of different sizes)
*
* @param division - Numerical value to division the image size
*/
setSizeDivision(division: number): void;
/**
* Get the extension part of URL
*
* @returns Image file extension (e.g. '.jpg')
*/
getExtension(): string;
}
//# sourceMappingURL=PaapiItemImageUrl.d.ts.map