export interface IndexDoc { readonly id: string; readonly fields: ReadonlyArray<{ readonly field: string; readonly locale?: string; readonly text: string; }>; } export interface IndexHit { readonly id: string; readonly score: number; readonly field: string; readonly locale?: string; readonly text: string; readonly offset: number; } export interface QueryOptions { readonly limit?: number; readonly match?: 'any' | 'all'; readonly prefix?: boolean; readonly fields?: readonly string[]; } export interface IndexSnapshot { readonly v: 1; readonly fieldStats: ReadonlyArray<[string, { df: [string, number][]; n: number; totalLen: number; }]>; readonly docs: ReadonlyArray<{ id: string; field: string; locale?: string; text: string; len: number; tf: [string, number][]; firstOffset: [string, number][]; }>; } export declare class InvertedIndex { private readonly fieldStats; private readonly docs; static build(docs: ReadonlyArray): InvertedIndex; query(query: string, opts?: QueryOptions): IndexHit[]; toSnapshot(): IndexSnapshot; static fromSnapshot(s: IndexSnapshot): InvertedIndex; }