@types/json-query
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -1,6 +0,1 @@ | ||
// Type definitions for json-query 2.2 | ||
// Project: https://github.com/mmckegg/json-query#readme | ||
// Definitions by: Matt Traynham <https://github.com/mtraynham> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
export = JsonQuery; | ||
@@ -7,0 +2,0 @@ |
{ | ||
"name": "@types/json-query", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "TypeScript definitions for json-query", | ||
@@ -10,4 +10,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-query", | ||
"name": "Matt Traynham", | ||
"url": "https://github.com/mtraynham", | ||
"githubUsername": "mtraynham" | ||
"githubUsername": "mtraynham", | ||
"url": "https://github.com/mtraynham" | ||
} | ||
@@ -24,4 +24,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "be4b461ad01991c4fa4a54f590386050d3e00858ef87dd9c3a98233dfc0ea368", | ||
"typesPublisherContentHash": "7d1857931fd22ee9338c020f99f947c11b3319949c0f4645f92791a157e96c1b", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -9,9 +9,89 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-query. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-query/index.d.ts) | ||
````ts | ||
export = JsonQuery; | ||
declare function JsonQuery( | ||
selector: JsonQuery.Selector | JsonQuery.SelectorWithQueryParams, | ||
options: JsonQuery.Options, | ||
): JsonQuery.Result; | ||
declare namespace JsonQuery { | ||
type Selector = string; | ||
type QueryParam = any; | ||
// No way to support [Selector, ...QueryParam[]]? | ||
// 10 params should be more than enough, hopefully. | ||
type SelectorWithQueryParams = | ||
| [Selector, QueryParam] | ||
| [Selector, QueryParam] | ||
| [Selector, QueryParam] | ||
| [Selector, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam] | ||
| [Selector, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam, QueryParam] | ||
| [ | ||
Selector, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
] | ||
| [ | ||
Selector, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
QueryParam, | ||
]; | ||
type Context = any; | ||
type Filter = (input: Context, ...args: any[]) => Context; | ||
interface Locals { | ||
[filterName: string]: Filter; | ||
} | ||
interface Options { | ||
data?: Context | undefined; | ||
rootContext?: Context | undefined; | ||
source?: Context | undefined; | ||
context?: Context | undefined; | ||
parent?: Context | undefined; | ||
locals?: Locals | undefined; | ||
filters?: Locals | undefined; | ||
globals?: boolean | undefined; | ||
force?: boolean | undefined; | ||
allowRegexp?: boolean | undefined; | ||
} | ||
interface Result { | ||
value: any; | ||
key: string; | ||
references: any[]; | ||
parents: string[]; | ||
} | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Fri, 15 Sep 2023 20:36:37 GMT | ||
* Last updated: Wed, 18 Oct 2023 05:47:07 GMT | ||
* Dependencies: none | ||
* Global values: none | ||
# Credits | ||
These definitions were written by [Matt Traynham](https://github.com/mtraynham). |
7187
97
70