diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index 256abf31b1..99ecf9d68e 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -2,9 +2,10 @@ // Project: https://mathjs.org/ // Definitions by: Ilya Shestakov , // Andy Patterson , -// Brad Besserman -// Pawel Krol -// Charlee Li +// Brad Besserman , +// Pawel Krol , +// Charlee Li , +// Mark Wiemer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -3072,6 +3073,7 @@ declare namespace math { isSymbolNode?: boolean; isUpdateNode?: boolean; comment?: string; + content?: MathNode; op?: string; fn?: string; args?: MathNode[]; diff --git a/types/mathjs/mathjs-tests.ts b/types/mathjs/mathjs-tests.ts index 5d94716104..bddb683df1 100644 --- a/types/mathjs/mathjs-tests.ts +++ b/types/mathjs/mathjs-tests.ts @@ -153,6 +153,12 @@ Expressions examples math.evaluate(['f = 3', 'g = 4', 'f * g']); } + // get content of a parenthesis node + { + const node = math.parse('(1)'); + const innerNode = node.content; + } + // scope can contain both variables and functions { const scope = { hello: (name: string) => `hello, ${name}!` };