declare module "flexsearch" { // Type Abbreviations: // ------------------------- // D: DocumentData // W: Worker // S: StorageInterface (Persistent) // H: Highlight // P: Pluck // R: Resolve // E: Enrich // M: Merge // A: Async /************************************/ /* Utils */ /************************************/ export type Id = number | string; export type Limit = number; export type ExportHandler = (key: string, data: string) => void; export type ExportHandlerAsync = (key: string, data: string) => Promise; export type AsyncCallback = (result?: T) => void; /************************************/ /* Common Options */ /************************************/ /** * **Document:** * * Presets: https://github.com/nextapps-de/flexsearch#presets */ export type Preset = | "memory" | "performance" | "match" | "score" | "default"; /** * Tokenizer: https://github.com/nextapps-de/flexsearch#tokenizer-prefix-search \ * Custom Tokenizer: https://github.com/nextapps-de/flexsearch#add-custom-tokenizer */ export type Tokenizer = | "strict" | "exact" | "default" | "tolerant" | "forward" | "reverse" | "bidirectional" | "full"; /** * Encoders: https://github.com/nextapps-de/flexsearch#encoders */ export type Encoders = | "Exact" | "Default" | "Normalize" /** @deprecated */ | "LatinExact" /** @deprecated */ | "LatinDefault" /** @deprecated */ | "LatinSimple" | "LatinBalance" | "LatinAdvanced" | "LatinExtra" | "LatinSoundex" | "CJK" | ((content: string) => string[]); /** * **Document:** * * Context Options: https://github.com/nextapps-de/flexsearch#context-options * * Contextual search: https://github.com/nextapps-de/flexsearch#contextual */ export type ContextOptions = { resolution: number; depth: number; bidirectional: boolean; }; /** * **Document:** * * Search options: https://github.com/nextapps-de/flexsearch#search-options */ export type SearchOptions = { query?: string; limit?: number; offset?: number; suggest?: boolean; resolution?: number; context?: boolean; cache?: R extends true ? boolean : false; resolve?: R; }; export type SerializedFunctionString = string; /** * **Document:** * * Language Options: https://github.com/nextapps-de/flexsearch#language-options * * Language: https://github.com/nextapps-de/flexsearch#languages */ export type EncoderOptions = { rtl?: boolean; dedupe?: boolean; include?: EncoderSplitOptions; exclude?: EncoderSplitOptions; split?: string | RegExp | "" | false; numeric?: boolean; normalize?: boolean | ((str: string) => string); prepare?: (str: string) => string; finalize?: (terms: string[]) => string[]; filter?: Set | ((term: string) => boolean); matcher?: Map; mapper?: Map; stemmer?: Map; replacer?: [ string | RegExp, string | "" ]; minlength?: number; maxlength?: number; cache?: boolean | number; } export type EncoderSplitOptions = { letter?: boolean; number?: boolean; symbol?: boolean; punctuation?: boolean; control?: boolean; char?: string | string[]; }; export const Charset: { Exact: EncoderOptions, Default: EncoderOptions, Normalize: EncoderOptions, LatinBalance: EncoderOptions, LatinAdvanced: EncoderOptions, LatinExtra: EncoderOptions, LatinSoundex: EncoderOptions, CJK: EncoderOptions, /** @deprecated */ LatinSimple: EncoderOptions, /** @deprecated */ LatinExact: EncoderOptions, /** @deprecated */ LatinDefault: EncoderOptions }; /** * These options will determine how the contents will be indexed. * * **Document:** * * Index options: https://github.com/nextapps-de/flexsearch#index-options * * Tokenizer: https://github.com/nextapps-de/flexsearch#tokenizer-partial-match * * Encoder: https://github.com/nextapps-de/flexsearch#charset-collection * * Context: https://github.com/nextapps-de/flexsearch#context-search * * Resolver: https://github.com/nextapps-de/flexsearch/doc/resolver.md * * Keystore: https://github.com/nextapps-de/flexsearch/doc/keystore.md * * Persistent: https://github.com/nextapps-de/flexsearch/doc/persistent.md * * Right-To-Left: https://github.com/nextapps-de/flexsearch/doc/encoder.md#right-to-left-support * * Language: https://github.com/nextapps-de/flexsearch/doc/encoder.md#built-in-language-packs */ export type IndexOptions< S extends StorageInterface | boolean = false, R extends boolean = true > = { preset?: Preset; tokenize?: Tokenizer; cache?: boolean | number; resolution?: number; context?: ContextOptions | boolean; keystore?: number; fastupdate?: boolean; priority?: number; score?: ( content: string[], term: string, term_index: number, partial: string, partial_index: number, ) => number; resolve?: R; // Persistent-specific options db?: S; commit?: boolean; // Language-specific Options and Encoding encoder?: Encoders | EncoderOptions | Encoder; encode?: (text: string) => string[], rtl?: boolean; }; /************************************/ /* Index Search */ /************************************/ export type DefaultSearchResults = Id[]; export type IntermediateSearchResults = Array; export type SearchResults< W extends WorkerType | boolean = false, S extends StorageInterface | boolean = false, R extends boolean = true, A extends boolean = false > = R extends false ? Resolver : W extends false ? S extends false ? A extends false ? DefaultSearchResults : Promise : Promise : Promise /** * Basic usage and variants: https://github.com/nextapps-de/flexsearch#basic-usage-and-variants \ * API overview: https://github.com/nextapps-de/flexsearch#api-overview \ * Usage: https://github.com/nextapps-de/flexsearch#usage */ export class Index< W extends WorkerType = false, S extends StorageInterface | boolean = false, r extends boolean = true > { constructor(options?: Preset | IndexOptions); db: Promise; add(id: Id, content: string): W extends false ? this : Promise; append(id: Id, content: string): W extends false ? this : Promise; update(id: Id, content: string): W extends false ? this : Promise; remove(id: Id): W extends false ? this : Promise; search(query: string): SearchResults; /** @deprecated Pass "limit" within options */ search(query: string, limit: Limit, options?: SearchOptions): SearchResults; search(query: string, options?: SearchOptions): SearchResults; search(options: SearchOptions): SearchResults; searchCache(query: string): SearchResults; /** @deprecated Pass "limit" within options */ searchCache(query: string, limit: Limit): SearchResults; /** @deprecated Pass "limit" within options */ searchCache(query: string, limit: Limit, options?: SearchOptions): SearchResults; searchCache(query: string, options?: SearchOptions): SearchResults; searchCache(options: SearchOptions): SearchResults; // https://github.com/nextapps-de/flexsearch#check-existence-of-already-indexed-ids contain(id: Id): S extends false ? boolean : Promise; clear(): W extends false ? S extends false ? this : Promise : Promise; cleanup(): void; // Export and Import export(handler: ExportHandler): void; export(handler: ExportHandlerAsync): Promise; import(key: string, data: string): void; serialize(with_function_wrapper?: boolean): SerializedFunctionString; // Persistent Index mount(db: StorageInterface): Promise; commit(): Promise; destroy(): Promise; // Async Methods addAsync( id: Id, content: string, callback?: AsyncCallback, ): Promise; appendAsync( id: Id, content: string, callback?: AsyncCallback, ): Promise; updateAsync( id: Id, content: string, callback?: AsyncCallback, ): Promise; removeAsync( id: Id, callback?: AsyncCallback ): Promise; searchAsync( query: string, callback?: AsyncCallback ): SearchResults; searchCacheAsync( query: string, callback?: AsyncCallback ): SearchResults; /** @deprecated Pass "limit" within options */ searchAsync( query: string, limit: Limit, callback?: AsyncCallback ): SearchResults; /** @deprecated Pass "limit" within options */ searchCacheAsync( query: string, limit: Limit, callback?: AsyncCallback ): SearchResults; /** @deprecated Pass "limit" within options */ searchAsync( query: string, limit: Limit, options?: SearchOptions, callback?: AsyncCallback ): SearchResults; /** @deprecated Pass "limit" within options */ searchCacheAsync( query: string, limit: Limit, options?: SearchOptions, callback?: AsyncCallback ): SearchResults; searchAsync( query: string, options?: SearchOptions, callback?: AsyncCallback ): SearchResults; searchCacheAsync( query: string, options?: SearchOptions, callback?: AsyncCallback ): SearchResults; searchAsync( options: SearchOptions, callback?: AsyncCallback ): SearchResults; searchCacheAsync( options: SearchOptions, callback?: AsyncCallback ): SearchResults; } /************************************/ /* Worker Index */ /************************************/ export type WorkerURL = string; export type WorkerPath = string; export type WorkerConfigURL = string; export type WorkerConfigPath = string; export type WorkerType = boolean | WorkerURL | WorkerPath; export type WorkerIndexOptions = IndexOptions & IndexWorkerConfig & { //config?: WorkerConfigURL | WorkerConfigPath, export?: () => Promise; import?: () => Promise; // no persistent supported db?: null; commit?: null; }; export interface IndexWorkerConfig { config?: W extends true ? WorkerConfigURL | WorkerConfigPath : undefined; } export class Worker extends Promise> { constructor(options?: Preset | WorkerIndexOptions); export(): Promise; import(): Promise; } /************************************/ /* Document Search */ /************************************/ export type CustomFN = (doc: D) => string | boolean; /** * The template to be applied on matches (e.g. "\$1\"), where \$1 is a placeholder for the matched partial */ export type TemplateResultHighlighting = string; export type TagName = string; export type FieldName = D extends object ? { [K in keyof D]: K extends string ? D[K] extends Array ? `${ K }` | `${ K }[]:${ FieldName & string }` : K | `${ K }:${ FieldName & string }` : never }[keyof D] : never; export type DefaultFieldOptions< D = DocumentData, S extends StorageInterface | boolean = false > = IndexOptions & { field: FieldName; filter?: (doc: D) => boolean; db?: S; }; export type DefaultCustomFieldOptions< D = DocumentData, S extends StorageInterface | boolean = false > = IndexOptions & { custom: CustomFN; field: FieldName; filter?: (doc: D) => boolean; db?: S; }; export type TagOptions< D = DocumentData, S extends StorageInterface | boolean = false > = | DefaultFieldOptions | DefaultCustomFieldOptions; export type StoreOptions< D = DocumentData, S extends StorageInterface | boolean = false > = | DefaultFieldOptions | DefaultCustomFieldOptions; export type FieldOptions< D extends DocumentData, W extends WorkerType = false, S extends StorageInterface | boolean = false > = | (DefaultFieldOptions & IndexWorkerConfig) | (DefaultCustomFieldOptions & IndexWorkerConfig) /** * # Document Search Result * * To make your result return the full document: * * set `store` to `true` while creating the document; * * set `enrich` to `true` while searching. * * If neither of these conditions is met, then the returned result will be a `ISimpleDocumentSearchResult`. */ /* * **Document:** * * Document options: https://github.com/nextapps-de/flexsearch#document-options */ export type DocumentOptions< D extends DocumentData = DocumentData, W extends WorkerType = false, S extends StorageInterface | boolean = false > = IndexOptions & DocumentDescriptor & { doc?: DocumentDescriptor; document?: DocumentDescriptor; worker?: W; }; /** * **Document:** * * The document descriptor: https://github.com/nextapps-de/flexsearch#the-document-descriptor */ export type DocumentDescriptor< D extends DocumentData = DocumentData, W extends WorkerType = false, S extends StorageInterface | boolean = false > = { id?: string | "id"; field?: FieldName | FieldName[] | FieldOptions | Array>; index?: FieldName | FieldName[] | FieldOptions | Array>; tag?: FieldName | FieldName[] | TagOptions | Array>; store?: FieldName | FieldName[] | StoreOptions | Array> | boolean; }; export type DefaultDocumentSearchResults = Array<{ field?: FieldName; tag?: FieldName; result: DefaultSearchResults; }>; export type EnrichedResults = Array<{ id: Id; doc: D | null; highlight?: string; }>; export type EnrichedDocumentSearchResults = Array<{ field?: FieldName; tag?: FieldName; result: EnrichedResults; }>; export type MergedDocumentSearchResults = Array<{ id: Id; doc?: D | null; field?: FieldName[]; tag?: FieldName[]; //highlight?: {[field: FieldName]: string}; highlight?: Record, string>; }>; export type PluckOptions< D extends DocumentData = DocumentData, H extends HighlightOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true > = FieldName | DocumentSearchOptions; export type DocumentSearchResults< D extends DocumentData = DocumentData, H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false > = P extends false ? M extends true ? MergedDocumentSearchResults : E extends true ? EnrichedDocumentSearchResults : H extends false ? DefaultDocumentSearchResults : EnrichedDocumentSearchResults : E extends true ? EnrichedResults : DefaultSearchResults; export type DocumentSearchResultsWrapper< D extends DocumentData = DocumentData, W extends WorkerType = false, S extends StorageInterface | boolean = false, H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false, A extends boolean = false > = R extends true ? W extends false ? S extends false ? A extends false ? DocumentSearchResults : Promise> : Promise> : Promise> : Resolver; /** * **Document:** * * Document search options: https://github.com/nextapps-de/flexsearch#document-search-options */ export type DocumentSearchOptions< D extends DocumentData = DocumentData, H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false, > = SearchOptions & { tag?: {[field: FieldName]: TagName} | Array<{[field: FieldName]: TagName}>; field?: Array> | DocumentSearchOptions | FieldName[] | FieldName; index?: Array> | DocumentSearchOptions | FieldName[] | FieldName; pluck?: P; highlight?: H; enrich?: E; merge?: M; }; export type DocumentValue = | string | number | boolean | null | DocumentData; export type DocumentData = { [key: string]: DocumentValue | DocumentValue[]; }; /** * Basic usage and variants: https://github.com/nextapps-de/flexsearch#basic-usage-and-variants \ * API overview: https://github.com/nextapps-de/flexsearch#api-overview \ * Document store: https://github.com/nextapps-de/flexsearch#document-store */ export class Document< D extends DocumentData = DocumentData, W extends WorkerType = false, S extends StorageInterface | boolean = false > { constructor(options: DocumentOptions); add(id: Id, document: D): W extends false ? this : Promise; add(document: D): W extends false ? this : Promise; append(id: Id, document: D): W extends false ? this : Promise; append(document: D): W extends false ? this : Promise; update(id: Id, document: D): W extends false ? this : Promise; update(document: D): W extends false ? this : Promise; remove(id: Id): W extends false ? this : Promise; remove(document: D): W extends false ? this : Promise; // https://github.com/nextapps-de/flexsearch#field-search search(query: string): DocumentSearchResultsWrapper; searchCache(query: string): DocumentSearchResultsWrapper; search< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, options: DocumentSearchOptions, ): DocumentSearchResultsWrapper; searchCache< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, options: DocumentSearchOptions, ): DocumentSearchResultsWrapper; /** @deprecated Pass "limit" within options */ search< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, options?: DocumentSearchOptions, ): DocumentSearchResultsWrapper; /** @deprecated Pass "limit" within options */ searchCache< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, options?: DocumentSearchOptions, ): DocumentSearchResultsWrapper; search< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( options: DocumentSearchOptions, ): DocumentSearchResultsWrapper; searchCache< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( options: DocumentSearchOptions, ): DocumentSearchResultsWrapper; // https://github.com/nextapps-de/flexsearch#check-existence-of-already-indexed-ids contain(id: Id): S extends false ? boolean : Promise; clear(): W extends false ? S extends false ? this : Promise : Promise; cleanup(): void; get(id: Id): S extends false ? D | null : Promise; set(id: Id, document: D): this; set(document: D): this; // Export and Import export(handler: ExportHandler): void; export(handler: ExportHandlerAsync): Promise; import(key: string, data: string): void; // Persistent Index mount>(db: S): Promise; commit(): Promise; destroy(): Promise; // Async Methods addAsync( id: Id, document: D, callback?: AsyncCallback, ): Promise; addAsync( document: D, callback?: AsyncCallback, ): Promise; appendAsync( id: Id, document: D, callback?: AsyncCallback, ): Promise; appendAsync( document: D, callback?: AsyncCallback, ): Promise; updateAsync( id: Id, document: D, callback?: AsyncCallback, ): Promise; updateAsync( document: D, callback?: AsyncCallback, ): Promise; removeAsync( id: Id, callback?: AsyncCallback, ): Promise; removeAsync( document: D, callback?: AsyncCallback, ): Promise; searchAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper searchCacheAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper /** @deprecated Pass "limit" within options */ searchAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper /** @deprecated Pass "limit" within options */ searchCacheAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper /** @deprecated Pass "limit" within options */ searchAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, options?: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper; /** @deprecated Pass "limit" within options */ searchCacheAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, limit: Limit, options?: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper; searchAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, options?: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper searchCacheAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( query: string, options?: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper searchAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( options: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper; searchCacheAsync< H extends HighlightOptions | boolean = false, P extends PluckOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, M extends boolean = false >( options: DocumentSearchOptions, callback?: AsyncCallback>, ): DocumentSearchResultsWrapper; } export type IdType = "text" | "char" | "varchar" | "string" | "number" | "numeric" | "integer" | "smallint" | "tinyint" | "mediumint" | "int" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" | "int64" | "uint64" | "bigint"; export type PersistentOptions = { name?: string; type?: IdType; db?: any; }; export type DefaultResolve< D extends DocumentData = undefined, H extends HighlightOptions | boolean = false, R extends boolean = true, E extends boolean = H extends false ? false : true, > = { limit?: number; offset?: number; resolve?: R; /** only usable when "resolve" was not set to false */ enrich?: D extends undefined ? false : R extends true ? E : false; highlight?: D extends undefined ? false : H; // R extends true ? H : false; }; export type ResolverOptions< D extends DocumentData = undefined, W extends WorkerType = false, S extends StorageInterface | boolean = false, H extends HighlightOptions | boolean = false, R extends boolean = false, E extends boolean = H extends false ? false : true, A extends boolean = false > = Resolver | (DefaultResolve & { query?: string; index?: Index | Document | Worker; pluck?: FieldName; field?: FieldName; tag?: {[field: FieldName]: TagName} | Array<{[field: FieldName]: TagName}>; and?: ResolverOptions | Array>; or?: ResolverOptions | Array>; xor?: ResolverOptions | Array>; not?: ResolverOptions | Array>; boost?: number; suggest?: boolean; cache?: boolean; async?: A; queue?: A; }); export type HighlightBoundaryOptions = { before?: number; after?: number; total?: number; }; export type HighlightEllipsisOptions = { template: TemplateResultHighlighting; pattern?: string | boolean; }; export type HighlightOptions = TemplateResultHighlighting | { template: TemplateResultHighlighting; boundary?: HighlightBoundaryOptions | number; ellipsis?: HighlightEllipsisOptions | string | boolean; clip?: boolean; merge?: boolean; }; export class Encoder { constructor(options?: EncoderOptions); assign(options: EncoderOptions): this; encode(content: string): string[]; addMapper(char_match: string, char_replace: string): this; addMatcher(match: string, replace: string): this; addStemmer(match: string, replace: string): this; addFilter(term: string): this; addReplacer(match: string | RegExp, replace: string): this; } export class Resolver< D extends DocumentData = undefined, W extends WorkerType = false, S extends StorageInterface | boolean = false, H extends HighlightOptions | boolean = false, R extends boolean = false, E extends boolean = H extends false ? false : true, A extends boolean = false > { result: IntermediateSearchResults; constructor(options?: ResolverOptions | IntermediateSearchResults); and(...args: ResolverOptions[]): DocumentSearchResultsWrapper; or(...args: ResolverOptions[]): DocumentSearchResultsWrapper; xor(...args: ResolverOptions[]): DocumentSearchResultsWrapper; not(...args: ResolverOptions[]): DocumentSearchResultsWrapper; limit(limit: number): Resolver; offset(offset: number): Resolver; boost(boost: number): Resolver; resolve< h extends HighlightOptions | boolean = H, e extends boolean = h extends HighlightOptions ? true : E, a extends boolean = A >(options?: DefaultResolve): DocumentSearchResultsWrapper; } export class StorageInterface { db: any; constructor(name: string, config: PersistentOptions); constructor(config: string | PersistentOptions); mount(index: Index | Document): Promise; open(): Promise; close(): Promise; destroy(): Promise; clear(): Promise; } export class IndexedDB extends StorageInterface { /*db: IDBDatabase;*/ } const FlexSearch: { Index: typeof Index, Document: typeof Document, Worker: typeof Worker, Encoder: typeof Encoder, Charset: typeof Charset, Resolver: typeof Resolver, IndexedDB: typeof IndexedDB }; export default FlexSearch; } // ----------------------------------- declare module "flexsearch/db/*" { import { StorageInterface } from "flexsearch"; export default StorageInterface; } // declare module "flexsearch/db/indexeddb" { // import { StorageInterface } from "flexsearch"; // export default class IndexedDB extends StorageInterface{ // db: IDBDatabase; // } // } // ----------------------------------- declare module "flexsearch/lang/*" { import { EncoderOptions } from "flexsearch"; const Options: EncoderOptions; export default Options; } // https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html // https://github.com/futurGH/ts-to-jsdoc // https://sethmac.com/typescript-to-jsdoc/ // https://github.com/DefinitelyTyped/DefinitelyTyped