@monterosa/sdk-util 2.0.0-rc.1 → 2.0.0-rc.3
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/dist/checksum.d.ts +2 -0
- package/dist/emitter.d.ts +33 -3
- package/dist/error.d.ts +2 -2
- package/dist/fromentries.d.ts +3 -0
- package/dist/{index.cjs.js → index.cjs} +229 -275
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/{index.esm.js → index.js} +116 -27
- package/dist/index.js.map +1 -0
- package/dist/task-queue.d.ts +2 -0
- package/dist/time.d.ts +2 -0
- package/dist/uuid.d.ts +28 -0
- package/dist/with-retry-async.d.ts +9 -1
- package/package.json +18 -11
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
package/dist/checksum.d.ts
CHANGED
package/dist/emitter.d.ts
CHANGED
|
@@ -7,13 +7,43 @@
|
|
|
7
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
8
|
*/
|
|
9
9
|
type Handler = (...args: any[]) => void;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*
|
|
13
|
+
* Event emitter. Provides subscribe/unsubscribe pattern used throughout
|
|
14
|
+
* the SDK for observable state changes.
|
|
15
|
+
*/
|
|
10
16
|
export declare class Emitter {
|
|
11
|
-
private readonly
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
private readonly listeners;
|
|
18
|
+
/**
|
|
19
|
+
* Subscribes to an event.
|
|
20
|
+
*
|
|
21
|
+
* @param event - The event name
|
|
22
|
+
* @param handler - The callback function
|
|
23
|
+
* @returns A function that unsubscribes the handler when called
|
|
24
|
+
*/
|
|
14
25
|
on(event: string, handler: Handler): Unsubscribe;
|
|
26
|
+
/**
|
|
27
|
+
* Unsubscribes from an event.
|
|
28
|
+
*
|
|
29
|
+
* @param event - The event name
|
|
30
|
+
* @param handler - The handler to remove. If omitted, all handlers for the event are removed.
|
|
31
|
+
*/
|
|
15
32
|
off(event: string, handler?: Handler): void;
|
|
33
|
+
/**
|
|
34
|
+
* Emits an event with optional arguments.
|
|
35
|
+
*
|
|
36
|
+
* @param event - The event name
|
|
37
|
+
* @param args - Arguments to pass to handlers
|
|
38
|
+
*/
|
|
16
39
|
emit(event: string, ...args: any[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribes to an event and automatically unsubscribes after the first call.
|
|
42
|
+
*
|
|
43
|
+
* @param event - The event name
|
|
44
|
+
* @param handler - The callback function
|
|
45
|
+
* @returns A function that unsubscribes the handler when called
|
|
46
|
+
*/
|
|
17
47
|
once(event: string, handler: Handler): Unsubscribe;
|
|
18
48
|
}
|
|
19
49
|
/**
|
package/dist/error.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* MonterosaError extends the standard JavaScript `Error` object. It has
|
|
11
|
-
* an error code so that
|
|
12
|
-
* specific `name` "MonterosaError"
|
|
11
|
+
* an error code so that users can identify the error. It also has its
|
|
12
|
+
* own specific `name` "MonterosaError".
|
|
13
13
|
*/
|
|
14
14
|
export declare class MonterosaError extends Error {
|
|
15
15
|
/**
|
package/dist/fromentries.d.ts
CHANGED