@mptool/all 0.6.0-beta.13 → 0.6.0-beta.16

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/lib/index.d.mts CHANGED
@@ -1,6 +1,103 @@
1
1
  declare const encode: (arraybuffer: ArrayBuffer) => string;
2
2
  declare const decode: (base64: string) => ArrayBuffer;
3
3
 
4
+ declare const isQQ: boolean;
5
+ declare const isWx: boolean;
6
+ declare const isMp: boolean;
7
+
8
+ type EventType = string | symbol;
9
+ type Handler<T = unknown> = (event: T) => void | Promise<void>;
10
+ type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void | Promise<void>;
11
+ type EventHandlerList<T = unknown> = Array<Handler<T>>;
12
+ type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
13
+ type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | "*", EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
14
+ interface EmitterInstance<Events extends Record<EventType, unknown>> {
15
+ all: EventHandlerMap<Events>;
16
+ on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
17
+ on(type: "*", handler: WildcardHandler<Events>): void;
18
+ off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
19
+ off(type: "*", handler: WildcardHandler<Events>): void;
20
+ emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
21
+ emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
22
+ emitAsync<Key extends keyof Events>(type: Key, event: Events[Key]): Promise<void>;
23
+ emitAsync<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): Promise<void>;
24
+ }
25
+ /**
26
+ * Tiny (~300b) functional event emitter / pubsub.
27
+ * @name emitter
28
+ * @returns Emitter
29
+ */
30
+ declare function Emitter<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): EmitterInstance<Events>;
31
+
32
+ /** 写入普通日志 */
33
+ declare const debug: (...args: any[]) => void;
34
+ /** 写入信息日志 */
35
+ declare const info: (...args: any[]) => void;
36
+ /** 写入警告日志 */
37
+ declare const warn: (...args: any[]) => void;
38
+ /** 写入错误日志 */
39
+ declare const error: (...args: any[]) => void;
40
+ /**
41
+ * 写入过滤信息
42
+ *
43
+ * @param filterMsg 过滤信息
44
+ */
45
+ declare const filter: (filterMsg: string) => void;
46
+
47
+ declare const logger_debug: typeof debug;
48
+ declare const logger_error: typeof error;
49
+ declare const logger_filter: typeof filter;
50
+ declare const logger_info: typeof info;
51
+ declare const logger_warn: typeof warn;
52
+ declare namespace logger {
53
+ export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
54
+ }
55
+
56
+ /**
57
+ * 字符串参数解析
58
+ *
59
+ * @param queryString 需要解析的字符串
60
+ * @param [splitter='&'] 分隔符
61
+ *
62
+ * @returns 参数对象
63
+ */
64
+ declare const parse: (queryString?: string, splitter?: string) => Record<string, string>;
65
+ /**
66
+ * query 对象转换字符串
67
+ *
68
+ * @param params query 对象
69
+ * @param [splitter='&] 分隔符
70
+ * @param [unencoded=false] 是否已经解码
71
+ *
72
+ * @returns 解析的字符串
73
+ */
74
+ declare const stringify: (params?: Record<string, string>, splitter?: string, unencoded?: boolean) => string;
75
+ /**
76
+ * URL 添加 query
77
+ *
78
+ * @param path 前部分路径
79
+ * @param queries query对象
80
+ * @param unencoded 是否已经解码,默认为否
81
+ *
82
+ * @returns 处理过的 url
83
+ */
84
+ declare const join: (path: string, queries: Record<string, string>, unencoded?: boolean) => string;
85
+
86
+ declare const query_join: typeof join;
87
+ declare const query_parse: typeof parse;
88
+ declare const query_stringify: typeof stringify;
89
+ declare namespace query {
90
+ export { query_join as join, query_parse as parse, query_stringify as stringify };
91
+ }
92
+
93
+ /**
94
+ * 获取变量类型
95
+ *
96
+ * @param obj 需要辨别的变量
97
+ * @returns 对象的类型
98
+ */
99
+ declare const type: (obj: unknown) => string;
100
+
4
101
  /**
5
102
  * 包装函数,先执行 wrapper ,然后执行原函数
6
103
  *
@@ -111,99 +208,6 @@ declare class Queue {
111
208
  */
