@types/json-query
TypeScript icon, indicating that this package has built-in type declarations

2.2.6 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.61,962ts5.7
2.2.61,962ts5.6
2.2.61,962latest
2.2.61,962ts4.5
2.2.61,962ts4.6
2.2.61,962ts4.7
2.2.61,962ts4.8
2.2.61,962ts4.9
2.2.61,962ts5.0
2.2.61,962ts5.1
2.2.61,962ts5.2
2.2.61,962ts5.3
2.2.61,962ts5.4
2.2.61,962ts5.5
2.2.61,962ts5.8
2.2.31,169ts3.8
2.2.31,169ts3.9
2.2.31,169ts4.0
2.2.31,169ts4.1
2.2.31,169ts4.2
2.2.31,169ts4.3
2.2.31,169ts4.4
2.2.0586ts2.0
2.2.0586ts2.1
2.2.0586ts2.2
2.2.0586ts2.3
2.2.0586ts2.4
2.2.0586ts2.5
2.2.0586ts2.6
2.2.0586ts2.7
2.2.0586ts2.8
2.2.0586ts2.9
2.2.0586ts3.0
2.2.0586ts3.1
2.2.0586ts3.2
2.2.0586ts3.3
2.2.0586ts3.4
2.2.0586ts3.5
2.2.216ts3.7
2.2.11ts3.6

Version History

VersionDownloads (Last 7 Days)Published
2.2.61,962
2.2.52
2.2.44
2.2.31,169
2.2.216
2.2.11
2.2.0586

Package Sidebar

Install

npm i @types/json-query

Weekly Downloads

3,740

Version

2.2.6

License

MIT

Unpacked Size

7.19 kB

Total Files

5

Last publish

Collaborators

  • types