mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
Whoops change types to how mathjs actually works
This commit is contained in:
parent
be97efa9a0
commit
fcabc9722b
2
types/index.d.ts
vendored
2
types/index.d.ts
vendored
@ -2204,7 +2204,6 @@ declare namespace math {
|
||||
* when number is > 1.
|
||||
*/
|
||||
pickRandom<T>(array: T[]): T
|
||||
pickRandom<T>(array: T[], number: 1, weights?: number[]): T
|
||||
pickRandom<T>(array: T[], number: number): T[]
|
||||
pickRandom<T>(array: T[], number: number, weights: number[]): T[]
|
||||
|
||||
@ -5525,7 +5524,6 @@ declare namespace math {
|
||||
* @param weights An array of ints or floats
|
||||
*/
|
||||
pickRandom<T>(array: T[]): MathJsChain<T>
|
||||
pickRandom<T>(array: T[], number: 1, weights?: number[]): MathJsChain<T>
|
||||
pickRandom<T>(array: T[], number: number): MathJsChain<T[]>
|
||||
pickRandom<T>(array: T[], number: number, weights: number[]): MathJsChain<T[]>
|
||||
|
||||
|
||||
@ -2256,7 +2256,7 @@ Random examples
|
||||
expectTypeOf(math.pickRandom(['a', { b: 10 }, 42])).toMatchTypeOf<
|
||||
string | number | { b: number }
|
||||
>()
|
||||
expectTypeOf(math.pickRandom([1, 2, 3], 1)).toMatchTypeOf<number>()
|
||||
expectTypeOf(math.pickRandom([1, 2, 3])).toMatchTypeOf<number>()
|
||||
expectTypeOf(math.pickRandom([1, 2, 3], 2)).toMatchTypeOf<number[]>()
|
||||
|
||||
expectTypeOf(math.chain().pickRandom([1, 2, 3], 2)).toMatchTypeOf<MathJsChain<number[]>>()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user