dev-classes 1.3.4 → 1.3.6
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResolveRequestInServer_P } from './deps/apiRequest/apiRequest';
|
|
1
|
+
import { FetchInfo, HTTPSApi_Events, RequestPayloadHTTPSApi } from './HTTPSApi.types';
|
|
3
2
|
|
|
4
3
|
export declare class HTTPSApi {
|
|
5
4
|
private static state;
|
|
@@ -15,6 +14,6 @@ export declare class HTTPSApi {
|
|
|
15
14
|
static init: () => void;
|
|
16
15
|
static on: <K extends "fetch">(name: K, cb: HTTPSApi_Events[K]) => void;
|
|
17
16
|
static off: <K extends "fetch">(name: K, cb: HTTPSApi_Events[K]) => void;
|
|
18
|
-
static request<Result, Req extends RequestPayloadHTTPSApi = RequestPayloadHTTPSApi>({ keyAction, request }: Req): Promise<
|
|
17
|
+
static request<Result, Req extends RequestPayloadHTTPSApi = RequestPayloadHTTPSApi>({ keyAction, request }: Req): Promise<FetchInfo<Result>>;
|
|
19
18
|
static removeCookie(): void;
|
|
20
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchCommonApiRequest, RejectRequestInServer_P, RequestOptions_P } from './deps/apiRequest/apiRequest';
|
|
1
|
+
import { FetchCommonApiRequest, RejectRequestInServer_P, RequestOptions_P, ResolveRequestInServer_P } from './deps/apiRequest/apiRequest';
|
|
2
2
|
|
|
3
3
|
export interface FetchCommonPayloadHTTPSApi extends FetchCommonApiRequest, Pick<RejectRequestInServer_P, 'isErr'> {
|
|
4
4
|
isReq: boolean;
|
|
@@ -13,8 +13,9 @@ export interface RequestPayloadHTTPSApi {
|
|
|
13
13
|
url: string;
|
|
14
14
|
} & RequestOptions_P;
|
|
15
15
|
}
|
|
16
|
+
export type FetchInfo<Result = any> = FetchCommonPayloadHTTPSApi & Pick<RejectRequestInServer_P, 'msg'> | FetchCommonPayloadHTTPSApi & Pick<RejectRequestInServer_P, 'msg'> & ResolveRequestInServer_P<Result> | ResponseErrorHTTPSApi;
|
|
16
17
|
export interface HTTPSApi_Events {
|
|
17
|
-
fetch(info:
|
|
18
|
+
fetch(info: FetchInfo): void;
|
|
18
19
|
}
|
|
19
20
|
declare global {
|
|
20
21
|
interface Window {
|