fix: fix multiple type errors

This commit is contained in:
PalmDevs 2024-02-09 00:01:30 +07:00
parent d0b9d63d12
commit b7e329ad9f
No known key found for this signature in database
GPG key ID: ADC432EE981495A3
3 changed files with 4 additions and 3 deletions

4
src/def.d.ts vendored
View file

@ -486,7 +486,7 @@ interface VendettaObject {
};
storage: {
createProxy: <T>(target: T) => { proxy: T, emitter: Emitter };
useProxy: <T>(storage: T) => T;
useProxy: <T>(storage: T & { [key: symbol]: any }) => T;
createStorage: <T>(backend: StorageBackend) => Promise<Awaited<T>>;
wrapSync: <T extends Promise<any>>(store: T) => Awaited<T>;
awaitSyncWrapper: (store: any) => Promise<void>;
@ -514,7 +514,7 @@ declare global {
const __vendettaVersion: string;
interface Window {
[key: PropertyKey]: any;
[key: Exclude<PropertyKey, number>]: any;
modules: MetroModules;
vendetta: VendettaObject;
React: typeof _React;

View file

@ -81,7 +81,7 @@ export function useProxy<T>(storage: T & { [key: symbol]: any }): T {
return storage;
}
export async function createStorage<T>(backend: StorageBackend): Promise<Awaited<T>> {
export async function createStorage<T>(backend: StorageBackend): Promise<Awaited<T & { [key: symbol]: any }>> {
const data = await backend.get();
const { proxy, emitter } = createProxy(data);

View file

@ -12,6 +12,7 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"paths": {
"@/*": ["src/*"],
"@types": ["src/def.d.ts"],