fix: fix multiple type errors
This commit is contained in:
parent
d0b9d63d12
commit
b7e329ad9f
3 changed files with 4 additions and 3 deletions
4
src/def.d.ts
vendored
4
src/def.d.ts
vendored
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@types": ["src/def.d.ts"],
|
||||
|
|
Loading…
Reference in a new issue