120 lines
4.3 KiB
TypeScript
120 lines
4.3 KiB
TypeScript
// Module ID: 10802
|
|
// Function ID: 10803
|
|
// Name: FramesConstants
|
|
// Dependencies: [1085, 8611, 38, 2]
|
|
// Exports: asLaunched, getFrameHostWindowKey, getFrameIntentForSurface, getFrameSurfaceForChannel, getPipOrientationLockStateForFrame, isLaunched, makeFrameId
|
|
|
|
// Module 10802 (FramesConstants)
|
|
import _modDef38 from "module_38" /* 38 */;
|
|
import Constants from "Constants" /* 1085 */;
|
|
import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8611 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const ChannelTypes = Constants.ChannelTypes;
|
|
let obj = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN };
|
|
const obj2 = { type: EmbeddedSurfaceType.EmbeddedSurfaceType.OVERLAY };
|
|
let obj3 = { MAIN: 0, [0]: "MAIN", INLINE: 1, [1]: "INLINE" };
|
|
const result = size.fileFinishedImporting("modules/frames/FramesConstants.tsx");
|
|
|
|
export const FrameLayoutModes = { FOCUSED: 0, [0]: "FOCUSED", PIP: 1, [1]: "PIP" };
|
|
export const MAIN_SURFACE = obj;
|
|
export const OVERLAY_SURFACE = obj2;
|
|
export const FrameIntent = obj3;
|
|
export const getFrameIntentForSurface = function getFrameIntentForSurface(type) {
|
|
type = type.type;
|
|
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN === type) {
|
|
return obj3.MAIN;
|
|
} else {
|
|
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;
|
|
}
|
|
};
|
|
export const makeFrameId = function makeFrameId(arg0, type) {
|
|
type = type.type;
|
|
if (EmbeddedSurfaceType.EmbeddedSurfaceType.MAIN === type) {
|
|
const _HermesInternal4 = HermesInternal;
|
|
return "main:" + arg0;
|
|
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.APP_CHANNEL === type) {
|
|
const _HermesInternal3 = HermesInternal;
|
|
return "app-channel:" + arg0 + ":" + type.channelId;
|
|
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.VOICE_CHANNEL === type) {
|
|
const _HermesInternal2 = HermesInternal;
|
|
return "voice-channel:" + arg0 + ":" + type.channelId;
|
|
} else if (EmbeddedSurfaceType.EmbeddedSurfaceType.OVERLAY === type) {
|
|
const _HermesInternal = HermesInternal;
|
|
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);
|
|
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;
|
|
}
|
|
};
|
|
export const isLaunched = function isLaunched(conjureBuilderPreviewFrame) {
|
|
let state;
|
|
if (conjureBuilderPreviewFrame != null) {
|
|
state = conjureBuilderPreviewFrame.state;
|
|
}
|
|
return "launched" === state;
|
|
};
|
|
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) {
|
|
let state;
|
|
if (mainFrame != null) {
|
|
state = mainFrame.state;
|
|
}
|
|
let tmp2 = null;
|
|
if ("launched" === state) {
|
|
tmp2 = mainFrame;
|
|
}
|
|
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;
|
|
};
|