@vicaniddouglas/js_aide 1.16.0 → 1.18.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/README.md CHANGED
@@ -420,7 +420,7 @@ Returns the input value as a **string** on submit, or `null` if cancelled.
420
420
  ```javascript
421
421
  const name = await popup.prompt("Enter your display name:", {
422
422
  placeholder: "e.g., Douglas",
423
- inputType: "text", // Options: text, number, currency, password
423
+ inputType: "text", // Options: text, number, float, comms, currency, password
424
424
  });
425
425
 
426
426
  if (name) {
@@ -430,7 +430,7 @@ if (name) {
430
430
 
431
431
  | Prompt Option | Description |
432
432
  | :------------- | :------------------------------------------------------------------ |
433
- | `inputType` | Controls input behavior (`text`, `number`, `currency`, `password`). |
433
+ | `inputType` | Controls input behavior (`text`, `number`, `float`, `comms`, `currency`, `password`). |
434
434
  | `defaultValue` | Initial text inside the input. |
435
435
  | `submitText` | Text for the action button (default: "Submit"). |
436
436
  | `cancelText` | Text for the dismiss button (default: "Cancel"). |
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: (