decord/source/lib/uploader/UploadTargets.tsx
2026-08-24 06:08:38 +00:00

64 lines
2.4 KiB
TypeScript

// Module ID: 4876
// Function ID: 4877
// Name: getCreateAttachmentURL
// Dependencies: [1391, 676, 4839, 4835, 4877, 4879, 2]
// Exports: getUploadTarget
// Module 4876 (getCreateAttachmentURL)
import items from "items" /* 4835 */;
import getUploadFileSizeSumAll from "getUploadFileSizeSum" /* 4839 */;
import getCreateAttachmentURLDefault from "getCreateAttachmentURL" /* 4877 */;
import getCreateAttachmentURLDefault2 from "getCreateAttachmentURL" /* 4879 */;
import closure_4 from "ensureGuildLoaded" /* 1391 */;
import ME from "ME" /* 676 */;
require = arg1;
({ Endpoints: c5, MAX_UPLOAD_COUNT: closure_6 } = ME);
class MessageAttachmentUploadTarget {
}
const prototype = MessageAttachmentUploadTarget.prototype;
prototype["getCreateAttachmentURL"] = function getCreateAttachmentURL(arg0) {
return closure_5.MESSAGE_CREATE_ATTACHMENT_UPLOAD(arg0);
};
prototype["getDeleteUploadURL"] = function getDeleteUploadURL(arg0) {
return closure_5.MESSAGE_DELETE_UPLOAD(arg0);
};
prototype["getMaxFileSize"] = function getMaxFileSize(arg0) {
basicChannel = basicChannel.getBasicChannel(arg0);
let guild_id;
if (basicChannel != null) {
guild_id = basicChannel.guild_id;
}
return getUploadFileSizeSumAll.maxFileSize(guild_id);
};
prototype["getMaxAttachmentsCount"] = function getMaxAttachmentsCount() {
return closure_6;
};
prototype["getMaxTotalAttachmentSize"] = function getMaxTotalAttachmentSize() {
return items.MAX_TOTAL_ATTACHMENT_SIZE;
};
Object.defineProperty(prototype, "shouldReactNativeCompressUploads", {
get: function shouldReactNativeCompressUploads() {
return true;
},
set: undefined
});
const obj = { MESSAGE_ATTACHMENT: 0, [0]: "MESSAGE_ATTACHMENT", GUILD_PRODUCT_ATTACHMENT: 1, [1]: "GUILD_PRODUCT_ATTACHMENT", GRAVITY_ATTACHMENT: 2, [2]: "GRAVITY_ATTACHMENT" };
const result = require("set").fileFinishedImporting("lib/uploader/UploadTargets.tsx");
export const UploadTargets = obj;
export const getUploadTarget = function getUploadTarget(target) {
if (obj.GUILD_PRODUCT_ATTACHMENT === target) {
const tmp14 = new getCreateAttachmentURLDefault();
return tmp14;
} else if (tmp.GRAVITY_ATTACHMENT === target) {
const tmp8 = new getCreateAttachmentURLDefault2();
return tmp8;
} else {
const MESSAGE_ATTACHMENT = tmp.MESSAGE_ATTACHMENT;
if (typeof MessageAttachmentUploadTarget !== "function") {
HermesBuiltin.throwTypeError();
}
return Object.create(MessageAttachmentUploadTarget.prototype);
}
};