@hyperttp/core 1.0.2 → 1.0.4
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/options.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from "./http.js";
|
|
2
2
|
import type { NetworkOptions } from "./network.js";
|
|
3
|
+
import type { HyperPlugin } from "./plugins.js";
|
|
3
4
|
export interface HyperttpPluginsExtension {
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
@@ -34,7 +35,7 @@ export interface BaseHttpClientOptions {
|
|
|
34
35
|
* @ru Список явно подключенных плагинов (готовые объекты или строки с именами npm-пакетов)
|
|
35
36
|
* @en List of explicitly registered plugins (direct objects or npm package name strings)
|
|
36
37
|
*/
|
|
37
|
-
plugins?:
|
|
38
|
+
plugins?: (HyperPlugin | string)[];
|
|
38
39
|
trackMetrics?: any;
|
|
39
40
|
}
|
|
40
41
|
export type HttpClientOptions = BaseHttpClientOptions & HyperttpPluginsExtension;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEpE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC;IAEnC,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GACnD,wBAAwB,CAAC"}
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HyperCore } from "../Core/HyperCore.js";
|
|
2
|
-
import { HttpClientOptions } from "./options.js";
|
|
1
|
+
import type { HyperCore } from "../Core/HyperCore.js";
|
|
2
|
+
import type { HttpClientOptions } from "./options.js";
|
|
3
3
|
/**
|
|
4
4
|
* @ru
|
|
5
5
|
* Фазы жизненного цикла запроса (выполняются строго по очереди от начала до отправки).
|
|
@@ -26,10 +26,10 @@ export type PluginPhase = /**
|
|
|
26
26
|
* @ru Отправка. Низкоуровневый fetch, работа через прокси или утилиты обхода (Zapret, Xray).
|
|
27
27
|
* @en Dispatching. Low-level fetch operations, proxy routing, or bypass utilities (Zapret, Xray).
|
|
28
28
|
*/ | "NETWORK";
|
|
29
|
-
export interface HyperPlugin {
|
|
29
|
+
export interface HyperPlugin<T extends HyperCore = HyperCore> {
|
|
30
30
|
name: string;
|
|
31
31
|
phase: PluginPhase;
|
|
32
32
|
enabled: (config: HttpClientOptions) => boolean;
|
|
33
|
-
apply: (client: HyperCore, config: HttpClientOptions) =>
|
|
33
|
+
apply: (client: HyperCore, config: HttpClientOptions) => T;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/types/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/types/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GACnB;;;GAGC,CACH,OAAO,CAAC;;;GAGL,GACD,SAAS,CAAC;;;GAGT,GACD,SAAS,CAAC;;;GAGT,GACD,QAAQ,CAAC;;;GAGR,GACD,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC;IAChD,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,KAAK,CAAC,CAAC;CAC5D"}
|