File tree Expand file tree Collapse file tree 3 files changed +78
-2
lines changed Expand file tree Collapse file tree 3 files changed +78
-2
lines changed Original file line number Diff line number Diff line change 188
188
189
189
190
190
191
+
191
192
192
193
# Generated by tools/update-authors.js
Original file line number Diff line number Diff line change @@ -3181,7 +3181,7 @@ declare namespace math {
3181
3181
* @param object An object with functions to be imported.
3182
3182
* @param options An object with import options.
3183
3183
*/
3184
- import ( object : ImportObject | ImportObject [ ] , options : ImportOptions ) : void
3184
+ import ( object : ImportObject | ImportObject [ ] , options ? : ImportOptions ) : void
3185
3185
}
3186
3186
3187
3187
/*************************************************************************
Original file line number Diff line number Diff line change @@ -894,7 +894,65 @@ declare module 'mathjs' {
894
894
895
895
math . testFun ( )
896
896
897
- const _a = math . value * 2
897
+ expectTypeOf ( math . testFun ( ) ) . toMatchTypeOf < number > ( )
898
+
899
+ expectTypeOf (
900
+ math . import ( {
901
+ myvalue : 42 ,
902
+ myFunc : ( name : string ) => `myFunc ${ name } ` ,
903
+ } )
904
+ ) . toMatchTypeOf < void > ( )
905
+
906
+ expectTypeOf (
907
+ math . import (
908
+ {
909
+ myvalue : 42 ,
910
+ myFunc : ( name : string ) => `myFunc ${ name } ` ,
911
+ } ,
912
+ {
913
+ override : true ,
914
+ }
915
+ )
916
+ ) . toMatchTypeOf < void > ( )
917
+
918
+ expectTypeOf (
919
+ math . import (
920
+ {
921
+ myvalue2 : 42 ,
922
+ } ,
923
+ {
924
+ silent : true ,
925
+ }
926
+ )
927
+ ) . toMatchTypeOf < void > ( )
928
+
929
+ expectTypeOf (
930
+ math . import (
931
+ {
932
+ myvalue3 : 42 ,
933
+ } ,
934
+ {
935
+ wrap : true ,
936
+ }
937
+ )
938
+ ) . toMatchTypeOf < void > ( )
939
+
940
+ expectTypeOf (
941
+ math . import ( {
942
+ myvalue4 : 42 ,
943
+ } )
944
+ ) . toMatchTypeOf < void > ( )
945
+
946
+ expectTypeOf (
947
+ math . import ( [
948
+ {
949
+ myvalue5 : 42 ,
950
+ } ,
951
+ {
952
+ myFunc2 : ( name : string ) => `myFunc2 ${ name } ` ,
953
+ } ,
954
+ ] )
955
+ ) . toMatchTypeOf < void > ( )
898
956
}
899
957
900
958
/*
@@ -1174,3 +1232,20 @@ Probability function examples
1174
1232
math . lgamma ( math . complex ( 1.5 , - 1.5 ) )
1175
1233
) . toMatchTypeOf < math . Complex > ( )
1176
1234
}
1235
+
1236
+ /*
1237
+ toTex examples
1238
+ */
1239
+
1240
+ {
1241
+ const math = create ( all , { } )
1242
+
1243
+ expectTypeOf ( math . parse ( 'a/b' ) . toTex ( ) ) . toMatchTypeOf < string > ( )
1244
+
1245
+ // TODO add proper types for toTex options
1246
+ expectTypeOf (
1247
+ math . parse ( 'a/b' ) . toTex ( {
1248
+ a : '123' ,
1249
+ } )
1250
+ ) . toMatchTypeOf < string > ( )
1251
+ }
You can’t perform that action at this time.
0 commit comments