Skip to content

Commit 0943f7e

Browse files
committed
Add array type definitions
1 parent 9e55ab1 commit 0943f7e

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

tools/docs/jsdoc/typedefs/arrays.js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,30 @@
4242
* @typedef {Array<number>} NumberArray
4343
*/
4444

45+
/**
46+
* A numeric array containing only positive values.
47+
*
48+
* @typedef {NumericArray} PositiveNumericArray
49+
*/
50+
51+
/**
52+
* A numeric array containing only negative values.
53+
*
54+
* @typedef {NumericArray} NegativeNumericArray
55+
*/
56+
57+
/**
58+
* A numeric array containing only non-positive values.
59+
*
60+
* @typedef {NumericArray} NonPositiveNumericArray
61+
*/
62+
63+
/**
64+
* A numeric array containing only non-negative values.
65+
*
66+
* @typedef {NumericArray} NonNegativeNumericArray
67+
*/
68+
4569
/**
4670
* A numeric array containing only integer values.
4771
*
@@ -51,25 +75,25 @@
5175
/**
5276
* An integer array containing only positive integer values.
5377
*
54-
* @typedef {IntegerArray)} PositiveIntegerArray
78+
* @typedef {IntegerArray} PositiveIntegerArray
5579
*/
5680

5781
/**
5882
* An integer array containing only negative integer values.
5983
*
60-
* @typedef {IntegerArray)} NegativeIntegerArray
84+
* @typedef {IntegerArray} NegativeIntegerArray
6185
*/
6286

6387
/**
6488
* An integer array containing only non-positive integer values.
6589
*
66-
* @typedef {IntegerArray)} NonPositiveIntegerArray
90+
* @typedef {IntegerArray} NonPositiveIntegerArray
6791
*/
6892

6993
/**
7094
* An integer array containing only nonnegative integer values.
7195
*
72-
* @typedef {IntegerArray)} NonNegativeIntegerArray
96+
* @typedef {IntegerArray} NonNegativeIntegerArray
7397
*/
7498

7599
/**
@@ -103,7 +127,7 @@
103127
*/
104128

105129
/**
106-
* A numeric array in which the sum of all elements is `1`.
130+
* A numeric array in which all elements are non-negative and the sum of all elements is `1`.
107131
*
108-
* @typedef {NumericArray} ProbabilityArray
132+
* @typedef {NonNegativeNumericArray} ProbabilityArray
109133
*/

0 commit comments

Comments
 (0)