From 30c76b0e922ccd2e90c14e8d899cb651b3f126e2 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..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[];