5.0.5 • Published 2 years ago

@types/jsonpath-plus v5.0.5

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

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

// Type definitions for jsonpath-plus 5.0
// Project: https://github.com/s3u/JSONPath
// Definitions by: Chris Barth <https://github.com/cjbarth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 08 Jul 2021 16:22:55 GMT
  • Dependencies: none
  • Global values: JSONPath

Credits

These definitions were written by Chris Barth.