Sha256: 2bc6dc0f297a4af4fb622854a82feae5746b634499d44e2232166083e57c6f8d

Contents?: true

Size: 683 Bytes

Versions: 33

Compression:

Stored size: 683 Bytes

Contents

type Func = (...args: any[]) => any;

export interface Cache<K, V> {
  create: CacheCreateFunc<K, V>
}

interface CacheCreateFunc<K, V> {
  (): {
    get(key: K): V;
    set(key: K, value: V): void;
    has(key: K): boolean;
   }
}

export type Serializer = (args: any[]) => string;

export interface Options<F extends Func> {
  cache?: Cache<string, ReturnType<F>>;
  serializer?: Serializer;
  strategy?: MemoizeFunc;
}

export interface MemoizeFunc {
  <F extends Func>(fn: F, options?: Options<F>): F;
}

interface Memoize extends MemoizeFunc {
  strategies: {
    variadic: MemoizeFunc;
    monadic: MemoizeFunc;
  };
}

declare const memoize: Memoize;

export default memoize;

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.59 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.58 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.57 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.56 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.55 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.54 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.53 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.52 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.51 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.50 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.49 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.48 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.47 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.46 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.45 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.44 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.43 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.42 node_modules/fast-memoize/typings/fast-memoize.d.ts
immosquare-cleaner-0.1.41 node_modules/fast-memoize/typings/fast-memoize.d.ts