decord/alpha/source/modules/frames/FramesConstants.tsx

121 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-10-10 08:08:14 +00:00
// Module ID: 10802
// Function ID: 10803
// Name: FramesConstants
2026-10-12 06:59:38 +00:00
// Dependencies: [1085, 8611, 38, 2]
2026-10-08 09:57:35 +00:00
// Exports: asLaunched, getFrameHostWindowKey, getFrameIntentForSurface, getFrameSurfaceForChannel, getPipOrientationLockStateForFrame, isLaunched, makeFrameId
2026-07-20 16:05:17 +00:00
2026-10-10 08:08:14 +00:00
// Module 10802 (FramesConstants)
2026-10-08 09:57:35 +00:00
import _modDef38 from "module_38" /* 38 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-12 06:59:38 +00:00
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8611 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const ChannelTypes = Constants.ChannelTypes;
2026-10-03 08:58:59 +00:00
let obj = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN };
2026-10-08 09:57:35 +00:00
const obj2 = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.OVERLAY };
let obj3 = { MAIN: 0, [0]: "MAIN", INLINE: 1, [1]: "INLINE" };
const result = size.fileFinishedImporting("modules/frames/FramesConstants.tsx");
2026-07-20 16:05:17 +00:00
export const FrameLayoutModes = { FOCUSED: 0, [0]: "FOCUSED", PIP: 1, [1]: "PIP" };
2026-10-03 08:58:59 +00:00
export const MAIN_SURFACE = obj;
2026-10-08 09:57:35 +00:00
export const OVERLAY_SURFACE = obj2;
export const FrameIntent = obj3;
2026-08-06 08:05:19 +00:00
export const getFrameIntentForSurface = function getFrameIntentForSurface(type) {
type = type.type;
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN === type) {
2026-10-08 09:57:35 +00:00
return obj3.MAIN;
} else {
2026-10-08 09:57:35 +00:00
if (EmbeddedSurfaceType.EmbeddedSurfaceType.APP_CHANNEL !== type) {
if (EmbeddedSurfaceType.EmbeddedSurfaceType.VOICE_CHANNEL !== type) {
if (EmbeddedSurfaceType.EmbeddedSurfaceType.OVERLAY !== type) {
if (EmbeddedSurfaceType.EmbeddedSurfaceType.INTERACTION_MODAL === type) {
_modDef38(false, "A Frame cannot be launched at an INTERACTION_MODAL surface");
}
}
}
}
return obj3.INLINE;
2026-08-07 06:50:47 +00:00
}
2026-08-06 08:05:19 +00:00
};
2026-10-08 09:57:35 +00:00
export const makeFrameId = function makeFrameId(arg0, type) {
2026-08-06 08:05:19 +00:00
type = type.type;
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN === type) {
2026-10-06 11:16:32 +00:00
const _HermesInternal4 = HermesInternal;
2026-10-08 09:57:35 +00:00
return "main:" + arg0;
2026-10-03 08:58:59 +00:00
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.APP_CHANNEL === type) {
2026-10-08 09:57:35 +00:00
const _HermesInternal3 = HermesInternal;
return "app-channel:" + arg0 + ":" + type.channelId;
2026-10-03 08:58:59 +00:00
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.VOICE_CHANNEL === type) {
2026-10-08 09:57:35 +00:00
const _HermesInternal2 = HermesInternal;
return "voice-channel:" + arg0 + ":" + type.channelId;
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.OVERLAY === type) {
const _HermesInternal = HermesInternal;
2026-10-08 09:57:35 +00:00
return "overlay:" + arg0;
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.INTERACTION_MODAL === type) {
_modDef38(false, "A Frame cannot be launched at an INTERACTION_MODAL surface");
}
};
export const getFrameSurfaceForChannel = function getFrameSurfaceForChannel(type) {
type = type.type;
if (ChannelTypes.GUILD_APP === type) {
({ id: obj2.channelId, guild_id: obj2.guildId } = type);
2026-10-08 09:57:35 +00:00
obj3 = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.APP_CHANNEL, channelId: null, guildId: null };
return obj3;
} else if (tmp.GUILD_VOICE === type) {
const obj = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.VOICE_CHANNEL, channelId: null, guildId: null };
({ id: obj.channelId, guild_id: obj.guildId } = type);
return obj;
} else {
return null;
2026-08-06 08:05:19 +00:00
}
};
2026-10-06 11:16:32 +00:00
export const isLaunched = function isLaunched(conjureBuilderPreviewFrame) {
2026-08-06 08:05:19 +00:00
let state;
2026-10-06 11:16:32 +00:00
if (conjureBuilderPreviewFrame != null) {
state = conjureBuilderPreviewFrame.state;
2026-08-06 08:05:19 +00:00
}
return "launched" === state;
};
2026-10-08 09:57:35 +00:00
export const getFrameHostWindowKey = function getFrameHostWindowKey(state) {
let hostWindowKey;
state = undefined;
if (state != null) {
state = state.state;
}
if ("launched" === state) {
hostWindowKey = state.data.hostWindowKey;
} else {
hostWindowKey = state.hostWindowKey;
}
return hostWindowKey;
};
export const asLaunched = function asLaunched(mainFrame) {
2026-08-06 08:05:19 +00:00
let state;
2026-10-08 09:57:35 +00:00
if (mainFrame != null) {
state = mainFrame.state;
2026-08-06 08:05:19 +00:00
}
let tmp2 = null;
if ("launched" === state) {
2026-10-08 09:57:35 +00:00
tmp2 = mainFrame;
2026-08-06 08:05:19 +00:00
}
return tmp2;
};
export const getPipOrientationLockStateForFrame = function getPipOrientationLockStateForFrame(data) {
data = undefined;
if (data != null) {
data = data.data;
}
let pipOrientationLock;
if (data != null) {
pipOrientationLock = data.pipOrientationLock;
}
if (pipOrientationLock == null) {
let orientationLock;
if (data != null) {
orientationLock = data.orientationLock;
}
pipOrientationLock = orientationLock;
}
return pipOrientationLock;
};