Improve typings

Remove `DEV` blocks
This commit is contained in:
vorotamoroz
2026-06-18 11:09:07 +01:00
parent 72033472f3
commit fb93511ae7
59 changed files with 245 additions and 421 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ export async function OpenKeyValueDatabase(dbKey: string): Promise<KeyValueDatab
}
export class IDBKeyValueDatabase implements KeyValueDatabase {
protected _dbPromise: Promise<IDBPDatabase<any>> | null = null;
protected _dbPromise: Promise<IDBPDatabase<unknown>> | null = null;
protected dbKey: string;
protected storeKey: string;
protected _isDestroyed: boolean = false;
@@ -104,7 +104,7 @@ export class IDBKeyValueDatabase implements KeyValueDatabase {
this.destroyedPromise = Promise.resolve();
}
}
get DB(): Promise<IDBPDatabase<any>> {
get DB(): Promise<IDBPDatabase<unknown>> {
if (this._isDestroyed) {
return Promise.reject(new Error("Database is destroyed"));
}
@@ -117,7 +117,7 @@ export class IDBKeyValueDatabase implements KeyValueDatabase {
}
async get<U>(key: IDBValidKey): Promise<U> {
const db = await this.DB;
return await db.get(this.storeKey, key);
return (await db.get(this.storeKey, key)) as U;
}
async set<U>(key: IDBValidKey, value: U): Promise<IDBValidKey> {
const db = await this.DB;