Installation
npm install --save @types/promise-memoize
Summary
This package contains type definitions for promise-memoize (https://github.com/nodeca/promise-memoize#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-memoize.
export = promiseMemoize;
declare function promiseMemoize<T extends (...args: any[]) => PromiseLike<any>>(
fn: T,
options?: promiseMemoize.Options,
): T & {
clear(): void;
};
declare namespace promiseMemoize {
interface Options {
maxAge?: number | undefined;
maxErrorAge?: number | undefined;
resolve?: KeyResolver | undefined;
}
type KeyResolver = "simple" | "json" | ((args: any[]) => any) | ReadonlyArray<"json" | ((arg: any) => any)>;
}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: none
Credits
These definitions were written by Emily Marigold Klassen.