@icanbwell/types 0.40.2 → 0.41.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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Error Codes should be used in combination with the BwellError
3
+ * They categorize known error conditions and provide a mechanism for customized error handling.
4
+ */
5
+ var ErrorCode;
6
+ (function (ErrorCode) {
7
+ // Initialization Errors
8
+ /** Client or client key is unknown */
9
+ ErrorCode["CLIENT_UNKNOWN"] = "CLIENT_UNKNOWN";
10
+ /** Insufficient feature services defined by embeddable */
11
+ ErrorCode["INSUFFICIENT_SERVICES"] = "INSUFFICIENT_SERVICES";
12
+ /** Method called before initialization */
13
+ ErrorCode["METHOD_CALLED_BEFORE_INITIALIZATION"] = "METHOD_CALLED_BEFORE_INITIALIZATION";
14
+ /** General initialization failure of Bwell object */
15
+ ErrorCode["BWELL_INITIALIZATION"] = "BWELL_INITIALIZATION";
16
+ /** Error durring token exchange */
17
+ ErrorCode["TOKEN_EXCHANGE"] = "TOKEN_EXCHANGE";
18
+ // Routing Errors
19
+ /** Defines an error while executing a route */
20
+ ErrorCode["ROUTE_ACTION"] = "ROUTE_ACTION";
21
+ /** Defines an error while initializing the navigation service delegate */
22
+ ErrorCode["ROUTE_NAVIGATION_DELEGATE"] = "ROUTE_NAVIGATION_DELEGATE";
23
+ /** Specifies the the route is unknown */
24
+ ErrorCode["ROUTE_UNKNOWN"] = "ROUTE_UNKNOWN";
25
+ /** An elementId in the route definition does not have a matching element in the registry */
26
+ ErrorCode["ROUTE_ELEMENT_UNKNOWN"] = "ROUTE_ELEMENT_UNKNOWN";
27
+ // React Errors
28
+ /** Hook or Consumer used outside of a React Provider */
29
+ ErrorCode["PROVIDER_UNDEFINED"] = "PROVIDER_UNDEFINED";
30
+ // Miscelaneous Errors
31
+ /** Configuration Error */
32
+ ErrorCode["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
33
+ /** Network Error */
34
+ ErrorCode["NETWORK"] = "NETWORK";
35
+ /** Unknown error */
36
+ ErrorCode["UNKNOWN"] = "UNKNOWN";
37
+ })(ErrorCode || (ErrorCode = {}));
38
+
39
+ export { ErrorCode };
package/index.js CHANGED
@@ -1 +1 @@
1
-
1
+ export { ErrorCode } from './frontend-telemetry.js';
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/types",
3
- "version": "0.40.2",
3
+ "version": "0.41.0",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "tsconfig": "./tsconfig.lib.json"
@@ -12,6 +12,9 @@
12
12
  ],
13
13
  "native-bridge": [
14
14
  "src/native-bridge.d.ts"
15
+ ],
16
+ "frontend-telemetry": [
17
+ "src/frontend-telemetry.d.ts"
15
18
  ]
16
19
  }
17
20
  },
@@ -24,11 +27,17 @@
24
27
  "types": "./src/native-bridge.d.ts",
25
28
  "import": "./native-bridge.js"
26
29
  },
30
+ "./frontend-telemetry": {
31
+ "types": "./src/frontend-telemetry.d.ts",
32
+ "import": "./frontend-telemetry.js"
33
+ },
27
34
  ".": {
28
35
  "types": "./src/index.d.ts",
29
36
  "import": "./index.js"
30
37
  }
31
38
  },
39
+ "repoVersion": "1.27.0",
40
+ "description": "@icanbwell/types. repo version: 1.27.0",
32
41
  "module": "./index.js",
33
42
  "main": "./index.js",
34
43
  "type": "module",
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Error Codes should be used in combination with the BwellError
3
+ * They categorize known error conditions and provide a mechanism for customized error handling.
4
+ */
5
+ export declare enum ErrorCode {
6
+ /** Client or client key is unknown */
7
+ CLIENT_UNKNOWN = "CLIENT_UNKNOWN",
8
+ /** Insufficient feature services defined by embeddable */
9
+ INSUFFICIENT_SERVICES = "INSUFFICIENT_SERVICES",
10
+ /** Method called before initialization */
11
+ METHOD_CALLED_BEFORE_INITIALIZATION = "METHOD_CALLED_BEFORE_INITIALIZATION",
12
+ /** General initialization failure of Bwell object */
13
+ BWELL_INITIALIZATION = "BWELL_INITIALIZATION",
14
+ /** Error durring token exchange */
15
+ TOKEN_EXCHANGE = "TOKEN_EXCHANGE",
16
+ /** Defines an error while executing a route */
17
+ ROUTE_ACTION = "ROUTE_ACTION",
18
+ /** Defines an error while initializing the navigation service delegate */
19
+ ROUTE_NAVIGATION_DELEGATE = "ROUTE_NAVIGATION_DELEGATE",
20
+ /** Specifies the the route is unknown */
21
+ ROUTE_UNKNOWN = "ROUTE_UNKNOWN",
22
+ /** An elementId in the route definition does not have a matching element in the registry */
23
+ ROUTE_ELEMENT_UNKNOWN = "ROUTE_ELEMENT_UNKNOWN",
24
+ /** Hook or Consumer used outside of a React Provider */
25
+ PROVIDER_UNDEFINED = "PROVIDER_UNDEFINED",
26
+ /** Configuration Error */
27
+ CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
28
+ /** Network Error */
29
+ NETWORK = "NETWORK",
30
+ /** Unknown error */
31
+ UNKNOWN = "UNKNOWN"
32
+ }
33
+ export type ErrorDetails = {
34
+ message: string;
35
+ errorCode: ErrorCode;
36
+ };
37
+ export type ErrorContext = {
38
+ errorDetails: ErrorDetails;
39
+ resetError: () => void;
40
+ };
package/src/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './lib';
2
+ export * from './frontend-telemetry';
@@ -38,12 +38,23 @@ export interface ICamera {
38
38
  requestPermission(): Promise<PermissionStatus>;
39
39
  checkPermission(): Promise<PermissionStatus>;
40
40
  }
41
+ export type PrintOptions = {
42
+ html: string;
43
+ filePath?: never;
44
+ } & {
45
+ html?: never;
46
+ filePath: string;
47
+ };
48
+ export interface IPrint {
49
+ print(options: PrintOptions): Promise<boolean>;
50
+ }
41
51
  export interface INativeBridge {
42
52
  webview: IWebview;
43
53
  biometrics: IBiometrics;
44
54
  events: IEvents;
45
55
  storage: IStorage;
46
56
  camera: ICamera;
57
+ print: IPrint;
47
58
  reloadView(): void;
48
59
  }
49
60
  export type PluginKeys = Exclude<keyof INativeBridge, 'webview'>;