@icanbwell/types 0.40.0 → 0.40.2

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.
@@ -1,4 +1,4 @@
1
1
  const OnAuthSuccessEventKey = 'onauthsuccess';
2
- const OnErrorEventKey = 'onerror';
2
+ const ErrorEventKey = 'error';
3
3
 
4
- export { OnAuthSuccessEventKey, OnErrorEventKey };
4
+ export { ErrorEventKey, OnAuthSuccessEventKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/types",
3
- "version": "0.40.0",
3
+ "version": "0.40.2",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "tsconfig": "./tsconfig.lib.json"
@@ -1,15 +1,15 @@
1
1
  import type rnBiometrics from 'react-native-biometrics';
2
2
  import type TypedEmitter from 'typed-emitter';
3
- import { OnAuthSuccessEventKey, type OnAuthSuccessEventData, OnErrorEventKey, type OnErrorEventData } from './native-components';
3
+ import { OnAuthSuccessEventKey, type OnAuthSuccessEventData, ErrorEventKey, type ErrorEventData } from './native-components';
4
4
  import { PermissionStatus } from 'react-native-permissions';
5
5
  export type NativeEvents<T = any> = {
6
6
  openwebview: (url: string) => void;
7
7
  closewebview: (data: T) => void;
8
8
  reloadwebview: () => void;
9
9
  [OnAuthSuccessEventKey]: (data: OnAuthSuccessEventData) => void;
10
- [OnErrorEventKey]: (data: OnErrorEventData) => void;
10
+ [ErrorEventKey]: (data: ErrorEventData) => void;
11
11
  };
12
- export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess' | 'onerror'>;
12
+ export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess' | 'error'>;
13
13
  export type NativeEventEmitter = TypedEmitter<NativeEvents>;
14
14
  export type NativeEmittableEventEmitter = TypedEmitter<NativeBridgeEmittableEvents>;
15
15
  type InvokedReturnType<T> = Promise<Awaited<T>>;
@@ -3,16 +3,16 @@ export type OnAuthSuccessEventData = {
3
3
  id: string;
4
4
  };
5
5
  };
6
- export type OnErrorEventData = {
6
+ export type ErrorEventData = {
7
7
  name: string;
8
8
  message: string;
9
9
  errorCode: string;
10
10
  };
11
11
  export declare const OnAuthSuccessEventKey = "onauthsuccess";
12
- export declare const OnErrorEventKey = "onerror";
12
+ export declare const ErrorEventKey = "error";
13
13
  export type EventKeyToDataMap = {
14
14
  [OnAuthSuccessEventKey]: OnAuthSuccessEventData;
15
- [OnErrorEventKey]: OnErrorEventData;
15
+ [ErrorEventKey]: ErrorEventData;
16
16
  };
17
17
  type OnEventData<T extends keyof EventKeyToDataMap> = {
18
18
  key: T;
@@ -21,8 +21,7 @@ type OnEventData<T extends keyof EventKeyToDataMap> = {
21
21
  export type ComponentViewBaseProps = {
22
22
  clientKey: string;
23
23
  initialPath?: string;
24
- onEvent?: <T extends keyof Omit<EventKeyToDataMap, 'onerror'>>(data: OnEventData<T>) => void;
25
- onError?: (error: OnErrorEventData) => void;
24
+ onEvent?: <T extends keyof EventKeyToDataMap>(data: OnEventData<T>) => void;
26
25
  debug?: boolean;
27
26
  } & ({
28
27
  /** Supply the auth strategy. Defaults to `jwe` which will require a `userToken` prop.