@utiliread/http 1.13.0 → 1.13.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/dist/cjs/events.js.map +1 -1
- package/dist/esm/events.d.ts +5 -1
- package/dist/esm/events.js.map +1 -1
- package/package.json +1 -1
- package/src/events.ts +5 -1
package/dist/cjs/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AAuBtE,SAAgB,MAAM,CAClB,MAA2B,EAC3B,SAAkD;IAEpD,OAAO;QAAU,gBAAY;aAAZ,UAAY,EAAZ,qBAAY,EAAZ,IAAY;YAAZ,2BAAY;;QAC3B,IAAM,OAAO,GAAG,MAAM,eAAI,MAAM,CAAC,CAAC;QAClC,IAAM,MAAM,GAAG,SAAS,eAAI,MAAM,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,IAAI,OAAO,YAAY,6BAAc,IAAI,MAAM,CAAC,QAAQ,EAAE;YACxD,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACrC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAfD,wBAeC"}
|
package/dist/esm/events.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { HttpBuilder, Message } from "./http-builder";
|
|
1
|
+
import { HttpBuilder, HttpBuilderOfT, Message } from "./http-builder";
|
|
2
2
|
import { HttpResponse } from "./http-response";
|
|
3
3
|
interface Events {
|
|
4
4
|
sent: (response: HttpResponse, request: Message) => void | Promise<void>;
|
|
5
5
|
}
|
|
6
|
+
interface EventsOfT<T> extends Events {
|
|
7
|
+
received: (response: HttpResponse, request: Message, value: T) => void | Promise<void>;
|
|
8
|
+
}
|
|
6
9
|
export declare function events<B extends HttpBuilder, P extends any[]>(action: (...params: P) => B, configure: (...params: P) => Partial<Events>): (...params: P) => B;
|
|
10
|
+
export declare function events<B extends HttpBuilderOfT<T>, P extends any[], T>(action: (...params: P) => B, configure: (...params: P) => Partial<EventsOfT<T>>): (...params: P) => B;
|
|
7
11
|
export {};
|
package/dist/esm/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAW,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAW,MAAM,gBAAgB,CAAC;AAuBtE,MAAM,UAAU,MAAM,CAClB,MAA2B,EAC3B,SAAkD;IAEpD,OAAO;QAAU,gBAAY;aAAZ,UAAY,EAAZ,qBAAY,EAAZ,IAAY;YAAZ,2BAAY;;QAC3B,IAAM,OAAO,GAAG,MAAM,eAAI,MAAM,CAAC,CAAC;QAClC,IAAM,MAAM,GAAG,SAAS,eAAI,MAAM,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC7B;QACD,IAAI,OAAO,YAAY,cAAc,IAAI,MAAM,CAAC,QAAQ,EAAE;YACxD,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACrC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/events.ts
CHANGED
|
@@ -20,7 +20,11 @@ export function events<B extends HttpBuilder, P extends any[]>(
|
|
|
20
20
|
export function events<B extends HttpBuilderOfT<T>, P extends any[], T>(
|
|
21
21
|
action: (...params: P) => B,
|
|
22
22
|
configure: (...params: P) => Partial<EventsOfT<T>>
|
|
23
|
-
): (...params: P) => B
|
|
23
|
+
): (...params: P) => B;
|
|
24
|
+
export function events<B extends HttpBuilderOfT<T>, P extends any[], T>(
|
|
25
|
+
action: (...params: P) => B,
|
|
26
|
+
configure: (...params: P) => Partial<EventsOfT<T>>
|
|
27
|
+
): (...params: P) => B {
|
|
24
28
|
return function (...params: P) {
|
|
25
29
|
const builder = action(...params);
|
|
26
30
|
const events = configure(...params);
|