npm.io
3.0.32 • Published 2 years ago

@types/hashset

Licence
MIT
Version
3.0.32
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/hashset

Summary

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

Details

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

index.d.ts

/// <reference types="hashtable" />

interface IHashSet<TValue> {
    add(value: TValue): void;
    addAll(arr: TValue[]): void;
    contains(value: TValue): boolean;

    clear(): void;
    isEmpty(): boolean;
    values(): TValue[];

    remove(value: TValue): void;
    size(): number;

    clone(): IHashSet<TValue>;

    isSubsetOf(set: IHashSet<TValue>): boolean;
    intersection(set: IHashSet<TValue>): IHashSet<TValue>;
    union(set: IHashSet<TValue>): IHashSet<TValue>;
    complement(set: IHashSet<TValue>): IHashSet<TValue>;
}

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

declare var HashSet: IHashSetStatic;

declare module "hashset" {
    export = HashSet;
}

Additional Details

Credits

These definitions were written by Sergey Gerasimov.