Skip to content

Commit

Permalink
Allow array-returning methods to have types (#112)
Browse files Browse the repository at this point in the history
Also fixes #106
  • Loading branch information
y-nk authored May 27, 2021
1 parent 78de744 commit 8cb7d3f
Show file tree
Hide file tree
Showing 18 changed files with 5,666 additions and 40 deletions.
8 changes: 4 additions & 4 deletions dist/cjs-compat/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export declare function setMany(entries: [IDBValidKey, any][], customStore?: Use
* @param keys
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function getMany(keys: IDBValidKey[], customStore?: UseStore): Promise<any[]>;
export declare function getMany<T = any>(keys: IDBValidKey[], customStore?: UseStore): Promise<T[]>;
/**
* Update a value. This lets you see the old value and update it as an atomic operation.
*
Expand All @@ -57,17 +57,17 @@ export declare function clear(customStore?: UseStore): Promise<void>;
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function keys(customStore?: UseStore): Promise<IDBValidKey[]>;
export declare function keys<KeyType extends IDBValidKey>(customStore?: UseStore): Promise<KeyType[]>;
/**
* Get all values in the store.
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function values(customStore?: UseStore): Promise<any[]>;
export declare function values<T = any>(customStore?: UseStore): Promise<T[]>;
/**
* Get all entries in the store. Each entry is an array of `[key, value]`.
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function entries(customStore?: UseStore): Promise<[IDBValidKey, any][]>;
export declare function entries<KeyType extends IDBValidKey, ValueType = any>(customStore?: UseStore): Promise<[KeyType, ValueType][]>;
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/cjs-compat/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cjs-compat/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export declare function setMany(entries: [IDBValidKey, any][], customStore?: Use
* @param keys
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function getMany(keys: IDBValidKey[], customStore?: UseStore): Promise<any[]>;
export declare function getMany<T = any>(keys: IDBValidKey[], customStore?: UseStore): Promise<T[]>;
/**
* Update a value. This lets you see the old value and update it as an atomic operation.
*
Expand All @@ -57,17 +57,17 @@ export declare function clear(customStore?: UseStore): Promise<void>;
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function keys(customStore?: UseStore): Promise<IDBValidKey[]>;
export declare function keys<KeyType extends IDBValidKey>(customStore?: UseStore): Promise<KeyType[]>;
/**
* Get all values in the store.
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function values(customStore?: UseStore): Promise<any[]>;
export declare function values<T = any>(customStore?: UseStore): Promise<T[]>;
/**
* Get all entries in the store. Each entry is an array of `[key, value]`.
*
* @param customStore Method to get a custom store. Use with caution (see the docs).
*/
export declare function entries(customStore?: UseStore): Promise<[IDBValidKey, any][]>;
export declare function entries<KeyType extends IDBValidKey, ValueType = any>(customStore?: UseStore): Promise<[KeyType, ValueType][]>;
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/cjs/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8cb7d3f

Please sign in to comment.