import { Book } from './core/types'; import { ReadableContentUnitKind } from './core/readable-content'; export type SearchScope = 'book' | 'unit'; export interface SearchOptions { /** Search all readable units or one selected unit. Defaults to 'book'. */ scope?: SearchScope; /** Readable unit index used when scope is 'unit'. */ unitIndex?: number; /** Search only these readable unit indexes. Overrides scope/unitIndex. */ unitIndexes?: readonly number[]; /** Defaults to false. */ caseSensitive?: boolean; /** Match whole words only. Defaults to false. */ wholeWord?: boolean; /** Maximum result count. Defaults to 100. */ maxResults?: number; /** Number of context characters on each side. Defaults to 48. */ contextChars?: number; } export interface SearchResult { query: string; unitIndex: number; unitId: string | number; unitKind: ReadableContentUnitKind; unitTitle?: string; sectionIndex?: number; pageIndex?: number; blockId?: string; blockType?: string; matchIndex: number; start: number; end: number; excerpt: string; before: string; match: string; after: string; } export interface ContentUnitSearchResult { unitIndex: number; unitId: string | number; unitKind: ReadableContentUnitKind; unitTitle?: string; sectionIndex?: number; pageIndex?: number; results: SearchResult[]; } /** * Search a book's readable content. Reflowable books search sections; fixed * documents search pages that expose text. */ export declare function searchBook(book: Book, query: string, options?: SearchOptions): Promise; /** * Search every readable content unit and return grouped results. */ export declare function searchContentUnits(book: Book, query: string, options?: Omit): Promise; //# sourceMappingURL=search.d.ts.map