Installation
npm install --save @types/json-query
Summary
This package contains type definitions for json-query (https://github.com/mmckegg/json-query#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-query.
index.d.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: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: none
Credits
These definitions were written by Matt Traynham.