112
209
  declare const funcQueue: <A extends unknown[], T = unknown>(fn: (next: () => void, ...args: A) => void, capacity?: number) => (this: T, ...args: A) => void;
113
210
 
114
- type EventType = string | symbol;
115
- type Handler<T = unknown> = (event: T) => void | Promise<void>;
116
- type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void | Promise<void>;
117
- type EventHandlerList<T = unknown> = Array<Handler<T>>;
118
- type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
119
- type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | "*", EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
120
- interface EmitterInstance<Events extends Record<EventType, unknown>> {
121
- all: EventHandlerMap<Events>;
122
- on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
123
- on(type: "*", handler: WildcardHandler<Events>): void;
124
- off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
125
- off(type: "*", handler: WildcardHandler<Events>): void;
126
- emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
127
- emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
128
- emitAsync<Key extends keyof Events>(type: Key, event: Events[Key]): Promise<void>;
129
- emitAsync<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): Promise<void>;
130
- }
131
- /**
132
- * Tiny (~300b) functional event emitter / pubsub.
133
- * @name emitter
134
- * @returns Emitter
135
- */
136
- declare function Emitter<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): EmitterInstance<Events>;
137
-
138
- /** 写入普通日志 */
139
- declare const debug: (...args: any[]) => void;
140
- /** 写入信息日志 */
141
- declare const info: (...args: any[]) => void;
142
- /** 写入警告日志 */
143
- declare const warn: (...args: any[]) => void;
144
- /** 写入错误日志 */
145
- declare const error: (...args: any[]) => void;
146
- /**
147
- * 写入过滤信息
148
- *
149
- * @param filterMsg 过滤信息
150
- */
151
- declare const filter: (filterMsg: string) => void;
152
-
153
- declare const logger_debug: typeof debug;
154
- declare const logger_error: typeof error;
155
- declare const logger_filter: typeof filter;
156
- declare const logger_info: typeof info;
157
- declare const logger_warn: typeof warn;
158
- declare namespace logger {
159
- export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
160
- }
161
-
162
- /**
163
- * 字符串参数解析
164
- *
165
- * @param queryString 需要解析的字符串
166
- * @param [splitter='&'] 分隔符
167
- *
168
- * @returns 参数对象
169
- */
170
- declare const parse: (queryString?: string, splitter?: string) => Record<string, string>;
171
- /**
172
- * query 对象转换字符串
173
- *
174
- * @param params query 对象
175
- * @param [splitter='&] 分隔符
176
- * @param [unencoded=false] 是否已经解码
177
- *
178
- * @returns 解析的字符串
179
- */
180
- declare const stringify: (params?: Record<string, string>, splitter?: string, unencoded?: boolean) => string;
181
- /**
182
- * URL 添加 query
183
- *
184
- * @param path 前部分路径
185
- * @param queries query对象
186
- * @param unencoded 是否已经解码,默认为否
187
- *
188
- * @returns 处理过的 url
189
- */
190
- declare const join: (path: string, queries: Record<string, string>, unencoded?: boolean) => string;
191
-
192
- declare const query_join: typeof join;
193
- declare const query_parse: typeof parse;
194
- declare const query_stringify: typeof stringify;
195
- declare namespace query {
196
- export { query_join as join, query_parse as parse, query_stringify as stringify };
197
- }
198
-
199
- /**
200
- * 获取变量类型
201
- *
202
- * @param obj 需要辨别的变量
203
- * @returns 对象的类型
204
- */
205
- declare const type: (obj: unknown) => string;
206
-
207
211
  type Props = Record<string, unknown>;
