Merge pull request #13914 from DefinitelyTyped/lint_expr_eval

Update expr-eval for new linter
This commit is contained in:
Sheetal Nandi
2017-01-10 12:45:10 -08:00
committed by GitHub
+23 -29
View File
@@ -3,35 +3,29 @@
// Definitions by: Connor Peet <https://github.com/connor4312>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace exprEval {
type Value = number
| string
| ((...args: Value[]) => Value)
| { [propertyName: string]: Value };
type Value = number
| string
| ((...args: Value[]) => Value)
| { [propertyName: string]: Value };
interface Values {
[propertyName: string]: Value;
}
export class Parser {
constructor(options?: { allowMemberAccess?: boolean });
parse(expression: string): Expression;
evaluate(expression: string, values?: Value): number;
// todo(connor4312): tslint is disabled on the following two lines, as
// thinks that the above instance methods are overloads for the static methods.
static parse(expression: string): Expression; // tslint:disable-line
static evaluate(expression: string, values?: Value): number; // tslint:disable-line
}
export interface Expression {
simplify(values?: Values): Expression;
evaluate(values?: Values): number;
substitute(values: Values): Expression;
symbols(): string[];
variables(): string[];
toJSFunction(params: string, values?: Values): (...args: Value[]) => number;
}
interface Values {
[propertyName: string]: Value;
}
export = exprEval;
export class Parser {
constructor(options?: { allowMemberAccess?: boolean });
parse(expression: string): Expression;
evaluate(expression: string, values?: Values): number;
static parse(expression: string): Expression;
static evaluate(expression: string, values?: Values): number;
}
export interface Expression {
simplify(values?: Values): Expression;
evaluate(values?: Values): number;
substitute(values: Values): Expression;
symbols(): string[];
variables(): string[];
toJSFunction(params: string, values?: Values): (...args: Value[]) => number;
}