minutool 1.0.13 → 1.0.14

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/index.d.ts CHANGED
@@ -17,6 +17,10 @@ export declare interface AbortablePromise<T> extends Promise<T> {
17
17
  abort: () => void;
18
18
  }
19
19
 
20
+ export declare class AbortError extends Error {
21
+ constructor(message: string);
22
+ }
23
+
20
24
  /**
21
25
  * 将数组分割成指定大小的块
22
26
  * @param {T[]} list - 源数组
@@ -1445,18 +1449,14 @@ export declare const remove: (dom: HTMLElement | string) => Node | null;
1445
1449
  * @param {string} url - 请求 URL
1446
1450
  * @param {BodyInit|null} [data=null] - 请求数据,可以是字符串、FormData、URLSearchParams、Blob、ArrayBuffer 等,如果是对象会根据 ContentType 自动转换(例如 application/json 会自动 JSON.stringify)
1447
1451
  * @param {RequestOption} option - 请求选项
1448
- * @param {number} [option.timeout] - 请求超时时间(毫秒)
1449
- * @param {number} [option.delay] - 延迟响应时间(毫秒),用于模拟慢速请求
1450
1452
  * @returns {AbortablePromise<Response>} 返回可中止的 Promise
1451
1453
  * @example
1452
1454
  * request('/api/data', null, {method: 'GET'})
1453
- * request('/api/data', null, {method: 'GET', delay: 2000}) // 延迟 2 秒响应
1454
1455
  */
1455
1456
  export declare const request: (url: string, data: (BodyInit | null) | undefined, option: RequestOption) => AbortablePromise<Response>;
1456
1457
 
1457
1458
  declare interface RequestOption extends RequestInit {
1458
1459
  timeout?: number;
1459
- delay?: number;
1460
1460
  [key: string]: any;
1461
1461
  }
1462
1462