4.1.8 • Published 6 months ago

@types/hapi__catbox-memory v4.1.8

Weekly downloads
1,072
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/hapi__catbox-memory

Summary

This package contains type definitions for @hapi/catbox-memory (https://github.com/hapijs/catbox-memory#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hapi__catbox-memory.

index.d.ts

// Type definitions for @hapi/catbox-memory 4.1
// Project: https://github.com/hapijs/catbox-memory#readme
// Definitions by: Simon Schick <https://github.com/SimonSchick>
//                 Silas Rech <https://github.com/lenovouser>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import { ClientApi, ClientOptions } from '@hapi/catbox';

interface CatboxMemory<T> extends ClientApi<T> {}

// tslint:disable-next-line:no-unnecessary-class
declare class CatboxMemory<T> implements ClientApi<T> {
    constructor(options?: CatboxMemory.Options);
}

declare namespace CatboxMemory {
    interface Options extends ClientOptions {
        /**
         * Sets an upper limit on the number of bytes that can be stored in the cache.
         * Once this limit is reached no additional items will be added to the cache until some expire.
         * The utilized memory calculation is a rough approximation and must not be relied on.
         * @default 104857600 (100MB).
         */
        maxByteSize?: number | undefined;
        /**
         * The minimum number of milliseconds in between each cache cleanup.
         * @default 1000 (1 second)
         */
        minCleanupIntervalMsec?: number | undefined;
        /**
         * by default, all data is cached as JSON strings, and converted to an object using JSON.parse() on retrieval.
         * By setting this option to true, Buffer data can be stored alongside the stringified data.
         * Buffers are not stringified, and are copied before storage to prevent the value from changing while in the cache.
         * @default false
         */
        allowMixedContent?: boolean | undefined;
        /**
         * by default, buffers stored in the cache with allowMixedContent set to true are copied when they are set but not when they are retrieved.
         * This means a change to the buffer returned by a get() will change the value in the cache. To prevent this,
         * set cloneBuffersOnGet to true to always return a copy of the cached buffer.
         * @default false
         */
        cloneBuffersOnGet?: boolean | undefined;
    }
}

export = CatboxMemory;

Additional Details

  • Last updated: Thu, 08 Jul 2021 14:22:42 GMT
  • Dependencies: @types/hapi__catbox
  • Global values: none

Credits

These definitions were written by Simon Schick, and Silas Rech.

4.1.6

8 months ago

4.1.8

6 months ago

4.1.7

7 months ago

4.1.4

2 years ago

4.1.5

2 years ago

4.1.3

3 years ago

4.1.2

4 years ago

4.1.1

5 years ago

4.1.0

5 years ago