@icanbwell/types 0.41.4 → 0.43.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.
@@ -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.41.4",
3
+ "version": "0.43.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.29.2",
40
- "description": "@icanbwell/types. repo version: 1.29.2",
39
+ "repoVersion": "1.35.0",
40
+ "description": "@icanbwell/types. repo version: 1.35.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 */
@@ -1,7 +1,7 @@
1
1
  import type rnBiometrics from 'react-native-biometrics';
2
2
  import type TypedEmitter from 'typed-emitter';
3
3
  import { OnAuthSuccessEventKey, type OnAuthSuccessEventData, ErrorEventKey, type ErrorEventData, type NativeDependenciesEventKey } from './native-components';
4
- import { PermissionStatus } from 'react-native-permissions';
4
+ import { openSettings, PermissionStatus } from 'react-native-permissions';
5
5
  import { NativeDependencies } from './native-plugins';
6
6
  export type NativeEvents<T = any> = {
7
7
  openwebview: (url: string) => void;
@@ -39,6 +39,39 @@ export interface ICamera {
39
39
  isAvailable(): Promise<boolean>;
40
40
  requestPermission(): Promise<PermissionStatus>;
41
41
  checkPermission(): Promise<PermissionStatus>;
42
+ requestRollPermission(): Promise<PermissionStatus>;
43
+ checkRollPermission(): Promise<PermissionStatus>;
44
+ }
45
+ export interface GeoOptions {
46
+ timeout?: number;
47
+ maximumAge?: number;
48
+ enableHighAccuracy?: boolean;
49
+ }
50
+ export interface GeoError {
51
+ code: number;
52
+ message: string;
53
+ PERMISSION_DENIED: number;
54
+ POSITION_UNAVAILABLE: number;
55
+ TIMEOUT: number;
56
+ }
57
+ export interface GeoCoordinates {
58
+ latitude: number;
59
+ longitude: number;
60
+ altitude: number | null;
61
+ accuracy: number;
62
+ altitudeAccuracy: number | null;
63
+ heading: number | null;
64
+ speed: number | null;
65
+ }
66
+ export interface GeoPosition {
67
+ coords: GeoCoordinates;
68
+ timestamp: number;
69
+ }
70
+ export interface IGeolocation {
71
+ isAvailable(): Promise<boolean>;
72
+ getCurrentPosition(options?: GeoOptions): Promise<GeoPosition>;
73
+ requestPermission(): Promise<GlobalPermissionStatus>;
74
+ checkPermission(): Promise<GlobalPermissionStatus>;
42
75
  }
43
76
  export type PrintOptions = {
44
77
  html: string;
@@ -50,15 +83,34 @@ export type PrintOptions = {
50
83
  export interface IPrint {
51
84
  print(options: PrintOptions): Promise<boolean>;
52
85
  }
86
+ export type DocumentPickerResult = {
87
+ type: string;
88
+ name: string;
89
+ size: number;
90
+ base64: string;
91
+ };
92
+ export interface IDocumentPicker {
93
+ pickMultiple(): Array<DocumentPickerResult>;
94
+ pickSingle(): DocumentPickerResult[];
95
+ requestPermission(): Promise<PermissionStatus>;
96
+ checkPermission(): Promise<PermissionStatus>;
97
+ }
98
+ export interface ISystem {
99
+ openSettings: typeof openSettings;
100
+ }
53
101
  export interface INativeBridge {
54
102
  webview: IWebview;
55
103
  biometrics: IBiometrics;
56
104
  events: IEvents;
57
105
  storage: IStorage;
58
106
  camera: ICamera;
107
+ geolocation: IGeolocation;
59
108
  print: IPrint;
109
+ documentPicker: IDocumentPicker;
110
+ system: ISystem;
60
111
  reloadView(): void;
61
112
  }
113
+ export type GlobalPermissionStatus = PermissionStatus | PermissionState;
62
114
  export type PluginKeys = Exclude<keyof INativeBridge, 'webview'>;
63
115
  export type MethodKeys<T extends PluginKeys> = keyof INativeBridge[T];
64
116
  export {};