tgsnake
Version:
Telegram MTProto framework for nodejs.
46 lines (45 loc) • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PhotoSize = void 0;
const TL_js_1 = require("../../TL.js");
const platform_node_js_1 = require("../../../platform.node.js");
class PhotoSize extends TL_js_1.TLObject {
fileId;
fileUniqueId;
width;
height;
fileSize;
constructor({ fileId, fileUniqueId, width, height, fileSize, }, client) {
super(client);
this.fileId = fileId;
this.fileUniqueId = fileUniqueId;
this.width = width;
this.height = height;
this.fileSize = fileSize;
}
static parse(client, photoSize, mediaId, accessHash, fileReference, dcId) {
let file = platform_node_js_1.FileId.encode({
version: 4,
subVersion: 32,
fileType: platform_node_js_1.FileType.THUMBNAIL,
thumbnailSource: platform_node_js_1.ThumbnailSource.THUMBNAIL,
thumbnailFileType: platform_node_js_1.FileType.THUMBNAIL,
thumbnailSize: photoSize.type,
fileTypeUniqueId: platform_node_js_1.FileTypeUniqueId.DOCUMENT,
volumeId: BigInt(0),
localId: 0,
dcId: dcId,
id: mediaId,
accessHash: accessHash,
fileReference: fileReference,
});
return new PhotoSize({
fileId: file.fileId,
fileUniqueId: file.fileUniqueId,
width: photoSize.w,
height: photoSize.h,
fileSize: photoSize.size,
}, client);
}
}
exports.PhotoSize = PhotoSize;