@unicom-cloud/axios 0.1.2 → 0.1.3

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/index.d.ts CHANGED
@@ -332,6 +332,7 @@ export interface TransitionalOptions {
332
332
  silentJSONParsing?: boolean;
333
333
  forcedJSONParsing?: boolean;
334
334
  clarifyTimeoutError?: boolean;
335
+ legacyInterceptorReqResOrdering?: boolean;
335
336
  }
336
337
 
337
338
  export interface GenericAbortSignal {
@@ -518,8 +519,9 @@ export interface AxiosRequestConfig<D = any> {
518
519
  // Alias
519
520
  export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
520
521
 
521
- export interface InternalAxiosRequestConfig<D = any>
522
- extends AxiosRequestConfig<D> {
522
+ export interface InternalAxiosRequestConfig<
523
+ D = any,
524
+ > extends AxiosRequestConfig<D> {
523
525
  headers: AxiosRequestHeaders;
524
526
  }
525
527
 
@@ -537,13 +539,17 @@ export interface HeadersDefaults {
537
539
  unlink?: RawAxiosRequestHeaders;
538
540
  }
539
541
 
540
- export interface AxiosDefaults<D = any>
541
- extends Omit<AxiosRequestConfig<D>, 'headers'> {
542
+ export interface AxiosDefaults<D = any> extends Omit<
543
+ AxiosRequestConfig<D>,
544
+ 'headers'
545
+ > {
542
546
  headers: HeadersDefaults;
543
547
  }
544
548
 
545
- export interface CreateAxiosDefaults<D = any>
546
- extends Omit<AxiosRequestConfig<D>, 'headers'> {
549
+ export interface CreateAxiosDefaults<D = any> extends Omit<
550
+ AxiosRequestConfig<D>,
551
+ 'headers'
552
+ > {
547
553
  headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
548
554
  }
549
555
 
@@ -572,7 +578,7 @@ export class AxiosError<T = unknown, D = any> extends Error {
572
578
  isAxiosError: boolean;
573
579
  status?: number;
574
580
  toJSON: () => object;
575
- cause?: unknown;
581
+ cause?: Error;
576
582
  event?: BrowserProgressEvent;
577
583
  static from<T = unknown, D = any>(
578
584
  error: Error | unknown,
@@ -635,23 +641,34 @@ export interface AxiosInterceptorOptions {
635
641
  runWhen?: (config: InternalAxiosRequestConfig) => boolean;
636
642
  }
637
643
 
644
+ type AxiosInterceptorFulfilled<T> = (value: T) => T | Promise<T>;
645
+ type AxiosInterceptorRejected = (error: any) => any;
646
+
638
647
  type AxiosRequestInterceptorUse<T> = (
639
- onFulfilled?: ((value: T) => T | Promise<T>) | null,
640
- onRejected?: ((error: any) => any) | null,
648
+ onFulfilled?: AxiosInterceptorFulfilled<T> | null,
649
+ onRejected?: AxiosInterceptorRejected | null,
641
650
  options?: AxiosInterceptorOptions,
642
651
  ) => number;
643
652
 
644
653
  type AxiosResponseInterceptorUse<T> = (
645
- onFulfilled?: ((value: T) => T | Promise<T>) | null,
646
- onRejected?: ((error: any) => any) | null,
654
+ onFulfilled?: AxiosInterceptorFulfilled<T> | null,
655
+ onRejected?: AxiosInterceptorRejected | null,
647
656
  ) => number;
648
657
 
658
+ interface AxiosInterceptorHandler<T> {
659
+ fulfilled: AxiosInterceptorFulfilled<T>;
660
+ rejected?: AxiosInterceptorRejected;
661
+ synchronous: boolean;
662
+ runWhen: (config: AxiosRequestConfig) => boolean | null;
663
+ }
664
+
649
665
  export interface AxiosInterceptorManager<V> {
650
666
  use: V extends AxiosResponse
651
667
  ? AxiosResponseInterceptorUse<V>
652
668
  : AxiosRequestInterceptorUse<V>;
653
669
  eject(id: number): void;
654
670
  clear(): void;
671
+ handlers?: Array<AxiosInterceptorHandler<V>>;
655
672
  }
656
673
 
657
674
  export class Axios {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 09:59:53 */
1
+ /* 2026-02-26 14:42:51 */
2
2
  import o from "./lib/axios.js";
3
3
  const {
4
4
  Axios: e,