UNPKG

@ng-doc/app

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

45 lines (42 loc) 1.39 kB
import { NgDocSearchEngine } from '@ng-doc/app/classes/search-engine'; import { NgDocSearchResult } from '@ng-doc/app/interfaces'; import * as stemmer from '@orama/stemmers'; import { Observable } from 'rxjs'; /** * Options for the `NgDocDefaultSearchEngine`. */ interface NgDocDefaultSearchEngineOptions { /** * The language to use for the search engine. */ stemmer?: typeof stemmer.stemmer; /** * Specifies the maximum distance (following the Levenshtein algorithm) between the term and the searchable property. * (doesn't work with `exact` option) */ tolerance?: number; /** * If `true`, finds all the document with an exact match of the term property. */ exact?: boolean; /** * Number of results to return (default: 10). */ limit?: number; } /** * Search engine for the documentation, it loads the index and provides a search method. */ declare class NgDocDefaultSearchEngine extends NgDocSearchEngine { private options?; private db$; constructor(options?: NgDocDefaultSearchEngineOptions | undefined); /** * Search the documentation for the given query. * @param query The query to search for. */ search(query: string): Observable<NgDocSearchResult[]>; private request; } export { NgDocDefaultSearchEngine }; export type { NgDocDefaultSearchEngineOptions };