@popclip/types 1.4688.0 → 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/README.md CHANGED
@@ -3,3 +3,8 @@
3
3
  Typescript definitions for PopClip Extensions.
4
4
 
5
5
  Published to NPM as `@popclip/types`.
6
+
7
+ To bum npm version, check in first, then bump:
8
+
9
+ npm version [<version>|patch]
10
+ npm publish
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popclip/types",
3
- "version": "1.4688.0",
3
+ "version": "1.4892.0",
4
4
  "devDependencies": {
5
5
  "typedoc": "0.25.13",
6
6
  "typescript": "5.4.5"
package/popclip.d.ts CHANGED
@@ -476,7 +476,7 @@ interface Extension<CustomOptions = Options> extends ActionProperties {
476
476
  /**
477
477
  * Exported test function for use during development.
478
478
  */
479
- test: TestFunction;
479
+ test?: TestFunction;
480
480
 
481
481
  // the following are static properties, included for the benefit of the JSON Scheme generation
482
482
  popclipVersion?: number;
@@ -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".