mphttpx 1.0.4 → 1.0.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,39 +0,0 @@
1
- import { BlobP } from "./BlobP";
2
- declare const state: unique symbol;
3
- export { state as formDataState };
4
- export declare class FormDataP implements FormData {
5
- constructor(form?: HTMLFormElement, submitter?: HTMLElement | null);
6
- [state]: FormDataState;
7
- append(name: string, value: string | Blob, filename?: string): void;
8
- delete(name: string): void;
9
- get(name: string): FormDataEntryValue | null;
10
- getAll(name: string): FormDataEntryValue[];
11
- has(name: string): boolean;
12
- set(name: string, value: string | Blob, filename?: string): void;
13
- forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
14
- entries(): ArrayIterator<[string, FormDataEntryValue]>;
15
- keys(): ArrayIterator<string>;
16
- values(): ArrayIterator<FormDataEntryValue>;
17
- [Symbol.iterator](): ArrayIterator<[string, FormDataEntryValue]>;
18
- toString(): string;
19
- get isPolyfill(): {
20
- symbol: symbol;
21
- hierarchy: string[];
22
- };
23
- }
24
- declare const _formData: unique symbol;
25
- declare class FormDataState {
26
- [_formData]: [string, FormDataEntryValue][];
27
- toBlob(): BlobP;
28
- }
29
- /**
30
- * Parses multipart/form-data binary data, supporting restoration of text fields and files
31
- * @param body - Text in multipart/form-data format (including boundaries and data)
32
- * @returns Parsed FormData object (text fields as strings, files as File objects)
33
- */
34
- export declare function createFormDataFromBody(body: string, errMsg?: string): FormDataP;
35
- declare const FormDataE: {
36
- new (form?: HTMLFormElement, submitter?: HTMLElement | null): FormData;
37
- prototype: FormData;
38
- };
39
- export { FormDataE as FormData };
@@ -1,33 +0,0 @@
1
- declare const state: unique symbol;
2
- export declare class HeadersP implements Headers {
3
- constructor(init?: HeadersInit);
4
- [state]: HeadersState;
5
- append(name: string, value: string): void;
6
- delete(name: string): void;
7
- get(name: string): string | null;
8
- getSetCookie(): string[];
9
- has(name: string): boolean;
10
- set(name: string, value: string): void;
11
- forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
12
- entries(): MapIterator<[string, string]>;
13
- keys(): ArrayIterator<string>;
14
- values(): ArrayIterator<string>;
15
- [Symbol.iterator](): MapIterator<[string, string]>;
16
- toString(): string;
17
- get isPolyfill(): {
18
- symbol: symbol;
19
- hierarchy: string[];
20
- };
21
- }
22
- declare const _headersMap: unique symbol;
23
- declare class HeadersState {
24
- [_headersMap]: Map<string, [string, string]>;
25
- }
26
- export declare function normalizeName(name: string, kind?: string): string;
27
- export declare function normalizeValue(value: string): string;
28
- export declare function parseHeaders(rawHeaders: string): HeadersP;
29
- declare const HeadersE: {
30
- new (init?: HeadersInit): Headers;
31
- prototype: Headers;
32
- };
33
- export { HeadersE as Headers };
@@ -1,26 +0,0 @@
1
- import { EventP } from "./EventP";
2
- import { EventTargetP } from "./EventTargetP";
3
- declare const state: unique symbol;
4
- export declare class ProgressEventP extends EventP implements ProgressEvent {
5
- constructor(type: string, eventInitDict?: ProgressEventInit);
6
- [state]: ProgressEventState;
7
- get lengthComputable(): boolean;
8
- get loaded(): number;
9
- get total(): number;
10
- toString(): string;
11
- get isPolyfill(): {
12
- symbol: symbol;
13
- hierarchy: string[];
14
- };
15
- }
16
- declare class ProgressEventState {
17
- lengthComputable: boolean | (() => boolean);
18
- loaded: number | (() => number);
19
- total: number | (() => number);
20
- }
21
- export declare function emitProcessEvent(target: EventTargetP, type: string, loaded?: number | (() => number), total?: number | (() => number)): void;
22
- declare const ProgressEventE: {
23
- new (type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
24
- prototype: ProgressEvent;
25
- };
26
- export { ProgressEventE as ProgressEvent };
@@ -1,45 +0,0 @@
1
- import { BodyP } from "./BodyP";
2
- declare const state: unique symbol;
3
- export declare class RequestP extends BodyP implements Request {
4
- constructor(input: RequestInfo | URL, init?: RequestInit);
5
- [state]: RequestState;
6
- get cache(): RequestCache;
7
- get credentials(): RequestCredentials;
8
- get destination(): RequestDestination;
9
- get headers(): Headers;
10
- get integrity(): string;
11
- get keepalive(): boolean;
12
- get method(): string;
13
- get mode(): RequestMode;
14
- get redirect(): RequestRedirect;
15
- get referrer(): string;
16
- get referrerPolicy(): ReferrerPolicy;
17
- get signal(): AbortSignal;
18
- get url(): string;
19
- clone(): Request;
20
- toString(): string;
21
- get isPolyfill(): {
22
- symbol: symbol;
23
- hierarchy: string[];
24
- };
25
- }
26
- declare class RequestState {
27
- cache: RequestCache;
28
- credentials: RequestCredentials;
29
- destination: RequestDestination;
30
- headers?: Headers;
31
- integrity: string;
32
- keepalive: boolean;
33
- method: string;
34
- mode: RequestMode;
35
- redirect: RequestRedirect;
36
- referrer: string;
37
- referrerPolicy: ReferrerPolicy;
38
- signal?: AbortSignal;
39
- url: string;
40
- }
41
- declare const RequestE: {
42
- new (input: RequestInfo | URL, init?: RequestInit): Request;
43
- prototype: Request;
44
- };
45
- export { RequestE as Request };
@@ -1,40 +0,0 @@
1
- import { BodyP } from "./BodyP";
2
- declare const state: unique symbol;
3
- export { state as responseState };
4
- export declare class ResponseP extends BodyP implements Response {
5
- constructor(body?: BodyInit | null, init?: ResponseInit);
6
- [state]: ResponseState;
7
- get headers(): Headers;
8
- get ok(): boolean;
9
- get redirected(): boolean;
10
- get status(): number;
11
- get statusText(): string;
12
- get type(): ResponseType;
13
- get url(): string;
14
- clone(): Response;
15
- static json(data: any, init?: ResponseInit): Response;
16
- static error(): ResponseP;
17
- static redirect(url: string | URL, status?: number): Response;
18
- toString(): string;
19
- get isPolyfill(): {
20
- symbol: symbol;
21
- hierarchy: string[];
22
- };
23
- }
24
- declare class ResponseState {
25
- headers?: Headers;
26
- ok: boolean;
27
- redirected: boolean;
28
- status: number;
29
- statusText: string;
30
- type: ResponseType;
31
- url: string;
32
- }
33
- declare const ResponseE: {
34
- new (body?: BodyInit | null, init?: ResponseInit): Response;
35
- prototype: Response;
36
- error(): Response;
37
- json(data: any, init?: ResponseInit): Response;
38
- redirect(url: string | URL, status?: number): Response;
39
- };
40
- export { ResponseE as Response };
@@ -1,33 +0,0 @@
1
- declare const state: unique symbol;
2
- export declare class TextDecoderP implements TextDecoder {
3
- constructor(utfLabel?: string, { fatal, ignoreBOM }?: {
4
- fatal?: boolean | undefined;
5
- ignoreBOM?: boolean | undefined;
6
- });
7
- [state]: TextDecoderState;
8
- get encoding(): string;
9
- get fatal(): boolean;
10
- get ignoreBOM(): boolean;
11
- decode(buffer?: TAllowSharedBufferSource, { stream }?: {
12
- stream?: boolean | undefined;
13
- }): string;
14
- toString(): string;
15
- get isPolyfill(): {
16
- symbol: symbol;
17
- hierarchy: string[];
18
- };
19
- }
20
- declare const _bomSeen: unique symbol;
21
- declare const _partial: unique symbol;
22
- declare class TextDecoderState {
23
- fatal: boolean;
24
- ignoreBOM: boolean;
25
- [_bomSeen]: boolean;
26
- [_partial]: number[];
27
- }
28
- type TAllowSharedBufferSource = NonNullable<Parameters<TextDecoder["decode"]>[0]>;
29
- declare const TextDecoderE: {
30
- new (label?: string, options?: TextDecoderOptions): TextDecoder;
31
- prototype: TextDecoder;
32
- };
33
- export { TextDecoderE as TextDecoder };
@@ -1,15 +0,0 @@
1
- export declare class TextEncoderP implements TextEncoder {
2
- get encoding(): string;
3
- encode(input?: string): Uint8Array<ArrayBuffer>;
4
- encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
5
- toString(): string;
6
- get isPolyfill(): {
7
- symbol: symbol;
8
- hierarchy: string[];
9
- };
10
- }
11
- declare const TextEncoderE: {
12
- new (): TextEncoder;
13
- prototype: TextEncoder;
14
- };
15
- export { TextEncoderE as TextEncoder };
@@ -1,32 +0,0 @@
1
- declare const state: unique symbol;
2
- export declare class URLSearchParamsP implements URLSearchParams {
3
- constructor(init?: string[][] | Record<string, string> | string | URLSearchParams);
4
- [state]: URLSearchParamsState;
5
- get size(): number;
6
- append(name: string, value: string): void;
7
- delete(name: string, value?: string): void;
8
- get(name: string): string | null;
9
- getAll(name: string): string[];
10
- has(name: string, value?: string): boolean;
11
- set(name: string, value: string): void;
12
- sort(): void;
13
- forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
14
- entries(): ArrayIterator<[string, string]>;
15
- keys(): ArrayIterator<string>;
16
- values(): ArrayIterator<string>;
17
- [Symbol.iterator](): ArrayIterator<[string, string]>;
18
- toString(): string;
19
- get isPolyfill(): {
20
- symbol: symbol;
21
- hierarchy: string[];
22
- };
23
- }
24
- declare const _urlspDict: unique symbol;
25
- declare class URLSearchParamsState {
26
- [_urlspDict]: Record<string, string[]>;
27
- }
28
- declare const URLSearchParamsE: {
29
- new (init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
30
- prototype: URLSearchParams;
31
- };
32
- export { URLSearchParamsE as URLSearchParams };
@@ -1,50 +0,0 @@
1
- import { EventTargetP } from "./EventTargetP";
2
- declare const state: unique symbol;
3
- export { state as xhrEventTargetState };
4
- export declare class XMLHttpRequestEventTargetP extends EventTargetP implements XMLHttpRequestEventTarget {
5
- constructor();
6
- [state]: XMLHttpRequestEventTargetState;
7
- get onabort(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
8
- set onabort(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
9
- get onerror(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
10
- set onerror(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
11
- get onload(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
12
- set onload(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
13
- get onloadend(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
14
- set onloadend(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
15
- get onloadstart(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
16
- set onloadstart(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
17
- get onprogress(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
18
- set onprogress(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
19
- get ontimeout(): ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
20
- set ontimeout(value: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null);
21
- toString(): string;
22
- get isPolyfill(): {
23
- symbol: symbol;
24
- hierarchy: string[];
25
- };
26
- }
27
- declare const _handlers: unique symbol;
28
- export declare class XMLHttpRequestEventTargetState {
29
- /**
30
- * @param _target XMLHttpRequestEventTargetP
31
- */
32
- constructor(_target: unknown);
33
- target: XMLHttpRequest;
34
- [_handlers]: {
35
- onabort: (ev: ProgressEvent) => void;
36
- onerror: (ev: ProgressEvent) => void;
37
- onload: (ev: ProgressEvent) => void;
38
- onloadend: (ev: ProgressEvent) => void;
39
- onloadstart: (ev: ProgressEvent) => void;
40
- onprogress: (ev: ProgressEvent) => void;
41
- ontimeout: (ev: ProgressEvent) => void;
42
- };
43
- onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
44
- onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
45
- onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
46
- onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
47
- onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
48
- onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
49
- ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
50
- }
@@ -1,96 +0,0 @@
1
- import { XMLHttpRequestEventTargetP } from "./XMLHttpRequestEventTargetP";
2
- import { XMLHttpRequestUploadP } from "./XMLHttpRequestUploadP";
3
- import type { IRequestTask, IRequestSuccessCallbackBaseResult } from "./request";
4
- declare const state: unique symbol;
5
- export { state as xhrState };
6
- export declare class XMLHttpRequestP extends XMLHttpRequestEventTargetP implements XMLHttpRequest {
7
- static readonly UNSENT = 0;
8
- static readonly OPENED = 1;
9
- static readonly HEADERS_RECEIVED = 2;
10
- static readonly LOADING = 3;
11
- static readonly DONE = 4;
12
- constructor();
13
- [state]: XMLHttpRequestState;
14
- readonly UNSENT = 0;
15
- readonly OPENED = 1;
16
- readonly HEADERS_RECEIVED = 2;
17
- readonly LOADING = 3;
18
- readonly DONE = 4;
19
- get readyState(): number;
20
- get response(): any;
21
- get responseText(): string;
22
- get responseType(): XMLHttpRequestResponseType;
23
- set responseType(value: XMLHttpRequestResponseType);
24
- get responseURL(): string;
25
- get responseXML(): Document | null;
26
- get status(): number;
27
- get statusText(): string;
28
- get timeout(): number;
29
- set timeout(value: number);
30
- get upload(): XMLHttpRequestUpload;
31
- get withCredentials(): boolean;
32
- set withCredentials(value: boolean);
33
- abort(): void;
34
- getAllResponseHeaders(): string;
35
- getResponseHeader(name: string): string | null;
36
- open(...args: [method: string, url: string | URL, async?: boolean, username?: string | null, password?: string | null]): void;
37
- overrideMimeType(mime: string): void;
38
- send(body?: Document | XMLHttpRequestBodyInit | null): void;
39
- setRequestHeader(name: string, value: string): void;
40
- get onreadystatechange(): ((this: XMLHttpRequest, ev: Event) => any) | null;
41
- set onreadystatechange(value: ((this: XMLHttpRequest, ev: Event) => any) | null);
42
- toString(): string;
43
- get isPolyfill(): {
44
- symbol: symbol;
45
- hierarchy: string[];
46
- };
47
- }
48
- declare const _handlers: unique symbol;
49
- declare const _inAfterOpenBeforeSend: unique symbol;
50
- declare const _resetPending: unique symbol;
51
- declare const _timeoutId: unique symbol;
52
- declare const _requestURL: unique symbol;
53
- declare const _method: unique symbol;
54
- declare const _requestHeaders: unique symbol;
55
- export declare const _responseHeaders: unique symbol;
56
- declare const _responseContentLength: unique symbol;
57
- declare const _requestTask: unique symbol;
58
- declare class XMLHttpRequestState {
59
- constructor(target: XMLHttpRequestP);
60
- target: XMLHttpRequestP;
61
- readyState: number;
62
- response: any;
63
- responseType: XMLHttpRequestResponseType;
64
- responseURL: string;
65
- status: number;
66
- statusText: string;
67
- timeout: number;
68
- upload: XMLHttpRequestUploadP;
69
- withCredentials: boolean;
70
- [_handlers]: {
71
- onreadystatechange: (ev: Event) => void;
72
- };
73
- onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
74
- [_inAfterOpenBeforeSend]: boolean;
75
- [_resetPending]: boolean;
76
- [_timeoutId]: number;
77
- [_requestURL]: string;
78
- [_method]: string;
79
- [_requestHeaders]: Record<string, string>;
80
- [_responseHeaders]: Record<string, string> | null;
81
- [_responseContentLength]: number | (() => number);
82
- [_requestTask]: IRequestTask | null;
83
- }
84
- export declare function normalizeMethod(method: string): string;
85
- export declare function convert(body?: Parameters<XMLHttpRequest["send"]>[0], setContentType?: (str: string) => void, setContentLength?: (num: number | (() => number)) => void): string | ArrayBuffer;
86
- export declare function convertBack(type: XMLHttpRequestResponseType, data?: IRequestSuccessCallbackBaseResult["data"]): string | object | ArrayBuffer | Blob;
87
- declare const XMLHttpRequestE: {
88
- new (): XMLHttpRequest;
89
- prototype: XMLHttpRequest;
90
- readonly UNSENT: 0;
91
- readonly OPENED: 1;
92
- readonly HEADERS_RECEIVED: 2;
93
- readonly LOADING: 3;
94
- readonly DONE: 4;
95
- } | typeof XMLHttpRequestP;
96
- export { XMLHttpRequestE as XMLHttpRequest };
@@ -1,10 +0,0 @@
1
- import { XMLHttpRequestEventTargetP } from "./XMLHttpRequestEventTargetP";
2
- export declare class XMLHttpRequestUploadP extends XMLHttpRequestEventTargetP implements XMLHttpRequestUpload {
3
- constructor();
4
- toString(): string;
5
- get isPolyfill(): {
6
- symbol: symbol;
7
- hierarchy: string[];
8
- };
9
- }
10
- export declare function createXMLHttpRequestUploadP(): XMLHttpRequestUploadP;
@@ -1,3 +0,0 @@
1
- export declare function fetchP(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
2
- declare const fetchE: typeof fetch;
3
- export { fetchE as fetch };
@@ -1,18 +0,0 @@
1
- export { TextEncoder, TextEncoderP } from "./TextEncoderP";
2
- export { TextDecoder, TextDecoderP } from "./TextDecoderP";
3
- export { Event, EventP } from "./EventP";
4
- export { EventTarget, EventTargetP } from "./EventTargetP";
5
- export { CustomEvent, CustomEventP } from "./CustomEventP";
6
- export { ProgressEvent, ProgressEventP } from "./ProgressEventP";
7
- export { Blob, BlobP } from "./BlobP";
8
- export { File, FileP } from "./FileP";
9
- export { FileReader, FileReaderP } from "./FileReaderP";
10
- export { FormData, FormDataP } from "./FormDataP";
11
- export { URLSearchParams, URLSearchParamsP } from "./URLSearchParamsP";
12
- export { AbortSignal, AbortSignalP } from "./AbortSignalP";
13
- export { AbortController, AbortControllerP } from "./AbortControllerP";
14
- export { XMLHttpRequest, XMLHttpRequestP } from "./XMLHttpRequestP";
15
- export { fetch, fetchP } from "./fetchP";
16
- export { Headers, HeadersP } from "./HeadersP";
17
- export { Request, RequestP } from "./RequestP";
18
- export { Response, ResponseP } from "./ResponseP";
@@ -1,10 +0,0 @@
1
- export declare const polyfill: unique symbol;
2
- export declare const g: typeof globalThis;
3
- export declare function isObjectType<T>(name: string, value: unknown): value is T;
4
- export declare function isPolyfillType<T>(name: string, value: unknown): value is T;
5
- export declare class MPException extends Error {
6
- constructor(message?: string, name?: string);
7
- }
8
- export declare function defineStringTag(targetFunc: Function, stringTag: string): void;
9
- export declare function objectValues<T extends object>(obj: T): Array<T[keyof T]>;
10
- export declare function objectEntries<T extends object>(obj: T): Array<[keyof T & string, T[keyof T]]>;
@@ -1,4 +0,0 @@
1
- import type { TRequestFunc } from "./request";
2
- export declare const mp: {
3
- request: TRequestFunc;
4
- } | undefined;