@vicaniddouglas/js_aide 1.16.0 → 1.17.0

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/declarations.d.ts CHANGED
@@ -305,14 +305,21 @@ declare module "@vicaniddouglas/js_aide" {
305
305
  interface RequestOptions {
306
306
  method?: string;
307
307
  endpoint: string;
308
+ params?: object | URLSearchParams | null;
308
309
  payload?: object | FormData | null;
309
310
  headers?: { [key: string]: string };
311
+ auth?: {
312
+ type: "bearer" | "basic" | "none";
313
+ token?: string;
314
+ username?: string;
315
+ password?: string;
316
+ } | null;
310
317
  timeout?: number;
311
318
  maxRetries?: number;
312
319
  retryStrategy?: "exponential" | "linear" | "fibonacci";
313
320
  useQueue?: boolean;
314
321
  priority?: number;
315
- responseType?: "json" | "text";
322
+ responseType?: "json" | "text" | "blob" | "arraybuffer";
316
323
  showLoading?: (isLoading: boolean) => void | Promise<void>;
317
324
  onSuccess?: (data: any) => void | Promise<void>;
318
325
  onError?: (log: string) => void | Promise<void>;
@@ -323,10 +330,14 @@ declare module "@vicaniddouglas/js_aide" {
323
330
  config: RequestOptions,
324
331
  ) => RequestOptions | Promise<RequestOptions>;
325
332
  type ResponseInterceptor = (response: {
333
+ status: boolean;
334
+ log: string;
326
335
  data: any;
327
- status: number;
336
+ httpCode: number;
337
+ headers: { [key: string]: string };
328
338
  url: string;
329
- }) => any | Promise<any>;
339
+ method: string;
340
+ }) => StandardizedResponse | Promise<StandardizedResponse> | any | Promise<any>;
330
341
  type ErrorInterceptor = (error: XMLHttpRequest) => void;
331
342
 
332
343
  interface InterceptorMethods {
@@ -345,6 +356,7 @@ declare module "@vicaniddouglas/js_aide" {
345
356
  log: string;
346
357
  data: any;
347
358
  httpCode: number;
359
+ headers: { [key: string]: string };
348
360
  }
349
361
 
350
362
  export const sendRequest: (