@whitewall/blip-sdk 0.0.152 → 0.0.154
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/types/sender/enveloperesolver.d.ts +2 -2
- package/dist/types/sender/enveloperesolver.d.ts.map +1 -1
- package/dist/types/types/commons.d.ts +6 -5
- package/dist/types/types/commons.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/sender/enveloperesolver.ts +2 -2
- package/src/types/commons.ts +2 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Envelope, type
|
|
1
|
+
import { type Envelope, type Json, type MaybePromise, type Notification, type UnknownCommand, type UnknownMessage } from '../types/index.ts';
|
|
2
2
|
import type { OpenConnectionSender } from './sender.ts';
|
|
3
3
|
export type EventMap = {
|
|
4
4
|
message: (message: UnknownMessage) => MaybePromise<void>;
|
|
5
|
-
command: (command: UnknownCommand) => MaybePromise<string |
|
|
5
|
+
command: (command: UnknownCommand) => MaybePromise<string | Json> | MaybePromise<void>;
|
|
6
6
|
notification: (notification: Notification) => MaybePromise<void>;
|
|
7
7
|
};
|
|
8
8
|
export type Listener<K extends keyof EventMap> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enveloperesolver.d.ts","sourceRoot":"","sources":["../../../src/sender/enveloperesolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,
|
|
1
|
+
{"version":3,"file":"enveloperesolver.d.ts","sourceRoot":"","sources":["../../../src/sender/enveloperesolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,QAAQ,EAEb,KAAK,IAAI,EACT,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EAItB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,MAAM,MAAM,QAAQ,GAAG;IACnB,OAAO,EA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CAAC,MAAM,EAAE,MAAM;IAM5C,OAAO,CAAC,uBAAuB;YAajB,IAAI;CAcrB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export type Json = string | number | boolean | null | Array<Json> | {
|
|
2
|
+
[key: string]: Json;
|
|
3
|
+
};
|
|
4
|
+
export type JsonObject = {
|
|
5
|
+
[key: string]: Json;
|
|
6
|
+
};
|
|
6
7
|
export type MaybePromise<T> = T | Promise<T>;
|
|
7
8
|
//# sourceMappingURL=commons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../../src/types/commons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commons.d.ts","sourceRoot":"","sources":["../../../src/types/commons.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAC3F,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAChD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
type CommonNotification,
|
|
3
3
|
type Envelope,
|
|
4
4
|
type FailedNotification,
|
|
5
|
-
type
|
|
5
|
+
type Json,
|
|
6
6
|
type MaybePromise,
|
|
7
7
|
Node,
|
|
8
8
|
type Notification,
|
|
@@ -18,7 +18,7 @@ import type { OpenConnectionSender } from './sender.ts'
|
|
|
18
18
|
|
|
19
19
|
export type EventMap = {
|
|
20
20
|
message: (message: UnknownMessage) => MaybePromise<void>
|
|
21
|
-
command: (command: UnknownCommand) => MaybePromise<string |
|
|
21
|
+
command: (command: UnknownCommand) => MaybePromise<string | Json> | MaybePromise<void>
|
|
22
22
|
notification: (notification: Notification) => MaybePromise<void>
|
|
23
23
|
}
|
|
24
24
|
|
package/src/types/commons.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type JsonValue<
|
|
4
|
-
D extends number = 8, // max depth
|
|
5
|
-
A extends Array<0> = [], // accumulator
|
|
6
|
-
> =
|
|
7
|
-
| null
|
|
8
|
-
| boolean
|
|
9
|
-
| number
|
|
10
|
-
| string
|
|
11
|
-
| (A['length'] extends D ? unknown : Array<JsonValue<D, [0, ...A]>>) // arrays
|
|
12
|
-
| (A['length'] extends D ? unknown : { [k: string]: JsonValue<D, [0, ...A]> }) // objects
|
|
13
|
-
|
|
14
|
-
export type JsonObject = Record<string, JsonValue>
|
|
15
|
-
|
|
1
|
+
export type Json = string | number | boolean | null | Array<Json> | { [key: string]: Json }
|
|
2
|
+
export type JsonObject = { [key: string]: Json }
|
|
16
3
|
export type MaybePromise<T> = T | Promise<T>
|