Class CacheManager

Hierarchy

  • EventEmitter<"ready" | "reset">
    • CacheManager

Constructors

Properties

_entries: {
    [uri: string]: CacheEntry;
}

Type declaration

_entryExpiresIn: number
_folder: string
_ready: boolean
_tmpFolder: string
folder: string
prefixed: string | boolean

Accessors

Methods

  • Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns CacheManager

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns ("ready" | "reset")[]

  • Parameters

    • withTmp: boolean = false

    Returns Promise<number>

  • Return the number of listeners listening to a given event.

    Parameters

    • event: "ready" | "reset"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

  • Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • Optional fn: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns CacheManager

  • Add a listener for a given event.

    Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns CacheManager

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns CacheManager

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: "ready" | "reset"

    Returns CacheManager

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "ready" | "reset"

    Parameters

    • event: T
    • Optional fn: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns CacheManager

Generated using TypeDoc