fnbr
Version:
A library to interact with Epic Games' Fortnite HTTP and XMPP services
38 lines • 994 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const Base_1 = tslib_1.__importDefault(require("../Base"));
/**
* Represents an image
*/
class Image extends Base_1.default {
/**
* @param client The main client
* @param data The image's data
*/
constructor(client, data) {
super(client);
this.url = data.url;
this.width = data.width;
this.height = data.height;
this.fileExtension = path_1.default.extname(this.url);
}
/**
* Downloads the image
* @throws {AxiosError}
*/
async download() {
const res = await this.client.http.request({
method: 'GET',
url: this.url,
responseType: 'arraybuffer',
});
return res;
}
toString() {
return this.url;
}
}
exports.default = Image;
//# sourceMappingURL=Image.js.map