@types/hashtable
TypeScript icon, indicating that this package has built-in type declarations

3.0.33 • Public • Published

Installation

npm install --save @types/hashtable

Summary

This package contains type definitions for hashtable (http://www.timdown.co.uk/jshashtable/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hashtable.

index.d.ts

interface IHashtable<TKey, TValue> {
    put(key: TKey, value: TValue): TValue;
    putAll(
        hashtable: IHashtable<TKey, TValue>,
        conflictCallback?: (key: TKey, thisValue: TValue, value: TValue) => TValue,
    ): void;

    get(key: TKey): TValue;
    containsKey(key: TKey): boolean;
    containsValue(value: TValue): boolean;

    clear(): void;
    isEmpty(): boolean;

    keys(): TKey[];
    values(): TValue[];
    entries(): any[][];

    remove(key: TKey): TValue;
    size(): number;

    clone(): IHashtable<TKey, TValue>;
    each(callback: (key: TKey, value: TValue) => void): void;

    equals(hashtable: IHashtable<TKey, TValue>): boolean;
    toQueryString(): string;
}

interface IHashtableOptions<TKey> {
    hashCode?: ((key: TKey) => any) | undefined;
    equals?: ((key1: TKey, key2: TKey) => boolean) | undefined;
    replaceDuplicateKey?: boolean | undefined;
}

interface IHashtableStatic {
    new<TKey, TValue>(): IHashtable<TKey, TValue>;
    new<TKey, TValue>(options: IHashtableOptions<TKey>): IHashtable<TKey, TValue>;
    new<TKey, TValue>(
        hashCode?: (value: TValue) => any,
        equals?: (value1: TValue, value2: TValue) => boolean,
    ): IHashtable<TKey, TValue>;
}

declare var Hashtable: IHashtableStatic;

declare module "hashtable" {
    export = Hashtable;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Sergey Gerasimov.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/hashtable

Weekly Downloads

108

Version

3.0.33

License

MIT

Unpacked Size

5.2 kB

Total Files

5

Last publish

Collaborators

  • types