2.2.6 • Published 2 years ago

@types/json-query v2.2.6

Weekly downloads
1,901
License
MIT
Repository
github
Last release
2 years ago

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

// 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;

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: Thu, 16 Dec 2021 22:32:00 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Matt Traynham.

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.2.3

3 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

8 years ago