You've already forked search-query-parser
Updated README, fleshed out types doc a bit more
This commit is contained in:
52
index.d.ts
vendored
52
index.d.ts
vendored
@@ -1,26 +1,34 @@
|
||||
export interface SearchParserOptions {
|
||||
offsets?: boolean;
|
||||
tokenize?: boolean;
|
||||
keywords?: string[];
|
||||
ranges?: string[];
|
||||
alwaysArray?: boolean;
|
||||
}
|
||||
// @file
|
||||
// Type definitions for search-query-parser.
|
||||
// Project: https://github.com/nepsilon/search-query-parser
|
||||
// Definitions by: Geoffrey Roberts <g.roberts@blackicemedia.com>
|
||||
// Definitions: https://github.com/nepsilon/search-query-parser
|
||||
|
||||
export interface ISearchParserDictionary {
|
||||
[key: string]: any;
|
||||
}
|
||||
export module SearchQueryParser {
|
||||
export interface SearchParserOptions {
|
||||
offsets?: boolean;
|
||||
tokenize?: boolean;
|
||||
keywords?: string[];
|
||||
ranges?: string[];
|
||||
alwaysArray?: boolean;
|
||||
}
|
||||
|
||||
export interface SearchParserOffset {
|
||||
keyword: string;
|
||||
value?: string;
|
||||
offsetStart: number;
|
||||
offsetEnd: number;
|
||||
}
|
||||
export interface ISearchParserDictionary {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface SearchParserResult extends ISearchParserDictionary {
|
||||
text?: string | string[];
|
||||
offsets?: SearchParserOffset[];
|
||||
exclude?: ISearchParserDictionary;
|
||||
}
|
||||
export interface SearchParserOffset {
|
||||
keyword: string;
|
||||
value?: string;
|
||||
offsetStart: number;
|
||||
offsetEnd: number;
|
||||
}
|
||||
|
||||
export function parse(string: string, options?: SearchParserOptions): string | SearchParserResult;
|
||||
export interface SearchParserResult extends ISearchParserDictionary {
|
||||
text?: string | string[];
|
||||
offsets?: SearchParserOffset[];
|
||||
exclude?: ISearchParserDictionary;
|
||||
}
|
||||
|
||||
export function parse(string: string, options?: SearchParserOptions): string | SearchParserResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user