Skip to content

Commit

Permalink
Merge pull request #128 from yoursunny/multiset-iterable
Browse files Browse the repository at this point in the history
multi-set: improve iterator typing
  • Loading branch information
Yomguithereal authored Apr 27, 2020
2 parents c72d9dc + 99680cf commit 87222c5
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 80 deletions.
16 changes: 8 additions & 8 deletions bi-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export class InverseMap<K, V> implements Iterable<[K, V]> {
has(key: K): boolean;
get(key: K): V;
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<V>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;
}

Expand All @@ -35,10 +35,10 @@ export default class BiMap<K, V> implements Iterable<[K, V]> {
has(key: K): boolean;
get(key: K): V;
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<V>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions bit-set.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export default class BitSet implements Iterable<number> {
rank(r: number): number;
select(r: number): number;
forEach(callback: (index: number, value: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
entries(): Iterator<[number, number]>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
entries(): IterableIterator<[number, number]>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
toJSON(): Array<number>;
}
6 changes: 3 additions & 3 deletions bit-vector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default class BitVector implements Iterable<number> {
rank(r: number): number;
select(r: number): number;
forEach(callback: (index: number, value: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
entries(): Iterator<[number, number]>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
entries(): IterableIterator<[number, number]>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
toJSON(): Array<number>;
}
6 changes: 3 additions & 3 deletions circular-buffer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default class CircularBuffer<T> implements Iterable<T> {
get(index: number): T | undefined;
forEach(callback: (item: T, index: number, buffer: this) => void, scope?: any): void;
toArray(): Iterable<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;

// Statics
Expand Down
10 changes: 5 additions & 5 deletions default-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export default class DefaultMap<K, V> implements Iterable<[K, V]> {
set(key: K, value: V): this;
delete(key: K): boolean;
has(key: K): boolean;
get(key: K): V | undefined;
get(key: K): V;
peek(key: K): V | undefined;
forEach(callback: (value: V, key: K, map: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<V>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions fixed-deque.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default class FixedDeque<T> implements Iterable<T> {
get(index: number): T | undefined;
forEach(callback: (item: T, index: number, buffer: this) => void, scope?: any): void;
toArray(): Iterable<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions fixed-stack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default class FixedStack<T> implements Iterable<T> {
peek(): T | undefined;
forEach(callback: (item: T, index: number, stack: this) => void, scope?: any): void;
toArray(): Iterable<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
toString(): string;
toJSON(): Iterable<T>;
inspect(): any;
Expand Down
4 changes: 2 additions & 2 deletions fuzzy-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default class FuzzyMap<K, V> implements Iterable<V> {
get(key: any): V | undefined;
has(key: any): boolean;
forEach(callback: (value: V, key: V) => void, scope?: this): void;
values(): Iterator<V>;
[Symbol.iterator](): Iterator<V>;
values(): IterableIterator<V>;
[Symbol.iterator](): IterableIterator<V>;
inspect(): any;

// Statics
Expand Down
4 changes: 2 additions & 2 deletions fuzzy-multi-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default class FuzzyMultiMap<K, V> implements Iterable<V> {
get(key: any): Array<V> | Set<V> | undefined;
has(key: any): boolean;
forEach(callback: (value: V, key: V) => void, scope?: any): void;
values(): Iterator<V>;
[Symbol.iterator](): Iterator<V>;
values(): IterableIterator<V>;
[Symbol.iterator](): IterableIterator<V>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions inverted-index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default class InvertedIndex<D> implements Iterable<D> {
add(document: D): this;
get(query: any): Array<D>;
forEach(callback: (document: D, index: number, invertedIndex: this) => void, scope?: any): void;
documents(): Iterator<D>;
tokens(): Iterator<string>;
[Symbol.iterator](): Iterator<D>;
documents(): IterableIterator<D>;
tokens(): IterableIterator<string>;
[Symbol.iterator](): IterableIterator<D>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions linked-list.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class LinkedList<T> implements Iterable<T> {
unshift(value: T): number;
forEach(callback: (value: T, index: number, list: this) => void, scope?: any): void;
toArray(): Array<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
toString(): string;
toJSON(): Array<T>;
inspect(): any;
Expand Down
8 changes: 4 additions & 4 deletions lru-cache.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default class LRUCache<K, V> implements Iterable<[K, V]> {
peek(key: K): V | undefined;
has(key: K): boolean;
forEach(callback: (value: V, key: K, cache: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<V>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;

// Statics
Expand Down
8 changes: 4 additions & 4 deletions lru-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default class LRUMap<K, V> implements Iterable<[K, V]> {
peek(key: K): V | undefined;
has(key: K): boolean;
forEach(callback: (value: V, key: K, cache: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<V>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;

// Statics
Expand Down
8 changes: 4 additions & 4 deletions multi-set.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default class MultiSet<K> implements Iterable<K> {
top(n: number): Array<[K, number]>;
forEach(callback: (value: K, key: K, set: this) => void, scope?: any): void;
forEachMultiplicity(callback: (value: number, key: K, set: this) => void, scope?: any): void;
keys(): Iterator<K>;
values(): Iterator<number>;
multiplicities(): Iterator<[K, number]>;
[Symbol.iterator](): Iterator<K>;
keys(): IterableIterator<K>;
values(): IterableIterator<K>;
multiplicities(): IterableIterator<[K, number]>;
[Symbol.iterator](): IterableIterator<K>;
inspect(): any;
toJSON(): any;

Expand Down
4 changes: 2 additions & 2 deletions passjoin-index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default class PassjoinIndex<T> implements Iterable<T> {
search(query: T): Set<T>;
clear(): void;
forEach(callback: (value: T, index: number, self: this) => void, scope?: any): void;
values(): Iterator<T>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions queue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default class Queue<T> implements Iterable<T> {
peek(): T | undefined;
forEach(callback: (item: T, index: number, queue: this) => void, scope?: any): void;
toArray(): Array<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
toString(): string;
toJSON(): Array<T>;
inspect(): any;
Expand Down
8 changes: 4 additions & 4 deletions sparse-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default class SparseMap<V> implements Iterable<[number, V]> {
set(key: number, value: V): this;
delete(key: number): boolean;
forEach(callback: (value: V, key: number, set: this) => void, scope?: any): void;
keys(): Iterator<number>;
values(): Iterator<V>;
entries(): Iterator<[number, V]>;
[Symbol.iterator](): Iterator<[number, V]>;
keys(): IterableIterator<number>;
values(): IterableIterator<V>;
entries(): IterableIterator<[number, V]>;
[Symbol.iterator](): IterableIterator<[number, V]>;
inspect(): any;
}
4 changes: 2 additions & 2 deletions sparse-queue-set.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class SparseQueueSet implements Iterable<number> {
enqueue(value: number): this;
dequeue(): number | undefined;
forEach(callback: (value: number, key: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
}
4 changes: 2 additions & 2 deletions sparse-set.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class SparseSet implements Iterable<number> {
add(value: number): this;
delete(value: number): boolean;
forEach(callback: (value: number, key: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
}
6 changes: 3 additions & 3 deletions stack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default class Stack<T> implements Iterable<T> {
peek(): T | undefined;
forEach(callback: (item: T, index: number, stack: this) => void, scope?: any): void;
toArray(): Array<T>;
values(): Iterator<T>;
entries(): Iterator<[number, T]>;
[Symbol.iterator](): Iterator<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
toString(): string;
toJSON(): Array<T>;
inspect(): any;
Expand Down
10 changes: 5 additions & 5 deletions trie-map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export default class TrieMap<K, V> implements Iterable<[K, V]> {
delete(prefix: K): boolean;
has(prefix: K): boolean;
find(prefix: K): Array<[K, V]>;
values(): Iterator<V>;
prefixes(): Iterator<K>;
keys(): Iterator<K>;
entries(): Iterator<[K, V]>;
[Symbol.iterator](): Iterator<[K, V]>;
values(): IterableIterator<V>;
prefixes(): IterableIterator<K>;
keys(): IterableIterator<K>;
entries(): IterableIterator<[K, V]>;
[Symbol.iterator](): IterableIterator<[K, V]>;
inspect(): any;

// Statics
Expand Down
6 changes: 3 additions & 3 deletions trie.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default class Trie<T> implements Iterable<T> {
delete(prefix: T): boolean;
has(prefix: T): boolean;
find(prefix: T): Array<T>;
prefixes(): Iterator<T>;
keys(): Iterator<T>;
[Symbol.iterator](): Iterator<T>;
prefixes(): IterableIterator<T>;
keys(): IterableIterator<T>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;

// Statics
Expand Down
12 changes: 6 additions & 6 deletions vector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default class Vector implements Iterable<number> {
pop(): number | undefined;
get(index: number): number;
forEach(callback: (index: number, value: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
entries(): Iterator<[number, number]>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
entries(): IterableIterator<[number, number]>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
toJSON(): any;

Expand Down Expand Up @@ -60,9 +60,9 @@ declare class TypedVector implements Iterable<number> {
pop(): number | undefined;
get(index: number): number;
forEach(callback: (index: number, value: number, set: this) => void, scope?: any): void;
values(): Iterator<number>;
entries(): Iterator<[number, number]>;
[Symbol.iterator](): Iterator<number>;
values(): IterableIterator<number>;
entries(): IterableIterator<[number, number]>;
[Symbol.iterator](): IterableIterator<number>;
inspect(): any;
toJSON(): any;

Expand Down

0 comments on commit 87222c5

Please sign in to comment.