@types/jexl
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -5,12 +5,12 @@ /** | ||
type Ast = | ||
| { type: 'UnaryExpression'; operator: string; right: Ast } | ||
| { type: 'BinaryExpression'; operator: string; left: Ast; right: Ast } | ||
| { type: 'ConditionalExpression'; test: Ast; consequent: Ast; alternate: Ast } | ||
| { type: 'FilterExpression'; relative: boolean; expr: Ast; subject: Ast } | ||
| { type: 'Literal'; value: string | number | boolean } | ||
| { type: 'ArrayLiteral'; value: Ast[] } | ||
| { type: 'ObjectLiteral'; value: { [key: string]: Ast } } | ||
| { type: 'Identifier'; value: string; from?: Ast; relative?: boolean } | ||
| { type: 'FunctionCall'; name: string; pool: 'functions' | 'transforms'; args: Ast[] }; | ||
| { type: "UnaryExpression"; operator: string; right: Ast } | ||
| { type: "BinaryExpression"; operator: string; left: Ast; right: Ast } | ||
| { type: "ConditionalExpression"; test: Ast; consequent: Ast; alternate: Ast } | ||
| { type: "FilterExpression"; relative: boolean; expr: Ast; subject: Ast } | ||
| { type: "Literal"; value: string | number | boolean } | ||
| { type: "ArrayLiteral"; value: Ast[] } | ||
| { type: "ObjectLiteral"; value: { [key: string]: Ast } } | ||
| { type: "Identifier"; value: string; from?: Ast; relative?: boolean } | ||
| { type: "FunctionCall"; name: string; pool: "functions" | "transforms"; args: Ast[] }; | ||
export default Ast; |
@@ -1,42 +0,42 @@ | ||
import Ast from './Ast'; | ||
import Ast from "./Ast"; | ||
export interface Context { | ||
[key: string]: any; | ||
[key: string]: any; | ||
} | ||
declare class Expression { | ||
constructor(lang: any, exprStr: string); | ||
constructor(lang: any, exprStr: string); | ||
/** | ||
* Forces a compilation of the expression string that this Expression object | ||
* was constructed with. This function can be called multiple times; useful | ||
* if the language elements of the associated Jexl instance change. | ||
* @returns this Expression instance, for convenience | ||
*/ | ||
compile(): Expression; | ||
/** | ||
* Forces a compilation of the expression string that this Expression object | ||
* was constructed with. This function can be called multiple times; useful | ||
* if the language elements of the associated Jexl instance change. | ||
* @returns this Expression instance, for convenience | ||
*/ | ||
compile(): Expression; | ||
/** | ||
* Asynchronously evaluates the expression within an optional context. | ||
* @param context A mapping of variables to values, which will be | ||
* made accessible to the Jexl expression when evaluating it | ||
* @returns resolves with the result of the evaluation. | ||
*/ | ||
eval(context?: Context): Promise<any>; | ||
/** | ||
* Asynchronously evaluates the expression within an optional context. | ||
* @param context A mapping of variables to values, which will be | ||
* made accessible to the Jexl expression when evaluating it | ||
* @returns resolves with the result of the evaluation. | ||
*/ | ||
eval(context?: Context): Promise<any>; | ||
/** | ||
* Synchronously evaluates the expression within an optional context. | ||
* @param context A mapping of variables to values, which will be | ||
* made accessible to the Jexl expression when evaluating it | ||
* @returns the result of the evaluation. | ||
* @throws on error | ||
*/ | ||
evalSync(context?: Context): any; | ||
/** | ||
* Synchronously evaluates the expression within an optional context. | ||
* @param context A mapping of variables to values, which will be | ||
* made accessible to the Jexl expression when evaluating it | ||
* @returns the result of the evaluation. | ||
* @throws on error | ||
*/ | ||
evalSync(context?: Context): any; | ||
/** | ||
* Get the abstract syntax tree that represents the compiled expression | ||
* @returns the abstract syntax tree | ||
*/ | ||
_getAst(): Ast; | ||
/** | ||
* Get the abstract syntax tree that represents the compiled expression | ||
* @returns the abstract syntax tree | ||
*/ | ||
_getAst(): Ast; | ||
} | ||
export default Expression; |
export type Element = | ||
| { type: 'dot' } | ||
| { type: 'openBracket' } | ||
| { type: 'closeBracket' } | ||
| { type: 'pipe' } | ||
| { type: 'openCurl' } | ||
| { type: 'closeCurl' } | ||
| { type: 'colon' } | ||
| { type: 'comma' } | ||
| { type: 'openParen' } | ||
| { type: 'closeParen' } | ||
| { type: 'question' } | ||
| { | ||
type: 'binaryOp'; | ||
precedence: number; | ||
eval?: (...args: unknown[]) => unknown; | ||
evalOnDemand?: (...args: unknown[]) => unknown; | ||
| { type: "dot" } | ||
| { type: "openBracket" } | ||
| { type: "closeBracket" } | ||
| { type: "pipe" } | ||
| { type: "openCurl" } | ||
| { type: "closeCurl" } | ||
| { type: "colon" } | ||
| { type: "comma" } | ||
| { type: "openParen" } | ||
| { type: "closeParen" } | ||
| { type: "question" } | ||
| { | ||
type: "binaryOp"; | ||
precedence: number; | ||
eval?: (...args: unknown[]) => unknown; | ||
evalOnDemand?: (...args: unknown[]) => unknown; | ||
}; | ||
export default interface Grammar { | ||
elements: { [symbol: string]: Element }; | ||
functions: { [name: string]: (...args: unknown[]) => unknown }; | ||
transform: { [name: string]: (...args: [unknown, ...unknown[]]) => unknown }; | ||
elements: { [symbol: string]: Element }; | ||
functions: { [name: string]: (...args: unknown[]) => unknown }; | ||
transform: { [name: string]: (...args: [unknown, ...unknown[]]) => unknown }; | ||
} |
@@ -7,4 +7,4 @@ // Type definitions for jexl 2.3 | ||
import Expression, { Context } from './Expression'; | ||
import Grammar from './Grammar'; | ||
import Expression, { Context } from "./Expression"; | ||
import Grammar from "./Grammar"; | ||
@@ -11,0 +11,0 @@ type TransformFunction = (value: any, ...args: any[]) => any; |
{ | ||
"name": "@types/jexl", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "TypeScript definitions for jexl", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jexl", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "8c86725e68cadc24a4469fac98b0191d0687d27b956a07455e09c3b3c2861f30", | ||
"typeScriptVersion": "4.0" | ||
"typesPublisherContentHash": "3539cccfefebce0821c682a18e2c4b134548e6ebf69638aa4fa34601777c7f3a", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 07 Jul 2022 21:02:20 GMT | ||
* Last updated: Fri, 15 Sep 2023 20:36:37 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11773