@icanbwell/types 0.41.3 → 0.42.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/frontend-telemetry.js
CHANGED
|
@@ -27,6 +27,9 @@ var ErrorCode;
|
|
|
27
27
|
// React Errors
|
|
28
28
|
/** Hook or Consumer used outside of a React Provider */
|
|
29
29
|
ErrorCode["PROVIDER_UNDEFINED"] = "PROVIDER_UNDEFINED";
|
|
30
|
+
// Permission Errors
|
|
31
|
+
/** Permission is not granted by the user */
|
|
32
|
+
ErrorCode["INSUFFICIENT_PERMISSIONS"] = "INSUFFICIENT_PERMISSIONS";
|
|
30
33
|
// Miscelaneous Errors
|
|
31
34
|
/** Configuration Error */
|
|
32
35
|
ErrorCode["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"typedoc": {
|
|
5
5
|
"entryPoint": "./src/index.ts",
|
|
6
6
|
"tsconfig": "./tsconfig.lib.json"
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"import": "./index.js"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
"repoVersion": "1.
|
|
40
|
-
"description": "@icanbwell/types. repo version: 1.
|
|
39
|
+
"repoVersion": "1.32.0",
|
|
40
|
+
"description": "@icanbwell/types. repo version: 1.32.0",
|
|
41
41
|
"module": "./index.js",
|
|
42
42
|
"main": "./index.js",
|
|
43
43
|
"type": "module",
|
|
@@ -23,6 +23,8 @@ export declare enum ErrorCode {
|
|
|
23
23
|
ROUTE_ELEMENT_UNKNOWN = "ROUTE_ELEMENT_UNKNOWN",
|
|
24
24
|
/** Hook or Consumer used outside of a React Provider */
|
|
25
25
|
PROVIDER_UNDEFINED = "PROVIDER_UNDEFINED",
|
|
26
|
+
/** Permission is not granted by the user */
|
|
27
|
+
INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS",
|
|
26
28
|
/** Configuration Error */
|
|
27
29
|
CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
|
|
28
30
|
/** Network Error */
|
package/src/native-bridge.d.ts
CHANGED
|
@@ -40,10 +40,41 @@ export interface ICamera {
|
|
|
40
40
|
requestPermission(): Promise<PermissionStatus>;
|
|
41
41
|
checkPermission(): Promise<PermissionStatus>;
|
|
42
42
|
}
|
|
43
|
+
export interface GeoOptions {
|
|
44
|
+
timeout?: number;
|
|
45
|
+
maximumAge?: number;
|
|
46
|
+
enableHighAccuracy?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface GeoError {
|
|
49
|
+
code: number;
|
|
50
|
+
message: string;
|
|
51
|
+
PERMISSION_DENIED: number;
|
|
52
|
+
POSITION_UNAVAILABLE: number;
|
|
53
|
+
TIMEOUT: number;
|
|
54
|
+
}
|
|
55
|
+
export interface GeoCoordinates {
|
|
56
|
+
latitude: number;
|
|
57
|
+
longitude: number;
|
|
58
|
+
altitude: number | null;
|
|
59
|
+
accuracy: number;
|
|
60
|
+
altitudeAccuracy: number | null;
|
|
61
|
+
heading: number | null;
|
|
62
|
+
speed: number | null;
|
|
63
|
+
}
|
|
64
|
+
export interface GeoPosition {
|
|
65
|
+
coords: GeoCoordinates;
|
|
66
|
+
timestamp: number;
|
|
67
|
+
}
|
|
68
|
+
export interface IGeolocation {
|
|
69
|
+
isAvailable(): Promise<boolean>;
|
|
70
|
+
getCurrentPosition(options?: GeoOptions): Promise<GeoPosition>;
|
|
71
|
+
requestPermission(): Promise<GlobalPermissionStatus>;
|
|
72
|
+
checkPermission(): Promise<GlobalPermissionStatus>;
|
|
73
|
+
}
|
|
43
74
|
export type PrintOptions = {
|
|
44
75
|
html: string;
|
|
45
76
|
filePath?: never;
|
|
46
|
-
}
|
|
77
|
+
} | {
|
|
47
78
|
html?: never;
|
|
48
79
|
filePath: string;
|
|
49
80
|
};
|
|
@@ -56,9 +87,11 @@ export interface INativeBridge {
|
|
|
56
87
|
events: IEvents;
|
|
57
88
|
storage: IStorage;
|
|
58
89
|
camera: ICamera;
|
|
90
|
+
geolocation: IGeolocation;
|
|
59
91
|
print: IPrint;
|
|
60
92
|
reloadView(): void;
|
|
61
93
|
}
|
|
94
|
+
export type GlobalPermissionStatus = PermissionStatus | PermissionState;
|
|
62
95
|
export type PluginKeys = Exclude<keyof INativeBridge, 'webview'>;
|
|
63
96
|
export type MethodKeys<T extends PluginKeys> = keyof INativeBridge[T];
|
|
64
97
|
export {};
|