From 2364ad6eb99035cfff9bc6001a99206c94ebdeed Mon Sep 17 00:00:00 2001 From: sqwk Date: Thu, 12 Dec 2019 14:02:20 +0100 Subject: [PATCH] fix: Text Only Offset Type --- index.d.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 3430a5f..0a444ca 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[];