208
212
  type PropsOptions<Property = Props> = {
209
213
  [K in keyof Property]: PropItem<Property[K]> | null;
@@ -1103,8 +1107,8 @@ declare class Cookie {
1103
1107
  toJSON(): CookieType;
1104
1108
  }
1105
1109
 
1106
- type HeadersInit = [string, string][] | Record<string, string> | Headers;
1107
- declare class Headers {
1110
+ type HeadersInit = [string, string][] | Record<string, string> | Headers$1;
1111
+ declare class Headers$1 {
1108
1112
  private headers;
1109
1113
  private headerNames;
1110
1114
  constructor(init?: HeadersInit);
@@ -1261,14 +1265,14 @@ declare class CookieStore {
1261
1265
  * @param header 小程序 response header
1262
1266
  * @param domainOrURL Url 或域名
1263
1267
  */
1264
- applyHeader(header: WechatMiniprogram.IAnyObject, domainOrURL: string): void;
1268
+ applyHeader(header: WechatMiniprogram.IAnyObject | Headers, domainOrURL: string): void;
1265
1269
  /**
1266
1270
  * 应用响应 cookies
1267
1271
  *
1268
1272
  * @param response 小程序 response
1269
1273
  * @param domainOrURL Url 或域名
1270
1274
  */
1271
- applyResponse(response: WechatMiniprogram.RequestSuccessCallbackResult, domainOrURL: string): void;
1275
+ applyResponse(response: WechatMiniprogram.RequestSuccessCallbackResult | Response, domainOrURL: string): void;
1272
1276
  /**
1273
1277
  * 获取 request cookie header
1274
1278
  *
@@ -1434,7 +1438,7 @@ interface RequestResponse<T extends Record<never, never> | unknown[] | string |
1434
1438
  /** Status Code */
1435
1439
  status: number;
1436
1440
  /** Response headers */
1437
- headers: Headers;
1441
+ headers: Headers$1;
1438
1442
  /** Response data */
1439
1443
  data: T;
1440
1444
  }
@@ -1493,4 +1497,4 @@ interface RequestFactory {
1493
1497
  */
1494
1498
  declare const createRequest: ({ cookieStore, server, responseHandler, errorHandler, ...defaultOptions }?: RequestInitOptions) => RequestFactory;
1495
1499
 
1496
- export { $App, $Component, $Config, $Page, type AppConfig, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropType, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type SetCookieOptions, type StorageData, type Task, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getCookieOptions, getCookieScopeDomain, getDomain, isDir, isFile, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseUrl, put, query, readFile, readJSON, remove, removeAsync, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };
1500
+ export { $App, $Component, $Config, $Page, type AppConfig, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendsAppOptions, type Handler, Headers$1 as Headers, type HeadersInit, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropType, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type SetCookieOptions, type StorageData, type Task, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getCookieOptions, getCookieScopeDomain, getDomain, isDir, isFile, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseUrl, put, query, readFile, readJSON, remove, removeAsync, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };
package/lib/index.d.ts CHANGED
@@ -1,6 +1,103 @@
1
1
  declare const encode: (arraybuffer: ArrayBuffer) => string;
2
2
  declare const decode: (base64: string) => ArrayBuffer;
3
3
 
4
+ declare const isQQ: boolean;
5
+ declare const isWx: boolean;
6
+ declare const isMp: boolean;
7
+
8
+ type EventType = string | symbol;
9
+ type Handler<T = unknown> = (event: T) => void | Promise<void>;
10
+ type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void | Promise<void>;
11
+ type EventHandlerList<T = unknown> = Array<Handler<T>>;
12
+ type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
13
+ type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | "*", EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
14
+ interface EmitterInstance<Events extends Record<EventType, unknown>> {
15
+ all: EventHandlerMap<Events>;
16
+ on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
17
+ on(type: "*", handler: WildcardHandler<Events>): void;
18
+ off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
19
+ off(type: "*", handler: WildcardHandler<Events>): void;
20
+ emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
21
+ emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
22
+ emitAsync<Key extends keyof Events>(type: Key, event: Events[Key]): Promise<void>;
23
+ emitAsync<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): Promise<void>;
24
+ }
25
+ /**
26
+ * Tiny (~300b) functional event emitter / pubsub.
27
+ * @name emitter
28
+ * @returns Emitter
29
+ */
30
+ declare function Emitter<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): EmitterInstance<Events>;
31
+
32
+ /** 写入普通日志 */
33
+ declare const debug: (...args: any[]) => void;
34
+ /** 写入信息日志 */
35
+ declare const info: (...args: any[]) => void;
36
+ /** 写入警告日志 */
37
+ declare const warn: (...args: any[]) => void;
38
+ /** 写入错误日志 */
39
+ declare const error: (...args: any[]) => void;
40
+ /**
41
+ * 写入过滤信息
42
+ *
43
+ * @param filterMsg 过滤信息
44
+ */
45
+ declare const filter: (filterMsg: string) => void;
46
+
47
+ declare const logger_debug: typeof debug;
48
+ declare const logger_error: typeof error;
49
+ declare const logger_filter: typeof filter;
50
+ declare const logger_info: typeof info;
51
+ declare const logger_warn: typeof warn;
52
+ declare namespace logger {
53
+ export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
54
+ }
55
+
56
+ /**
57
+ * 字符串参数解析
58
+ *
59
+ * @param queryString 需要解析的字符串
60
+ * @param [splitter='&'] 分隔符
61
+ *
62
+ * @returns 参数对象
63
+ */
64
+ declare const parse: (queryString?: string, splitter?: string) => Record<string, string>;
65
+ /**
66
+ * query 对象转换字符串
67
+ *
68
+ * @param params query 对象
69
+ * @param [splitter='&] 分隔符
70
+ * @param [unencoded=false] 是否已经解码
71
+ *
72
+ * @returns 解析的字符串
73
+ */
74
+ declare const stringify: (params?: Record<string, string>, splitter?: string, unencoded?: boolean) => string;
75
+ /**
76
+ * URL 添加 query
77
+ *
78
+ * @param path 前部分路径
79
+ * @param queries query对象
80
+ * @param unencoded 是否已经解码,默认为否
81
+ *
82
+ * @returns 处理过的 url
83
+ */
84
+ declare const join: (path: string, queries: Record<string, string>, unencoded?: boolean) => string;
85
+
86
+ declare const query_join: typeof join;
87
+ declare const query_parse: typeof parse;
88
+ declare const query_stringify: typeof stringify;
89
+ declare namespace query {
90
+ export { query_join as join, query_parse as parse, query_stringify as stringify };
91
+ }
92
+
93
+ /**
94
+ * 获取变量类型
95
+ *
96
+ * @param obj 需要辨别的变量
97
+ * @returns 对象的类型
98
+ */
99
+ declare const type: (obj: unknown) => string;
100
+
4
101
  /**
5
102
  * 包装函数,先执行 wrapper ,然后执行原函数
6
103
  *
@@ -111,99 +208,6 @@ declare class Queue {
111
208
  */
112
209
  declare const funcQueue: <A extends unknown[], T = unknown>(fn: (next: () => void, ...args: A) => void, capacity?: number) => (this: T, ...args: A) => void;
113
210
 
114
- type EventType = string | symbol;
115
- type Handler<T = unknown> = (event: T) => void | Promise<void>;
116
- type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void | Promise<void>;
117
- type EventHandlerList<T = unknown> = Array<Handler<T>>;
118
- type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
119
- type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | "*", EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
120
- interface EmitterInstance<Events extends Record<EventType, unknown>> {
121
- all: EventHandlerMap<Events>;
122
- on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
123
- on(type: "*", handler: WildcardHandler<Events>): void;
124
- off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
125
- off(type: "*", handler: WildcardHandler<Events>): void;
126
- emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
127
- emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
128
- emitAsync<Key extends keyof Events>(type: Key, event: Events[Key]): Promise<void>;
129
- emitAsync<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): Promise<void>;
130
- }
131
- /**
132
- * Tiny (~300b) functional event emitter / pubsub.
133
- * @name emitter
134
- * @returns Emitter
135
- */
136
- declare function Emitter<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): EmitterInstance<Events>;
137
-
138
- /** 写入普通日志 */
139
- declare const debug: (...args: any[]) => void;
140
- /** 写入信息日志 */
141
- declare const info: (...args: any[]) => void;
142
- /** 写入警告日志 */
143
- declare const warn: (...args: any[]) => void;
144
- /** 写入错误日志 */
145
- declare const error: (...args: any[]) => void;
146
- /**
147
- * 写入过滤信息
148
- *
149
- * @param filterMsg 过滤信息
150
- */
151
- declare const filter: (filterMsg: string) => void;
152
-
153
- declare const logger_debug: typeof debug;
154
- declare const logger_error: typeof error;
155
- declare const logger_filter: typeof filter;
156
- declare const logger_info: typeof info;
157
- declare const logger_warn: typeof warn;
158
- declare namespace logger {
159
- export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
160
- }
161
-
162
- /**
163
- * 字符串参数解析
164
- *
165
- * @param queryString 需要解析的字符串
166
- * @param [splitter='&'] 分隔符
167
- *
168
- * @returns 参数对象
169
- */
170
- declare const parse: (queryString?: string, splitter?: string) => Record<string, string>;
171
- /**
172
- * query 对象转换字符串
173
- *
174
- * @param params query 对象
175
- * @param [splitter='&] 分隔符
176
- * @param [unencoded=false] 是否已经解码
177
- *
178
- * @returns 解析的字符串
179
- */
180
- declare const stringify: (params?: Record<string, string>, splitter?: string, unencoded?: boolean) => string;
181
- /**
182
- * URL 添加 query
183
- *
184
- * @param path 前部分路径
185
- * @param queries query对象
186
- * @param unencoded 是否已经解码,默认为否
187
- *
188
- * @returns 处理过的 url
189
- */
190
- declare const join: (path: string, queries: Record<string, string>, unencoded?: boolean) => string;
191
-
192
- declare const query_join: typeof join;
193
- declare const query_parse: typeof parse;
194
- declare const query_stringify: typeof stringify;
195
- declare namespace query {
196
- export { query_join as join, query_parse as parse, query_stringify as stringify };
197
- }
198
-
199
- /**
200
- * 获取变量类型
201
- *
202
- * @param obj 需要辨别的变量
203
- * @returns 对象的类型
204
- */
205
- declare const type: (obj: unknown) => string;
206
-
207
211
  type Props = Record<string, unknown>;
