preact-missing-hooks
Version:
A lightweight, extendable collection of missing React-like hooks for Preact — plus fresh, powerful new ones designed specifically for modern Preact apps.
11 lines (10 loc) • 391 B
TypeScript
/**
* Wraps an IDBRequest in a Promise.
* @module indexedDB/requestToPromise
*/
/**
* Converts an IDBRequest to a Promise. Rejects with the request's error on failure.
* @param request - Native IndexedDB request.
* @returns Promise that resolves with the request result or rejects with DOMException.
*/
export declare function requestToPromise<T>(request: IDBRequest<T>): Promise<T>;