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: {
|
storage: {
|
||||||
createProxy: <T>(target: T) => { proxy: T, emitter: Emitter };
|
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>>;
|
createStorage: <T>(backend: StorageBackend) => Promise<Awaited<T>>;
|
||||||
wrapSync: <T extends Promise<any>>(store: T) => Awaited<T>;
|
wrapSync: <T extends Promise<any>>(store: T) => Awaited<T>;
|
||||||
awaitSyncWrapper: (store: any) => Promise<void>;
|
awaitSyncWrapper: (store: any) => Promise<void>;
|
||||||
|
@ -514,7 +514,7 @@ declare global {
|
||||||
const __vendettaVersion: string;
|
const __vendettaVersion: string;
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
[key: PropertyKey]: any;
|
[key: Exclude<PropertyKey, number>]: any;
|
||||||
modules: MetroModules;
|
modules: MetroModules;
|
||||||
vendetta: VendettaObject;
|
vendetta: VendettaObject;
|
||||||
React: typeof _React;
|
React: typeof _React;
|
||||||
|
|
|
@ -81,7 +81,7 @@ export function useProxy<T>(storage: T & { [key: symbol]: any }): T {
|
||||||
return storage;
|
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 data = await backend.get();
|
||||||
const { proxy, emitter } = createProxy(data);
|
const { proxy, emitter } = createProxy(data);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"],
|
"@/*": ["src/*"],
|
||||||
"@types": ["src/def.d.ts"],
|
"@types": ["src/def.d.ts"],
|
||||||
|
|
Loading…
Reference in a new issue