From e71496033547826de071fffbc55dfa0c2ea661a6 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Tue, 1 Jul 2025 17:30:53 +0700 Subject: [PATCH] fix(lib): fix type errors --- lib/assets/src/preinit.ts | 3 +-- lib/discord/src/types/index.ts | 2 +- lib/utils/src/proxy.ts | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/assets/src/preinit.ts b/lib/assets/src/preinit.ts index 17e37be..6447b66 100644 --- a/lib/assets/src/preinit.ts +++ b/lib/assets/src/preinit.ts @@ -74,8 +74,7 @@ const unsubRAS = waitForModules( // This will result in a crash, because it tries to read the path and run checks on it, but the path is undefined. // @ts-expect-error rAS.addCustomSourceTransformer(({ asset }) => { - // @ts-expect-error - if (!asset.__packager_asset) return asset + if (!(asset as PackagerAsset).__packager_asset) return asset }) // Asset overrides diff --git a/lib/discord/src/types/index.ts b/lib/discord/src/types/index.ts index d46a925..76303ba 100644 --- a/lib/discord/src/types/index.ts +++ b/lib/discord/src/types/index.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'node:events' -import type { ComponentProps, ComponentType, FC, ReactNode } from 'react' +import type { ComponentProps, ComponentType, FC, JSX, ReactNode } from 'react' import type { ImageSourcePropType, ImageStyle, diff --git a/lib/utils/src/proxy.ts b/lib/utils/src/proxy.ts index 13d83d5..2745a57 100644 --- a/lib/utils/src/proxy.ts +++ b/lib/utils/src/proxy.ts @@ -236,10 +236,9 @@ export function destructure( options?: ProxifyOptions, ): T { return new Proxy({} as T, { - get: (_, p) => + get: (_, p, r) => proxify(() => { - // @ts-expect-error - const v = unproxify(proxified)[p] + const v = Reflect.get(unproxify(proxified), p, r) if (v == null) throw new TypeError(