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 188188189189190190191+ 191192
192193# Generated by tools/update-authors.js
Original file line number Diff line number Diff line change @@ -3181,7 +3181,7 @@ declare namespace math {
31813181 * @param object An object with functions to be imported.
31823182 * @param options An object with import options.
31833183 */
3184- import ( object : ImportObject | ImportObject [ ] , options : ImportOptions ) : void
3184+ import ( object : ImportObject | ImportObject [ ] , options ? : ImportOptions ) : void
31853185 }
31863186
31873187 /*************************************************************************
Original file line number Diff line number Diff line change @@ -894,7 +894,65 @@ declare module 'mathjs' {
894894
895895 math . testFun ( )
896896
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 > ( )
898956}
899957
900958/*
@@ -1174,3 +1232,20 @@ Probability function examples
11741232 math . lgamma ( math . complex ( 1.5 , - 1.5 ) )
11751233 ) . toMatchTypeOf < math . Complex > ( )
11761234}
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