208
212
  type PropsOptions<Property = Props> = {
209
213
  [K in keyof Property]: PropItem<Property[K]> | null;
@@ -1103,8 +1107,8 @@ declare class Cookie {
1103
1107
  toJSON(): CookieType;
1104
1108
  }
1105
1109
 
1106
- type HeadersInit = [string, string][] | Record<string, string> | Headers;
1107
- declare class Headers {
1110
+ type HeadersInit = [string, string][] | Record<string, string> | Headers$1;
1111
+ declare class Headers$1 {
1108
1112
  private headers;
1109
1113
  private headerNames;
1110
1114
  constructor(init?: HeadersInit);
@@ -1261,14 +1265,14 @@ declare class CookieStore {
1261
1265
  * @param header 小程序 response header
1262
1266
  * @param domainOrURL Url 或域名
1263
1267
  */
1264
- applyHeader(header: WechatMiniprogram.IAnyObject, domainOrURL: string): void;
1268
+ applyHeader(header: WechatMiniprogram.IAnyObject | Headers, domainOrURL: string): void;
1265
1269
  /**
1266
1270
  * 应用响应 cookies
1267
1271
  *
1268
1272
  * @param response 小程序 response
1269
1273
  * @param domainOrURL Url 或域名
1270
1274
  */
1271
- applyResponse(response: WechatMiniprogram.RequestSuccessCallbackResult, domainOrURL: string): void;
1275
+ applyResponse(response: WechatMiniprogram.RequestSuccessCallbackResult | Response, domainOrURL: string): void;
1272
1276
  /**
1273
1277
  * 获取 request cookie header
1274
1278
  *
@@ -1434,7 +1438,7 @@ interface RequestResponse<T extends Record<never, never> | unknown[] | string |
1434
1438
  /** Status Code */
1435
1439
  status: number;
1436
1440
  /** Response headers */
1437
- headers: Headers;
1441
+ headers: Headers$1;
1438
1442
  /** Response data */
1439
1443
  data: T;
1440
1444
  }
@@ -1493,4 +1497,4 @@ interface RequestFactory {
1493
1497
  */
1494
1498
  declare const createRequest: ({ cookieStore, server, responseHandler, errorHandler, ...defaultOptions }?: RequestInitOptions) => RequestFactory;
1495
1499
 
1496
- export { $App, $Component, $Config, $Page, type AppConfig, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropType, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type SetCookieOptions, type StorageData, type Task, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getCookieOptions, getCookieScopeDomain, getDomain, isDir, isFile, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseUrl, put, query, readFile, readJSON, remove, removeAsync, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };
1500
+ export { $App, $Component, $Config, $Page, type AppConfig, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendsAppOptions, type Handler, Headers$1 as Headers, type HeadersInit, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropType, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type SetCookieOptions, type StorageData, type Task, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getCookieOptions, getCookieScopeDomain, getDomain, isDir, isFile, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseUrl, put, query, readFile, readJSON, remove, removeAsync, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };