[TS] Properly type RN.Platform.constants

This commit is contained in:
Beef 2023-01-14 16:05:08 +00:00
parent 5560a136e6
commit 82e41a5c27
2 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,4 @@
import { RNConstants } from "@types";
import { ReactNative as RN } from "@metro/common";
import { after } from "@lib/patcher";
import { getAssetIDByName } from "@ui/assets";
@ -48,8 +49,7 @@ export const versionHash = "__vendettaVersion";
export function getDebugInfo() {
const InfoDictionaryManager = RN.NativeModules.InfoDictionaryManager;
const hermesProps = window.HermesInternal.getRuntimeProperties();
// TODO: Type 'any' removes errors, but is it sensible?
const PlatformConstants = RN.Platform.constants as any;
const PlatformConstants = RN.Platform.constants as RNConstants;
const rnVer = PlatformConstants.reactNativeVersion;
const DCDDeviceManager = RN.NativeModules.DCDDeviceManager;