npm.io
5.0.5 • Published 2 years ago

@types/jsonpath-plus

Licence
MIT
Version
5.0.5
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/jsonpath-plus

Summary

This package contains type definitions for jsonpath-plus (https://github.com/s3u/JSONPath).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsonpath-plus.

index.d.ts

export as namespace JSONPath;

export type pathType = string | string[];
export type jsonType = null | boolean | number | string | object | [];
export type resultType =
    | "VALUE"
    | "Value"
    | "value"
    | "PATH"
    | "Path"
    | "path"
    | "POINTER"
    | "Pointer"
    | "pointer"
    | "PARENT"
    | "Parent"
    | "parent"
    | "PARENTPROPERTY"
    | "ParentProperty"
    | "parentProperty"
    | "parentproperty";
export type sandboxType = {
    [key in string]: string;
};
export type callback = (payloadValue: any, type: "value" | "property", fullPayload: any) => void;
export type otherCallback = (value: any, path: string, parent: object, parentPropertyName: any) => boolean;

export interface options {
    path?: pathType | undefined;
    json?: jsonType | undefined;
    autostart?: boolean | undefined;
    flatten?: boolean | undefined;
    resultType?: resultType | undefined;
    sandbox?: sandboxType | undefined;
    wrap?: boolean | undefined;
    preventEval?: boolean | undefined;
    parent?: object | undefined;
    parentProperty?: object | undefined;
    callback?: callback | undefined;
    otherTypeCallback?: otherCallback | undefined;
}

export function JSONPath(
    options?: options,
    path?: pathType,
    json?: jsonType,
    callback?: callback,
    otherTypeCallback?: otherCallback,
): object | object[];
export function JSONPath(
    path?: pathType,
    json?: jsonType,
    callback?: callback,
    otherTypeCallback?: otherCallback,
): object | object[];

Additional Details

  • Last updated: Tue, 07 Nov 2023 0337 GMT
  • Dependencies: none

Credits

These definitions were written by Chris Barth.