You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I was was using idb to implement a local data store for my work project. I suggest adding export types for openDB callbacks. Describe the solution you'd like
For instance, the types for openDB callbacks for upgrade and blocked are defined like this:
upgrade?(database: IDBPDatabase<DBTypes>,oldVersion: number,newVersion: number|null,transaction: IDBPTransaction<DBTypes,StoreNames<DBTypes>[],'versionchange'>,event: IDBVersionChangeEvent): void;/** * Called if there are older versions of the database open on the origin, so this version cannot * open. * * @param currentVersion Version of the database that's blocking this one. * @param blockedVersion The version of the database being blocked (whatever version you provided to `openDB`). * @param event The event object for the associated `blocked` event. */blocked?(currentVersion: number,blockedVersion: number|null,event: IDBVersionChangeEvent): void;
I suggest we can export them as a separate types, for better modularity. A pseudo-sample code is written below:
Is your feature request related to a problem? Please describe.
I was was using idb to implement a local data store for my work project. I suggest adding export types for openDB callbacks.
Describe the solution you'd like
For instance, the types for openDB callbacks for upgrade and blocked are defined like this:
I suggest we can export them as a separate types, for better modularity. A pseudo-sample code is written below:
and then we can use it in the OpenDBCallbacks type as:
This way I can use this type outside of the library if I am defining a custom upgrade or blocking function elsewhere that I might use later.
The text was updated successfully, but these errors were encountered: