mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
jsonata: Provides its own types (#39583)
This commit is contained in:
parent
8b63e0de7b
commit
01f88afb81
@ -2046,6 +2046,12 @@
|
||||
"sourceRepoURL": "https://github.com/mperdeck/jsnlog.js",
|
||||
"asOfVersion": "2.17.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "jsonata",
|
||||
"typingsPackageName": "jsonata",
|
||||
"sourceRepoURL": "https://github.com/jsonata-js/jsonata",
|
||||
"asOfVersion": "1.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "jsonschema",
|
||||
"typingsPackageName": "jsonschema",
|
||||
|
||||
14
types/jsonata/index.d.ts
vendored
14
types/jsonata/index.d.ts
vendored
@ -1,14 +0,0 @@
|
||||
// Type definitions for jsonata 1.3
|
||||
// Project: https://github.com/jsonata-js/jsonata, http://jsonata.org
|
||||
// Definitions by: Nick <https://github.com/nick121212>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function jsonata(str: string): jsonata.Expression;
|
||||
declare namespace jsonata {
|
||||
interface Expression {
|
||||
evaluate(input: any, bindings?: any, callback?: () => any): any;
|
||||
assign(key: string, func: (...args: any[]) => any): void;
|
||||
}
|
||||
}
|
||||
|
||||
export = jsonata;
|
||||
@ -1,12 +0,0 @@
|
||||
import jsonata = require("jsonata");
|
||||
|
||||
const data = {
|
||||
example: [
|
||||
{ value: 4 },
|
||||
{ value: 7 },
|
||||
{ value: 13 }
|
||||
]
|
||||
};
|
||||
|
||||
const expression = jsonata("$sum(example.value)");
|
||||
const result = expression.evaluate(data); // returns 24
|
||||
@ -1,25 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"es6"
|
||||
],
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jsonata-tests.ts"
|
||||
]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user