1.1.5 • Published 6 months ago

@types/async-cache v1.1.5

Weekly downloads
4,864
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/async-cache

Summary

This package contains type definitions for async-cache (https://github.com/isaacs/async-cache#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/async-cache.

index.d.ts

// Type definitions for async-cache 1.1
// Project: https://github.com/isaacs/async-cache#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import { Options as LRUOptions } from 'lru-cache';

export = AsyncCache;

declare const AsyncCache: AsyncCacheFactory;

interface AsyncCacheFactory {
    <T>(options: AsyncCache.Options<T>): AsyncCache.Cache<T>;
    new <T>(options: AsyncCache.Options<T>): AsyncCache.Cache<T>;
}

declare namespace AsyncCache {
    interface Cache<T> {
        readonly itemCount: number;

        get(key: string, cb: (error: any, value: T) => void): void;
        keys(): string[];
        set(key: string, value: T, maxAge?: number): boolean;
        reset(): void;
        has(key: string): boolean;
        del(key: string): void;
        peek(key: string): T | undefined;
    }

    interface Options<T> extends LRUOptions<string, T> {
        load(key: string, callback: (error: any, asyncValue: T, maxAge?: number) => void): void;
    }
}

Additional Details

  • Last updated: Thu, 12 May 2022 19:01:45 GMT
  • Dependencies: @types/lru-cache
  • Global values: none

Credits

These definitions were written by BendingBender.

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

7 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

7 years ago