@popclip/types 1.4688.1 → 1.4892.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/popclip.d.ts +13 -0
package/package.json
CHANGED
package/popclip.d.ts
CHANGED
|
@@ -1137,6 +1137,19 @@ interface Util {
|
|
|
1137
1137
|
| BigUint64Array,
|
|
1138
1138
|
): void;
|
|
1139
1139
|
|
|
1140
|
+
/**
|
|
1141
|
+
* Generate a random integer in range [0, max] with uniform distribution using a cryptographically secure random source.
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
*
|
|
1145
|
+
* ```js
|
|
1146
|
+
* const coinFlip = util.randomUniform(1); // coinFlip has value 0 or 1
|
|
1147
|
+
* const dieRoll = util.randomUniform(5) + 1; // dieRoll has value from 1 to 6
|
|
1148
|
+
* ```
|
|
1149
|
+
* @param max Maximum value to generate. Supplied value will be coerced to a 32-bit unsigned integer.
|
|
1150
|
+
*/
|
|
1151
|
+
randomUniform(max: number): number;
|
|
1152
|
+
|
|
1140
1153
|
/**
|
|
1141
1154
|
* Generate a RFC 4122 version 4 UUID using a cryptographically secure random number generator.
|
|
1142
1155
|
* @returns UUID string such as "e621e1f8-c36c-495a-93fc-0c247a3e6e5f".
|