decord/source/lib/uploader/UploadTargets.tsx
2026-09-02 09:53:35 +00:00

64 lines
2.4 KiB
TypeScript

// Module ID: 5126
// Function ID: 5127
// Name: getCreateAttachmentURL
// Dependencies: [1386, 673, 5086, 5082, 5127, 5129, 2]
// Exports: getUploadTarget
// Module 5126 (getCreateAttachmentURL)
import items from "items" /* 5082 */;
import getUploadFileSizeSumAll from "getUploadFileSizeSum" /* 5086 */;
import getCreateAttachmentURLDefault from "getCreateAttachmentURL" /* 5127 */;
import getCreateAttachmentURLDefault2 from "getCreateAttachmentURL" /* 5129 */;
import closure_4 from "ensureGuildLoaded" /* 1386 */;
import ME from "ME" /* 673 */;
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);
}
};