@popclip/types 1.4624.2 → 1.4636.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popclip/types",
3
- "version": "1.4624.2",
3
+ "version": "1.4636.1",
4
4
  "devDependencies": {
5
5
  "typedoc": "0.25.13",
6
6
  "typescript": "5.4.5"
package/popclip.d.ts CHANGED
@@ -554,13 +554,13 @@ interface MultipleOption extends OptionBase {
554
554
  /**
555
555
  * The possible values for a `multiple` option.
556
556
  */
557
- readonly values?: string[];
557
+ readonly values?: readonly string[];
558
558
 
559
559
  /**
560
560
  * Display names corresponding to the entries in the {@link values} array. These are shown in the option UI.
561
561
  * If ommitted, the raw value strings are shown instead.
562
562
  */
563
- readonly valueLabels?: LocalizableString[];
563
+ readonly valueLabels?: readonly LocalizableString[];
564
564
  }
565
565
 
566
566
  /**
@@ -1129,6 +1129,22 @@ interface Util {
1129
1129
  | BigUint64Array,
1130
1130
  ): void;
1131
1131
 
1132
+ /**
1133
+ * Generate a RFC 4122 version 4 UUID using a cryptographically secure random number generator.
1134
+ * @returns UUID string such as "e621e1f8-c36c-495a-93fc-0c247a3e6e5f".
1135
+ */
1136
+ randomUuid(): string;
1137
+
1138
+ /**
1139
+ * Generate hash-based message authentication code (HMAC) using the supplied data, key and algorithm.
1140
+ * Implemented internally by Apple's CommonCrypto.
1141
+ */
1142
+ hmac(
1143
+ data: Uint8Array,
1144
+ key: Uint8Array,
1145
+ algorithm: "sha1" | "md5" | "sha256" | "sha384" | "sha512" | "sha224",
1146
+ ): Uint8Array;
1147
+
1132
1148
  /**
1133
1149
  * The `constant` property is a container for pre-defined constants.
1134
1150
  */
@@ -1,32 +0,0 @@
1
- /* Declare ambient module + exports for CommonJS-style exporting */
2
- declare const module: { exports: any };
3
- declare const exports: any;
4
-
5
- /**
6
- * Import an object from another file.
7
- *
8
- * #### Notes
9
- *
10
- * PopClip's `require()` implementation attempts to import from the following module formats:
11
- *
12
- * - AMD modules, which use `define(...)`.
13
- * - CommonJS modules, which use `module.exports = ...` or `exports.name = ...`
14
- * - TypeScript-compiled ES modules, which use `exports.default = ...`
15
- *
16
- * #### Notes
17
- *
18
- * Paths beginning with `./` or `../` are resolved relative to the the location of the current file.
19
- *
20
- * Otherwise, the path is resolved relative to the extensions's package root.
21
- * If there is no file in the extension, PopClip will look in its internal module repository.
22
- *
23
- * If no file extension is given, PopCLip will try adding the extensions `.js`, `.ts`, `.json` in that order.
24
- *
25
- * TypeScript files are transpiled to JavaScript on the fly.
26
- *
27
- * JSON files are parsed and returned as an object.å
28
- *
29
- * @param file Path to the file to import.
30
- * @return The imported object.
31
- */
32
- declare function require(file: string): object;
package/extra/shims.d.ts DELETED
@@ -1,20 +0,0 @@
1
- /* WebAPI and Node.js Globals
2
- * The following functions and objects are available in PopClip via polyfills.
3
- * TODO: Not sure how to improve typings for these?
4
- */
5
-
6
- // these are from WebAPI, and are implemented in PopClip with polyfills from `core-js` library
7
- declare function btoa(string: string): string;
8
- declare function atob(string: string): string;
9
- declare function structuredClone<T>(value: T): T;
10
- declare const URL: any;
11
- declare const URLSearchParams: any;
12
-
13
- // XMLHttpRequest is implemented natively in PopClip
14
- declare const XMLHttpRequest: any;
15
-
16
- // Blob is is a WebAPI object, implemented in PopClip with 'node-blob` library
17
- declare const Blob: any;
18
-
19
- // Buffer is a node.js object, implemented in PopClip with 'buffer' library
20
- declare const Buffer: any;
@@ -1,27 +0,0 @@
1
- /**
2
- * Call a function after a specified time interval.
3
- *
4
- * #### Notes
5
- *
6
- * This is PopClip's own implementation of the standard
7
- * [setTimeout](http://developer.mozilla.org/en-US/docs/Web/API/SetTimeout) function,
8
- * as found in browsers.
9
- * Ordinarily you shouldn't need to use this. It is is mainly included for
10
- * compatibility with libraries that might need it.
11
- *
12
- * @param callback A function to be called after the timer expires.
13
- * @param timeout Timeout in milliseconds. If this parameter is omitted, a value of 0 is used,
14
- * @param args Additional arguments to be passed to the callback function.
15
- * @returns Numeric identifier for the timer which can be passed to {@link clearTimeout} to cancel it.
16
- */
17
- declare function setTimeout(
18
- callback: (...args: any) => void,
19
- timeout?: number,
20
- ...args: any
21
- ): number;
22
-
23
- /**
24
- * Cancels a timeout prevouly created with {@link setTimeout}.
25
- * @param timeoutId Identifier of the timeout to cancel.
26
- */
27
- declare function clearTimeout(timeoutId: number): void;