@icanbwell/types 0.46.3 → 1.1.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.
- package/native-components.js +1 -2
- package/package.json +10 -4
- package/src/embeddable-core.d.ts +1 -0
- package/src/index.d.ts +2 -0
- package/src/native-bridge.d.ts +4 -5
- package/src/native-components.d.ts +3 -4
- package/src/native-plugins.d.ts +21 -2
package/native-components.js
CHANGED
|
@@ -2,6 +2,5 @@ import './frontend-telemetry.js';
|
|
|
2
2
|
|
|
3
3
|
const OnAuthSuccessEventKey = 'onauthsuccess';
|
|
4
4
|
const ErrorEventKey = 'error';
|
|
5
|
-
const NativeDependenciesEventKey = 'nativedependencies';
|
|
6
5
|
|
|
7
|
-
export { ErrorEventKey,
|
|
6
|
+
export { ErrorEventKey, OnAuthSuccessEventKey };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"typedoc": {
|
|
5
5
|
"entryPoint": "./src/index.ts",
|
|
6
6
|
"tsconfig": "./tsconfig.lib.json"
|
|
@@ -36,16 +36,22 @@
|
|
|
36
36
|
"import": "./index.js"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
"repoVersion": "
|
|
40
|
-
"description": "@icanbwell/types. repo version:
|
|
39
|
+
"repoVersion": "2.7.0",
|
|
40
|
+
"description": "@icanbwell/types. repo version: 2.7.0",
|
|
41
41
|
"module": "./index.js",
|
|
42
42
|
"main": "./index.js",
|
|
43
43
|
"type": "module",
|
|
44
44
|
"types": "./src/index.d.ts",
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"@react-native-async-storage/async-storage": "1.18.1",
|
|
47
|
+
"@react-native-camera-roll/camera-roll": "5.7.1",
|
|
48
|
+
"@react-native-community/geolocation": "3.0.6",
|
|
46
49
|
"apollo-link-rest": "0.9.0",
|
|
47
50
|
"react-native-biometrics": "3.0.1",
|
|
48
|
-
"react-native-
|
|
51
|
+
"react-native-document-picker": "9.0.1",
|
|
52
|
+
"react-native-fs": "2.20.0",
|
|
53
|
+
"react-native-permissions": "3.8.0",
|
|
54
|
+
"react-native-print": "0.11.0"
|
|
49
55
|
},
|
|
50
56
|
"peerDependencies": {}
|
|
51
57
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EmbeddableLoaderAttribute = 'error' | 'loading';
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './lib';
|
|
2
2
|
export * from './frontend-telemetry';
|
|
3
3
|
export * from './native-plugins';
|
|
4
|
+
export * from './embeddable-core';
|
|
5
|
+
export { PluginKeys } from './native-bridge';
|
|
4
6
|
export declare const PageTransitionEventKey = "pagetransition";
|
|
5
7
|
export type PageTransitionEventPayload = {
|
|
6
8
|
id?: string;
|
package/src/native-bridge.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type rnBiometrics from 'react-native-biometrics';
|
|
2
2
|
import type TypedEmitter from 'typed-emitter';
|
|
3
|
-
import type { OnAuthSuccessEventKey, OnAuthSuccessEventData, ErrorEventKey, ErrorEventData
|
|
3
|
+
import type { OnAuthSuccessEventKey, OnAuthSuccessEventData, ErrorEventKey, ErrorEventData } from './native-components';
|
|
4
4
|
import { openSettings, PermissionStatus } from 'react-native-permissions';
|
|
5
|
-
import { NativeDependencies } from './native-plugins';
|
|
6
5
|
import { PageTransitionEventKey, PageTransitionEventPayload } from '.';
|
|
7
6
|
export type NativeEvents<T = any> = {
|
|
8
7
|
openwebview: (url: string) => void;
|
|
9
8
|
closewebview: (data: T) => void;
|
|
10
9
|
reloadwebview: () => void;
|
|
10
|
+
nativebridgedependencies: (nativeBridgeDependencies: PluginKeys[]) => void;
|
|
11
11
|
[OnAuthSuccessEventKey]: (data: OnAuthSuccessEventData) => void;
|
|
12
12
|
[ErrorEventKey]: (data: ErrorEventData) => void;
|
|
13
|
-
[NativeDependenciesEventKey]: (data: NativeDependencies) => void;
|
|
14
13
|
[PageTransitionEventKey]: (data: PageTransitionEventPayload) => void;
|
|
15
14
|
};
|
|
16
|
-
export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess' | 'error' | '
|
|
15
|
+
export type NativeBridgeEmittableEvents = Pick<NativeEvents, 'onauthsuccess' | 'error' | 'nativebridgedependencies'>;
|
|
17
16
|
export type NativeEventEmitter = TypedEmitter<NativeEvents>;
|
|
18
17
|
export type NativeEmittableEventEmitter = TypedEmitter<NativeBridgeEmittableEvents>;
|
|
19
18
|
type InvokedReturnType<T> = Promise<Awaited<T>>;
|
|
@@ -138,6 +137,6 @@ export interface INativeBridge {
|
|
|
138
137
|
reloadView(): void;
|
|
139
138
|
}
|
|
140
139
|
export type GlobalPermissionStatus = PermissionStatus | PermissionState;
|
|
141
|
-
export type PluginKeys = Exclude<keyof INativeBridge, 'webview'>;
|
|
140
|
+
export type PluginKeys = Exclude<keyof INativeBridge, 'webview' | 'reloadView'>;
|
|
142
141
|
export type MethodKeys<T extends PluginKeys> = keyof INativeBridge[T];
|
|
143
142
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { NativeModuleMap } from './native-plugins';
|
|
1
2
|
import { PageTransitionEventKey, PageTransitionEventPayload } from '.';
|
|
2
|
-
import { NativeDependencies } from './native-plugins';
|
|
3
3
|
export type OnAuthSuccessEventData = {
|
|
4
4
|
user: {
|
|
5
5
|
id: string;
|
|
@@ -8,15 +8,13 @@ export type OnAuthSuccessEventData = {
|
|
|
8
8
|
export type ErrorEventData = {
|
|
9
9
|
name: string;
|
|
10
10
|
message: string;
|
|
11
|
-
errorCode
|
|
11
|
+
errorCode?: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const OnAuthSuccessEventKey = "onauthsuccess";
|
|
14
14
|
export declare const ErrorEventKey = "error";
|
|
15
|
-
export declare const NativeDependenciesEventKey = "nativedependencies";
|
|
16
15
|
export type EventKeyToDataMap = {
|
|
17
16
|
[OnAuthSuccessEventKey]: OnAuthSuccessEventData;
|
|
18
17
|
[ErrorEventKey]: ErrorEventData;
|
|
19
|
-
[NativeDependenciesEventKey]: NativeDependencies;
|
|
20
18
|
[PageTransitionEventKey]: PageTransitionEventPayload;
|
|
21
19
|
};
|
|
22
20
|
type OnEventData<T extends keyof EventKeyToDataMap> = {
|
|
@@ -28,6 +26,7 @@ export type ComponentViewBaseProps = {
|
|
|
28
26
|
initialPath?: string;
|
|
29
27
|
onEvent?: <T extends keyof EventKeyToDataMap>(data: OnEventData<T>) => void;
|
|
30
28
|
debug?: boolean;
|
|
29
|
+
nativeModules?: NativeModuleMap;
|
|
31
30
|
} & ({
|
|
32
31
|
/** Supply the auth strategy. Defaults to `jwe` which will require a `userToken` prop.
|
|
33
32
|
*
|
package/src/native-plugins.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type biometrics from 'react-native-biometrics';
|
|
2
|
+
import type permissions from 'react-native-permissions';
|
|
3
|
+
import type * as cameraRoll from '@react-native-camera-roll/camera-roll';
|
|
4
|
+
import type * as fileSystem from 'react-native-fs';
|
|
5
|
+
import type documentPicker from 'react-native-document-picker';
|
|
6
|
+
import type geolocation from '@react-native-community/geolocation';
|
|
7
|
+
import type * as print from 'react-native-print';
|
|
8
|
+
import type storage from '@react-native-async-storage/async-storage';
|
|
9
|
+
export type NativePackage = '@react-native-async-storage/async-storage' | '@react-native-community/geolocation' | '@react-native-camera-roll/camera-roll' | 'react-native-biometrics' | 'react-native-permissions' | 'react-native-print' | 'react-native-webview' | 'react-native-fs' | 'react-native-document-picker';
|
|
10
|
+
export type NativePackages = Array<NativePackage>;
|
|
11
|
+
export type NativeModuleMap = {
|
|
12
|
+
biometrics?: typeof biometrics;
|
|
13
|
+
permissions?: typeof permissions;
|
|
14
|
+
cameraRoll?: typeof cameraRoll;
|
|
15
|
+
fileSystem?: typeof fileSystem;
|
|
16
|
+
documentPicker?: typeof documentPicker;
|
|
17
|
+
geolocation?: typeof geolocation;
|
|
18
|
+
print?: typeof print;
|
|
19
|
+
storage?: typeof storage;
|
|
20
|
+
};
|
|
21
|
+
export type NativeModules = (keyof NativeModuleMap)[];
|