diff --git a/index.d.ts b/index.d.ts index 3430a5f..2a4852b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -16,13 +16,21 @@ export interface ISearchParserDictionary { [key: string]: any; } -export interface SearchParserOffset { - keyword: string; - value?: string; +export type SearchParserOffset = (SearchParserKeyWordOffset | SearchParserTextOffset) & { offsetStart: number; offsetEnd: number; } +export type SearchParserKeyWordOffset = { + keyword: string; + value?: string; + +} + +export type SearchParserTextOffset = { + text: string; +} + export interface SearchParserResult extends ISearchParserDictionary { text?: string | string[]; offsets?: SearchParserOffset[];