@icanbwell/types 0.39.0 → 0.40.1
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/native-components.js
CHANGED
package/package.json
CHANGED
package/src/native-bridge.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type rnBiometrics from 'react-native-biometrics';
|
|
2
2
|
import type TypedEmitter from 'typed-emitter';
|
|
3
|
+
import { OnAuthSuccessEventKey, type OnAuthSuccessEventData, ErrorEventKey, type ErrorEventData } from './native-components';
|
|
3
4
|
import { PermissionStatus } from 'react-native-permissions';
|
|
4
|
-
import { OnAuthSuccessEventKey, type OnAuthSuccessEventData } from './native-components';
|
|
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
|
+
[ErrorEventKey]: (data: ErrorEventData) => void;
|
|
10
11
|
};
|
|
11
|
-
export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess'>;
|
|
12
|
+
export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess' | 'error'>;
|
|
12
13
|
export type NativeEventEmitter = TypedEmitter<NativeEvents>;
|
|
13
14
|
export type NativeEmittableEventEmitter = TypedEmitter<NativeBridgeEmittableEvents>;
|
|
14
15
|
type InvokedReturnType<T> = Promise<Awaited<T>>;
|
|
@@ -3,9 +3,16 @@ export type OnAuthSuccessEventData = {
|
|
|
3
3
|
id: string;
|
|
4
4
|
};
|
|
5
5
|
};
|
|
6
|
+
export type ErrorEventData = {
|
|
7
|
+
name: string;
|
|
8
|
+
message: string;
|
|
9
|
+
errorCode: string;
|
|
10
|
+
};
|
|
6
11
|
export declare const OnAuthSuccessEventKey = "onauthsuccess";
|
|
12
|
+
export declare const ErrorEventKey = "error";
|
|
7
13
|
export type EventKeyToDataMap = {
|
|
8
14
|
[OnAuthSuccessEventKey]: OnAuthSuccessEventData;
|
|
15
|
+
[ErrorEventKey]: ErrorEventData;
|
|
9
16
|
};
|
|
10
17
|
type OnEventData<T extends keyof EventKeyToDataMap> = {
|
|
11
18
|
key: T;
|