chayns-api 2.6.1 → 2.6.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.
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TrustedDomainsPlugin = void 0;
7
+ exports.isTrustedDomainsError = isTrustedDomainsError;
7
8
  class TrustedDomainsError extends Error {
8
9
  name = 'TrustedDomainsError';
10
+ isTrustedDomainsError = true;
9
11
  constructor(entry) {
10
12
  super('Remote entry ' + entry + ' is not in trusted domains');
11
13
  }
@@ -26,4 +28,7 @@ const TrustedDomainsPlugin = (trustedDomains = []) => {
26
28
  }
27
29
  };
28
30
  };
29
- exports.TrustedDomainsPlugin = TrustedDomainsPlugin;
31
+ exports.TrustedDomainsPlugin = TrustedDomainsPlugin;
32
+ function isTrustedDomainsError(error) {
33
+ return error instanceof Error && error.name === 'TrustedDomainsError' && 'isTrustedDomainsError' in error && error.isTrustedDomainsError === true;
34
+ }
@@ -15,5 +15,11 @@ Object.defineProperty(exports, "TrustedDomainsPlugin", {
15
15
  return _TrustedDomainsPlugins.TrustedDomainsPlugin;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "isTrustedDomainsError", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _TrustedDomainsPlugins.isTrustedDomainsError;
22
+ }
23
+ });
18
24
  var _SSRManifestPlugin = require("./SSRManifestPlugin");
19
25
  var _TrustedDomainsPlugins = require("./TrustedDomainsPlugins");
@@ -5,6 +5,7 @@ class TrustedDomainsError extends Error {
5
5
  constructor(entry) {
6
6
  super('Remote entry ' + entry + ' is not in trusted domains');
7
7
  _defineProperty(this, "name", 'TrustedDomainsError');
8
+ _defineProperty(this, "isTrustedDomainsError", true);
8
9
  }
9
10
  }
10
11
  export const TrustedDomainsPlugin = (trustedDomains = []) => {
@@ -22,4 +23,7 @@ export const TrustedDomainsPlugin = (trustedDomains = []) => {
22
23
  return args;
23
24
  }
24
25
  };
25
- };
26
+ };
27
+ export function isTrustedDomainsError(error) {
28
+ return error instanceof Error && error.name === 'TrustedDomainsError' && 'isTrustedDomainsError' in error && error.isTrustedDomainsError === true;
29
+ }
@@ -1,2 +1,2 @@
1
1
  export { SSRManifestPlugin } from './SSRManifestPlugin';
2
- export { TrustedDomainsPlugin } from './TrustedDomainsPlugins';
2
+ export { TrustedDomainsPlugin, isTrustedDomainsError } from './TrustedDomainsPlugins';
@@ -1,2 +1,9 @@
1
1
  import { ModuleFederationRuntimePlugin } from '@module-federation/enhanced/runtime';
2
+ declare class TrustedDomainsError extends Error {
3
+ readonly name: "TrustedDomainsError";
4
+ readonly isTrustedDomainsError: true;
5
+ constructor(entry: string);
6
+ }
2
7
  export declare const TrustedDomainsPlugin: (trustedDomains?: string[]) => ModuleFederationRuntimePlugin;
8
+ export declare function isTrustedDomainsError(error: unknown): error is TrustedDomainsError;
9
+ export {};
@@ -1,2 +1,2 @@
1
1
  export { SSRManifestPlugin } from './SSRManifestPlugin';
2
- export { TrustedDomainsPlugin } from './TrustedDomainsPlugins';
2
+ export { TrustedDomainsPlugin, isTrustedDomainsError } from './TrustedDomainsPlugins';
@@ -416,6 +416,9 @@ export interface ChaynsReactFunctions {
416
416
  storageSetItem: <T extends object | number | string>(key: string, value: T, accessMode?: AccessMode, tappIds?: number[]) => Promise<void>;
417
417
  vibrate: (value: Vibrate) => Promise<void>;
418
418
  scrollByY: (position: number, duration?: number) => Promise<void>;
419
+ /**
420
+ * @deprecated This call will be removed soon. Use dialogs instead.
421
+ */
419
422
  setOverlay: (value: ShowOverlay, callback: () => void) => Promise<void>;
420
423
  createDialog(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast)): DialogHandler<void>;
421
424
  createDialog(config: BaseDialog & (DialogInput | DialogSignature)): DialogHandler<string>;
@@ -428,7 +431,7 @@ export interface ChaynsReactFunctions {
428
431
  createDialog(config: BaseDialog & DialogDate): DialogHandler<Date>;
429
432
  createDialog(config: BaseDialog & DialogFileSelect): DialogHandler<DialogResultFile[]>;
430
433
  createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogModule<Input> | DialogIFrame<Input>)): DialogHandler<Result>;
431
- createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast | DialogInput | DialogSignature | DialogSelect | DialogDate | DialogFileSelect | DialogIFrame<Input> | DialogModule<Input>)): any;
434
+ createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast | DialogInput | DialogSignature | DialogSelect | DialogDate | DialogFileSelect | DialogIFrame<Input> | DialogModule<Input>)): DialogHandler<any>;
432
435
  openDialog: (value: any, callback: (data: any) => any) => Promise<any>;
433
436
  closeDialog: (dialogId: number) => Promise<void>;
434
437
  setDialogResult: (buttonType: DialogButtonType, result: any) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",