-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
passjoin-index.d.ts
54 lines (46 loc) · 1.33 KB
/
passjoin-index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Mnemonist PassjoinIndex Typings
* ================================
*/
type LevenshteinDistanceFunction<T> = (a: T, b: T) => number;
export default class PassjoinIndex<T> implements Iterable<T> {
// Members
size: number;
// Constructor
constructor(levenshtein: LevenshteinDistanceFunction<T>, k: number);
// Methods
add(value: T): this;
search(query: T): Set<T>;
clear(): void;
forEach(callback: (value: T, index: number, self: this) => void, scope?: any): void;
values(): IterableIterator<T>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;
// Statics
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
levenshtein: LevenshteinDistanceFunction<I>,
k: number
): PassjoinIndex<I>;
}
export function countKeys(k: number, s: number): number;
export function comparator<T>(a: T, b: T): number;
export function partition(k: number, l: number): Array<[number, number]>;
export function segments<T>(k: number, string: T): Array<T>;
export function segmentPos<T>(k: number, i: number, string: T): number;
export function multiMatchAwareInterval(
k: number,
delta: number,
i: number,
s: number,
pi: number,
li: number
): [number, number];
export function multiMatchAwareSubstrings<T>(
k: number,
string: T,
l: number,
i: number,
pi: number,
li: number
): Array<T>;