/** * Mnemonist InvertedIndex Typings * ================================ */ type Tokenizer = (key: any) => Array; type TokenizersTuple = [Tokenizer, Tokenizer]; export default class InvertedIndex implements Iterable { // Members dimension: number; size: number; // Constructor constructor(tokenizer?: Tokenizer); constructor(tokenizers?: TokenizersTuple); // Methods clear(): void; add(document: D): this; get(query: any): Array; forEach(callback: (document: D, index: number, invertedIndex: this) => void, scope?: any): void; documents(): IterableIterator; tokens(): IterableIterator; [Symbol.iterator](): IterableIterator; inspect(): any; // Statics static from( iterable: Iterable | {[key: string]: I}, tokenizer?: Tokenizer | TokenizersTuple ): InvertedIndex; }