decord/alpha/source/modules/gateway/GatewayZstdUtils.native.tsx

38 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 13869
// Function ID: 13870
// Name: GatewayZstdUtils
2026-10-09 10:00:15 +00:00
// Dependencies: [17, 1382, 13870, 2]
2026-07-20 16:05:17 +00:00
// Exports: createZstdContextWeb, supportsZstd
2026-10-09 10:00:15 +00:00
// Module 13869 (GatewayZstdUtils)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
2026-10-09 10:00:15 +00:00
import PlatformUtils from "PlatformUtils" /* 1382 */;
import react_nativeDefault from "react-native" /* 13870 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
const NativeModules = react_native.NativeModules;
const result = size.fileFinishedImporting("modules/gateway/GatewayZstdUtils.native.tsx");
2026-07-20 16:05:17 +00:00
export const supportsZstd = function supportsZstd() {
2026-10-03 08:58:59 +00:00
let flag;
const obj = PlatformUtils;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-10-03 08:58:59 +00:00
const obj2 = react_nativeDefault;
flag = obj2.getConstants().supportsZstd;
2026-07-20 16:05:17 +00:00
} else {
const DCDCompressionManager = NativeModules.DCDCompressionManager;
2026-07-29 08:29:29 +00:00
flag = undefined;
if (DCDCompressionManager != null) {
flag = DCDCompressionManager.supportsZstd;
}
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return flag;
2026-07-20 16:05:17 +00:00
};
export const createZstdContextWeb = function createZstdContextWeb() {
const error = new Error("Attempting to use createZstdContextWeb in a native context. Use MobileGatewayCompressionHandler instead.");
2026-07-20 16:05:17 +00:00
throw error;
};