Skip to content

Fixed typescript typing for sandbox #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed other issues when trying to compile test-api.js with typescript
  • Loading branch information
joepjoosten committed Jan 14, 2020
commit c20c3a40dcf45e2715f6cffeeb7362634759143c
18 changes: 6 additions & 12 deletions src/jsonpath.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ declare module 'jsonpath-plus' {
* The JSONPath expression as a (normalized or unnormalized) string or
* array.
*/
path: string | any[]
path?: string | any[]
/**
* The JSON object to evaluate (whether of null, boolean, number,
* string, object, or array type).
*/
json: null | boolean | number | string | object | any[]
json?: null | boolean | number | string | object | any[]
/**
* If this is supplied as false, one may call the evaluate method
* manually.
Expand Down Expand Up @@ -136,8 +136,8 @@ declare module 'jsonpath-plus' {
<T = any>(
path: JSONPathOptions['path'],
json: JSONPathOptions['json'],
callback: JSONPathOptions['callback'],
otherTypeCallback: JSONPathOptions['otherTypeCallback']
callback?: JSONPathOptions['callback'],
otherTypeCallback?: JSONPathOptions['otherTypeCallback']
): T
}

Expand Down Expand Up @@ -182,15 +182,9 @@ declare module 'jsonpath-plus' {
callback: JSONPathOptions['callback'],
otherTypeCallback: JSONPathOptions['otherTypeCallback']
): any
evaluate(options: {
path: JSONPathOptions['path'],
json: JSONPathOptions['json'],
callback: JSONPathOptions['callback'],
otherTypeCallback: JSONPathOptions['otherTypeCallback']
}): any
evaluate(options?: JSONPathOptions): any
}

type JSONPathType = JSONPathCallable & JSONPathClass

export const JSONPath: JSONPathType
export const JSONPath: JSONPathType;
}