diff --git a/expr-eval/index.d.ts b/expr-eval/index.d.ts index 7f72eb6101..cab8333186 100644 --- a/expr-eval/index.d.ts +++ b/expr-eval/index.d.ts @@ -3,35 +3,29 @@ // Definitions by: Connor Peet // 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; +}