You've already forked search-query-parser
Initial pass at typescript typings
This commit is contained in:
26
index.d.ts
vendored
Normal file
26
index.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
export interface SearchParserOptions {
|
||||||
|
offsets?: boolean;
|
||||||
|
tokenize?: boolean;
|
||||||
|
keywords?: string[];
|
||||||
|
ranges?: string[];
|
||||||
|
alwaysArray?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ISearchParserDictionary {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SearchParserOffset {
|
||||||
|
keyword: string;
|
||||||
|
value?: string;
|
||||||
|
offsetStart: number;
|
||||||
|
offsetEnd: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SearchParserResult extends ISearchParserDictionary {
|
||||||
|
text?: string;
|
||||||
|
offsets?: SearchParserOffset[];
|
||||||
|
exclude?: ISearchParserDictionary;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parse(string: string, options?: SearchParserOptions): string | SearchParserResult;
|
||||||
14
package-lock.json
generated
Normal file
14
package-lock.json
generated
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "search-query-parser",
|
||||||
|
"version": "1.4.0",
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"typescript": {
|
||||||
|
"version": "3.3.3333",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz",
|
||||||
|
"integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/nepsilon/search-query-parser",
|
"homepage": "https://github.com/nepsilon/search-query-parser",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"mocha": "*",
|
||||||
"should": "^3.2.0",
|
"should": "^3.2.0",
|
||||||
"mocha": "*"
|
"typescript": "^3.3.3333"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es5",
|
||||||
|
"composite": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"./lib/**/*"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
3
tslint.json
Normal file
3
tslint.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "dtslint/dt.json"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user