@gofreego/tsutils 0.1.23 → 0.1.24

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.mts CHANGED
@@ -41,6 +41,7 @@ declare class HttpClient {
41
41
  constructor(config?: HttpClientConfig);
42
42
  private buildURL;
43
43
  private request;
44
+ setOnUnauthorized(handler: (error: HttpError) => void): void;
44
45
  setDefaultHeader(key: string, value: string): void;
45
46
  removeDefaultHeader(key: string): void;
46
47
  getDefaultHeaders(): Record<string, string>;
package/dist/index.d.ts CHANGED
@@ -41,6 +41,7 @@ declare class HttpClient {
41
41
  constructor(config?: HttpClientConfig);
42
42
  private buildURL;
43
43
  private request;
44
+ setOnUnauthorized(handler: (error: HttpError) => void): void;
44
45
  setDefaultHeader(key: string, value: string): void;
45
46
  removeDefaultHeader(key: string): void;
46
47
  getDefaultHeaders(): Record<string, string>;
package/dist/index.js CHANGED
@@ -659,6 +659,9 @@ var HttpClient = class {
659
659
  throw error;
660
660
  }
661
661
  }
662
+ setOnUnauthorized(handler) {
663
+ this.onUnauthorized = handler;
664
+ }
662
665
  setDefaultHeader(key, value) {
663
666
  this.defaultHeaders[key] = value;
664
667
  }