diff --git a/src/def.d.ts b/src/def.d.ts index 19a8083..35a34c9 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -326,6 +326,11 @@ interface LoaderIdentity { } } +interface DiscordStyleSheet { + [index: string]: any, + createThemedStyleSheet: typeof _RN.StyleSheet.create; +} + interface VendettaObject { patcher: { after: typeof _spitroast.after; @@ -348,7 +353,7 @@ interface VendettaObject { i18n: PropIntellisense<"Messages">; url: PropIntellisense<"openURL">; toasts: PropIntellisense<"open" | "close">; - stylesheet: PropIntellisense<"createThemedStyleSheet">; + stylesheet: DiscordStyleSheet; clipboard: typeof _Clipboard; assets: PropIntellisense<"registerAsset">; invites: PropIntellisense<"acceptInviteAndTransitionToInviteChannel">; diff --git a/src/lib/metro/common.ts b/src/lib/metro/common.ts index 1f3ad0b..689a8de 100644 --- a/src/lib/metro/common.ts +++ b/src/lib/metro/common.ts @@ -1,3 +1,4 @@ +import { DiscordStyleSheet } from "@types"; import { find, findByProps } from "@metro/filters"; // Discord @@ -6,7 +7,7 @@ export const channels = findByProps("getVoiceChannelId"); export const i18n = findByProps("Messages"); export const url = findByProps("openURL", "openDeeplink"); export const toasts = find(m => m.open && m.close && !m.startDrag && !m.init && !m.openReplay && !m.setAlwaysOnTop); -export const stylesheet = findByProps("createThemedStyleSheet"); +export const stylesheet = findByProps("createThemedStyleSheet") as DiscordStyleSheet; export const clipboard = findByProps("setString", "getString", "hasString") as typeof import("@react-native-clipboard/clipboard").default; export const assets = findByProps("registerAsset"); export const invites = findByProps("acceptInviteAndTransitionToInviteChannel");