chayns-api 1.0.11 → 1.0.13
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/dist/cjs/components/withCompatMode.js +1 -1
- package/dist/cjs/wrapper/AppWrapper.js +6 -3
- package/dist/esm/components/withCompatMode.js +1 -1
- package/dist/esm/wrapper/AppWrapper.js +6 -3
- package/dist/types/calls/index.d.ts +3 -3
- package/dist/types/types/IChaynsReact.d.ts +4 -3
- package/package.json +1 -1
|
@@ -52,7 +52,7 @@ const withCompatMode = Component => {
|
|
|
52
52
|
}
|
|
53
53
|
componentWillUnmount() {
|
|
54
54
|
if (this.root) {
|
|
55
|
-
this.root.
|
|
55
|
+
this.root.unmount();
|
|
56
56
|
} else {
|
|
57
57
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), this.ref.current);
|
|
58
58
|
}
|
|
@@ -143,12 +143,13 @@ class AppWrapper {
|
|
|
143
143
|
permanent: true
|
|
144
144
|
}, {
|
|
145
145
|
callback: v => {
|
|
146
|
-
var _v$accuracy, _v$code;
|
|
146
|
+
var _v$accuracy, _v$isAccurate, _v$code;
|
|
147
147
|
(0, _apiListenerHelper.dispatchApiEvent)('geoLocationListener', {
|
|
148
148
|
latitude: v.latitude,
|
|
149
149
|
longitude: v.longitude,
|
|
150
150
|
accuracy: (_v$accuracy = v.accuracy) !== null && _v$accuracy !== void 0 ? _v$accuracy : null,
|
|
151
151
|
speed: v.speed,
|
|
152
|
+
isAccurate: (_v$isAccurate = v.isAccurate) !== null && _v$isAccurate !== void 0 ? _v$isAccurate : null,
|
|
152
153
|
code: (_v$code = v.code) !== null && _v$code !== void 0 ? _v$code : null
|
|
153
154
|
});
|
|
154
155
|
}
|
|
@@ -219,13 +220,15 @@ class AppWrapper {
|
|
|
219
220
|
};
|
|
220
221
|
},
|
|
221
222
|
getGeoLocation: async () => {
|
|
223
|
+
var _res$accuracy, _res$isAccurate, _res$code;
|
|
222
224
|
const res = await this.appCall(14);
|
|
223
225
|
return {
|
|
224
226
|
latitude: res.latitude,
|
|
225
227
|
longitude: res.longitude,
|
|
226
228
|
speed: res.speed,
|
|
227
|
-
|
|
228
|
-
isAccurate: res.isAccurate
|
|
229
|
+
accuracy: (_res$accuracy = res.accuracy) !== null && _res$accuracy !== void 0 ? _res$accuracy : null,
|
|
230
|
+
isAccurate: (_res$isAccurate = res.isAccurate) !== null && _res$isAccurate !== void 0 ? _res$isAccurate : null,
|
|
231
|
+
code: (_res$code = res.code) !== null && _res$code !== void 0 ? _res$code : null
|
|
229
232
|
};
|
|
230
233
|
},
|
|
231
234
|
getUserInfo: async query => {
|
|
@@ -45,7 +45,7 @@ export const withCompatMode = Component => {
|
|
|
45
45
|
}
|
|
46
46
|
componentWillUnmount() {
|
|
47
47
|
if (this.root) {
|
|
48
|
-
this.root.
|
|
48
|
+
this.root.unmount();
|
|
49
49
|
} else {
|
|
50
50
|
ReactDOM.render( /*#__PURE__*/React.createElement(React.Fragment, null), this.ref.current);
|
|
51
51
|
}
|
|
@@ -104,12 +104,13 @@ export class AppWrapper {
|
|
|
104
104
|
permanent: true
|
|
105
105
|
}, {
|
|
106
106
|
callback: v => {
|
|
107
|
-
var _v$accuracy, _v$code;
|
|
107
|
+
var _v$accuracy, _v$isAccurate, _v$code;
|
|
108
108
|
dispatchApiEvent('geoLocationListener', {
|
|
109
109
|
latitude: v.latitude,
|
|
110
110
|
longitude: v.longitude,
|
|
111
111
|
accuracy: (_v$accuracy = v.accuracy) !== null && _v$accuracy !== void 0 ? _v$accuracy : null,
|
|
112
112
|
speed: v.speed,
|
|
113
|
+
isAccurate: (_v$isAccurate = v.isAccurate) !== null && _v$isAccurate !== void 0 ? _v$isAccurate : null,
|
|
113
114
|
code: (_v$code = v.code) !== null && _v$code !== void 0 ? _v$code : null
|
|
114
115
|
});
|
|
115
116
|
}
|
|
@@ -180,13 +181,15 @@ export class AppWrapper {
|
|
|
180
181
|
};
|
|
181
182
|
},
|
|
182
183
|
getGeoLocation: async () => {
|
|
184
|
+
var _res$accuracy, _res$isAccurate, _res$code;
|
|
183
185
|
const res = await this.appCall(14);
|
|
184
186
|
return {
|
|
185
187
|
latitude: res.latitude,
|
|
186
188
|
longitude: res.longitude,
|
|
187
189
|
speed: res.speed,
|
|
188
|
-
|
|
189
|
-
isAccurate: res.isAccurate
|
|
190
|
+
accuracy: (_res$accuracy = res.accuracy) !== null && _res$accuracy !== void 0 ? _res$accuracy : null,
|
|
191
|
+
isAccurate: (_res$isAccurate = res.isAccurate) !== null && _res$isAccurate !== void 0 ? _res$isAccurate : null,
|
|
192
|
+
code: (_res$code = res.code) !== null && _res$code !== void 0 ? _res$code : null
|
|
190
193
|
};
|
|
191
194
|
},
|
|
192
195
|
getUserInfo: async query => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChaynsApiDevice, ChaynsApiSite, UserInfo } from '../types/IChaynsReact';
|
|
1
|
+
import { ChaynsApiDevice, ChaynsApiSite, ChaynsReactFunctions, UserInfo } from '../types/IChaynsReact';
|
|
2
2
|
/**
|
|
3
3
|
* This adds a listener to determine your location.
|
|
4
4
|
* @category Event listener
|
|
@@ -170,7 +170,7 @@ export declare const setWaitCursor: (value: import("../types/IChaynsReact").Wait
|
|
|
170
170
|
/**
|
|
171
171
|
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
172
172
|
*/
|
|
173
|
-
export declare const storageGetItem: (key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<
|
|
173
|
+
export declare const storageGetItem: <T extends string | number | object>(key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<T | undefined>;
|
|
174
174
|
/**
|
|
175
175
|
* Removes the value that is assigned to the key from a storage outside the frame
|
|
176
176
|
*/
|
|
@@ -178,7 +178,7 @@ export declare const storageRemoveItem: (key: string, accessMode?: import("../ty
|
|
|
178
178
|
/**
|
|
179
179
|
* Sets the value that is assigned to the key from a storage outside the frame
|
|
180
180
|
*/
|
|
181
|
-
export declare const storageSetItem:
|
|
181
|
+
export declare const storageSetItem: ChaynsReactFunctions["storageSetItem"];
|
|
182
182
|
/**
|
|
183
183
|
* This method lets a smartphone vibrate for the given time.
|
|
184
184
|
*/
|
|
@@ -133,9 +133,9 @@ export interface ChaynsReactFunctions {
|
|
|
133
133
|
setScanQrCode: (value: ScanQrCodeRequest) => Promise<ScanQrCodeResult>;
|
|
134
134
|
setTempDesignSettings: (value: DesignSettings) => Promise<void>;
|
|
135
135
|
setWaitCursor: (value: WaitCursor) => Promise<void>;
|
|
136
|
-
storageGetItem: (key: string, accessMode?: AccessMode) => Promise<
|
|
136
|
+
storageGetItem: <T extends object | number | string>(key: string, accessMode?: AccessMode) => Promise<T | undefined>;
|
|
137
137
|
storageRemoveItem: (key: string, accessMode?: AccessMode) => Promise<void>;
|
|
138
|
-
storageSetItem: (key: string, value:
|
|
138
|
+
storageSetItem: <T extends object | number | string>(key: string, value: T, accessMode?: AccessMode, tappIds?: number[]) => Promise<void>;
|
|
139
139
|
vibrate: (value: Vibrate) => Promise<void>;
|
|
140
140
|
scrollByY: (position: number, duration?: number) => Promise<void>;
|
|
141
141
|
setOverlay: (value: ShowOverlay, callback: () => void) => Promise<void>;
|
|
@@ -438,10 +438,11 @@ export interface RefreshScrollEnabled {
|
|
|
438
438
|
isEnabled: boolean;
|
|
439
439
|
}
|
|
440
440
|
export interface GeoLocation {
|
|
441
|
-
accuracy: number | null;
|
|
442
441
|
latitude: number;
|
|
443
442
|
longitude: number;
|
|
444
443
|
speed: number;
|
|
444
|
+
accuracy: number | null;
|
|
445
|
+
isAccurate: boolean | null;
|
|
445
446
|
code: number;
|
|
446
447
|
}
|
|
447
448
|
export type DataChangeValue = {
|