forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashset.d.ts
38 lines (29 loc) · 1.12 KB
/
hashset.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Type definitions for jshashset 3.0
// Project: http://www.timdown.co.uk/jshashtable/jshashset.html
// Definitions by: Sergey Gerasimov <https://github.com/gerich-home/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../hashtable/hashtable.d.ts" />
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;
}