# @types/json-query

> TypeScript definitions for json-query

Latest version **2.2.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/json-query
pnpm add @types/json-query
yarn add @types/json-query
bun add @types/json-query
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.2.6 |
| Published | 2023-11-07 |
| First published | 2017-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/json-query
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-query
- npm.io page: https://npm.io/package/@types/json-query

## Recent versions

- 2.2.6 (latest) — 2023-11-07
- 2.2.3 (ts3.8) — 2021-12-16
- 2.2.2 (ts3.7) — 2021-08-31
- 2.2.1 (ts3.6) — 2021-07-08
- 2.2.0 (ts2.7) — 2017-11-07
- 2.2.5 — 2023-10-18
- 2.2.4 — 2023-09-15

## README

# 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](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: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Matt Traynham](https://github.com/mtraynham).

---
_Source: https://npm.io/package/@types/json-query · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
