mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Fix tests
This commit is contained in:
Vendored
+6
-1
@@ -2578,7 +2578,8 @@ declare namespace math {
|
||||
* @param object An object with functions to be imported.
|
||||
* @param options An object with import options.
|
||||
*/
|
||||
import(object: object | Array<object>, options: ImportOptions);
|
||||
import(object: ImportObject | ImportObject[], options: ImportOptions): void;
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/**
|
||||
* It may not exists - this is _only_ for import functionality.
|
||||
@@ -4561,4 +4562,8 @@ declare namespace math {
|
||||
silent?: boolean;
|
||||
wrap?: boolean;
|
||||
}
|
||||
|
||||
interface ImportObject {
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,3 +392,21 @@ JSON serialization/deserialization
|
||||
const parsed = JSON.parse(stringified, math.json.reviver);
|
||||
parsed.bigNumber === math.bignumber('1.5'); // true
|
||||
}
|
||||
|
||||
/*
|
||||
Extend functionality with import
|
||||
*/
|
||||
{
|
||||
const testFun = function() {
|
||||
return 5;
|
||||
};
|
||||
|
||||
math.import({
|
||||
testFun,
|
||||
value: 10
|
||||
}, {});
|
||||
|
||||
math.testFun();
|
||||
|
||||
const a = math.value * 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user