chayns-api 1.0.1 → 1.0.3

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.
Files changed (263) hide show
  1. package/.babelrc +30 -30
  2. package/.eslintrc +17 -17
  3. package/.github/workflows/deploy_docs.yml +28 -28
  4. package/.github/workflows/publish.yml +21 -0
  5. package/LICENSE +21 -21
  6. package/README.md +47 -47
  7. package/dist/cjs/calls/dialogs/alert.js +0 -2
  8. package/dist/cjs/calls/dialogs/chaynsDialog.js +2 -8
  9. package/dist/cjs/calls/dialogs/close.js +0 -2
  10. package/dist/cjs/calls/dialogs/communication.js +1 -16
  11. package/dist/cjs/calls/dialogs/confirm.js +0 -4
  12. package/dist/cjs/calls/dialogs/date.js +46 -63
  13. package/dist/cjs/calls/dialogs/dropUpAlert.js +0 -3
  14. package/dist/cjs/calls/dialogs/fileSelect.js +0 -10
  15. package/dist/cjs/calls/dialogs/iFrame.js +0 -8
  16. package/dist/cjs/calls/dialogs/index.js +0 -27
  17. package/dist/cjs/calls/dialogs/input.js +0 -6
  18. package/dist/cjs/calls/dialogs/mediaSelect.js +0 -7
  19. package/dist/cjs/calls/dialogs/open.js +0 -2
  20. package/dist/cjs/calls/dialogs/select.js +0 -9
  21. package/dist/cjs/calls/dialogs/signature.js +0 -5
  22. package/dist/cjs/calls/dialogs/toast.js +0 -3
  23. package/dist/cjs/calls/dialogs/utils/callback.js +0 -2
  24. package/dist/cjs/calls/dialogs/utils/is.js +0 -4
  25. package/dist/cjs/calls/getUserInfo.js +0 -11
  26. package/dist/cjs/calls/index.js +95 -247
  27. package/dist/cjs/calls/sendMessage.js +8 -34
  28. package/dist/cjs/calls/visibilityChangeListener.js +5 -16
  29. package/dist/cjs/components/ChaynsContext.js +2 -4
  30. package/dist/cjs/components/ChaynsProvider.js +6 -28
  31. package/dist/cjs/components/WaitUntil.js +0 -5
  32. package/dist/cjs/components/withCompatMode.js +1 -16
  33. package/dist/cjs/helper/apiListenerHelper.js +0 -9
  34. package/dist/cjs/hooks/geoLocationListener.js +6 -15
  35. package/dist/cjs/hooks/index.js +6 -16
  36. package/dist/cjs/hooks/scrollListener.js +12 -31
  37. package/dist/cjs/hooks/useAccessToken.js +2 -7
  38. package/dist/cjs/hooks/useCurrentPage.js +2 -6
  39. package/dist/cjs/hooks/useCustomData.js +2 -6
  40. package/dist/cjs/hooks/useDevice.js +2 -6
  41. package/dist/cjs/hooks/useEnvironment.js +2 -6
  42. package/dist/cjs/hooks/useFunctions.js +2 -6
  43. package/dist/cjs/hooks/useIsAdminMode.js +2 -7
  44. package/dist/cjs/hooks/useLanguage.js +2 -6
  45. package/dist/cjs/hooks/usePages.js +26 -18
  46. package/dist/cjs/hooks/useParameters.js +2 -6
  47. package/dist/cjs/hooks/useSite.js +2 -6
  48. package/dist/cjs/hooks/useUser.js +2 -7
  49. package/dist/cjs/hooks/useValues.js +2 -6
  50. package/dist/cjs/hooks/windowMetricsListener.js +6 -16
  51. package/dist/cjs/host/ChaynsHost.js +0 -10
  52. package/dist/cjs/host/iframe/HostIframe.js +23 -30
  53. package/dist/cjs/host/iframe/utils/useUpdateData.js +0 -3
  54. package/dist/cjs/host/module/ModuleHost.js +3 -13
  55. package/dist/cjs/host/module/utils/loadComponent.js +1 -18
  56. package/dist/cjs/host/module/utils/useDynamicScript.js +0 -18
  57. package/dist/cjs/index.js +0 -19
  58. package/dist/cjs/types/IChaynsReact.js +27 -48
  59. package/dist/cjs/util/appCall.js +1 -4
  60. package/dist/cjs/util/deviceHelper.js +5 -22
  61. package/dist/cjs/util/heightHelper.js +0 -9
  62. package/dist/cjs/util/postIframeForm.js +0 -5
  63. package/dist/cjs/wrapper/AppWrapper.js +323 -159
  64. package/dist/cjs/wrapper/FrameWrapper.js +219 -248
  65. package/dist/cjs/wrapper/ModuleFederationWrapper.js +2 -27
  66. package/dist/cjs/wrapper/SsrWrapper.js +0 -8
  67. package/dist/esm/calls/dialogs/alert.js +4 -4
  68. package/dist/esm/calls/dialogs/chaynsDialog.js +7 -11
  69. package/dist/esm/calls/dialogs/communication.js +15 -26
  70. package/dist/esm/calls/dialogs/confirm.js +5 -8
  71. package/dist/esm/calls/dialogs/date.js +119 -128
  72. package/dist/esm/calls/dialogs/dropUpAlert.js +1 -1
  73. package/dist/esm/calls/dialogs/fileSelect.js +23 -62
  74. package/dist/esm/calls/dialogs/iFrame.js +7 -10
  75. package/dist/esm/calls/dialogs/input.js +2 -5
  76. package/dist/esm/calls/dialogs/mediaSelect.js +18 -55
  77. package/dist/esm/calls/dialogs/open.js +2 -2
  78. package/dist/esm/calls/dialogs/select.js +5 -9
  79. package/dist/esm/calls/dialogs/signature.js +0 -2
  80. package/dist/esm/calls/dialogs/toast.js +6 -11
  81. package/dist/esm/calls/dialogs/utils/callback.js +3 -5
  82. package/dist/esm/calls/dialogs/utils/is.js +1 -3
  83. package/dist/esm/calls/getUserInfo.js +32 -92
  84. package/dist/esm/calls/index.js +297 -449
  85. package/dist/esm/calls/sendMessage.js +99 -229
  86. package/dist/esm/calls/visibilityChangeListener.js +14 -19
  87. package/dist/esm/components/ChaynsContext.js +3 -3
  88. package/dist/esm/components/ChaynsProvider.js +45 -86
  89. package/dist/esm/components/WaitUntil.js +21 -86
  90. package/dist/esm/components/withCompatMode.js +35 -77
  91. package/dist/esm/helper/apiListenerHelper.js +10 -15
  92. package/dist/esm/hooks/geoLocationListener.js +24 -50
  93. package/dist/esm/hooks/index.js +1 -1
  94. package/dist/esm/hooks/scrollListener.js +58 -94
  95. package/dist/esm/hooks/useAccessToken.js +8 -30
  96. package/dist/esm/hooks/useCurrentPage.js +4 -8
  97. package/dist/esm/hooks/useCustomData.js +4 -8
  98. package/dist/esm/hooks/useDevice.js +3 -8
  99. package/dist/esm/hooks/useEnvironment.js +3 -8
  100. package/dist/esm/hooks/useFunctions.js +4 -7
  101. package/dist/esm/hooks/useIsAdminMode.js +4 -8
  102. package/dist/esm/hooks/useLanguage.js +3 -8
  103. package/dist/esm/hooks/usePages.js +38 -31
  104. package/dist/esm/hooks/useParameters.js +3 -8
  105. package/dist/esm/hooks/useSite.js +3 -8
  106. package/dist/esm/hooks/useUser.js +3 -9
  107. package/dist/esm/hooks/useValues.js +4 -7
  108. package/dist/esm/hooks/windowMetricsListener.js +22 -48
  109. package/dist/esm/host/ChaynsHost.js +22 -29
  110. package/dist/esm/host/iframe/HostIframe.js +86 -142
  111. package/dist/esm/host/iframe/utils/useUpdateData.js +4 -6
  112. package/dist/esm/host/module/ModuleHost.js +42 -49
  113. package/dist/esm/host/module/utils/loadComponent.js +47 -85
  114. package/dist/esm/host/module/utils/useDynamicScript.js +27 -74
  115. package/dist/esm/types/IChaynsReact.js +37 -61
  116. package/dist/esm/util/appCall.js +2 -4
  117. package/dist/esm/util/deviceHelper.js +13 -37
  118. package/dist/esm/util/heightHelper.js +10 -13
  119. package/dist/esm/util/postIframeForm.js +25 -57
  120. package/dist/esm/wrapper/AppWrapper.js +385 -781
  121. package/dist/esm/wrapper/FrameWrapper.js +262 -1509
  122. package/dist/esm/wrapper/ModuleFederationWrapper.js +47 -284
  123. package/dist/esm/wrapper/SsrWrapper.js +19 -65
  124. package/dist/types/calls/dialogs/alert.d.ts +1 -1
  125. package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
  126. package/dist/types/calls/dialogs/close.d.ts +1 -1
  127. package/dist/types/calls/dialogs/communication.d.ts +3 -3
  128. package/dist/types/calls/dialogs/confirm.d.ts +13 -13
  129. package/dist/types/calls/dialogs/date.d.ts +96 -96
  130. package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
  131. package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
  132. package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
  133. package/dist/types/calls/dialogs/index.d.ts +14 -14
  134. package/dist/types/calls/dialogs/input.d.ts +15 -15
  135. package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
  136. package/dist/types/calls/dialogs/open.d.ts +1 -1
  137. package/dist/types/calls/dialogs/select.d.ts +6 -6
  138. package/dist/types/calls/dialogs/signature.d.ts +7 -7
  139. package/dist/types/calls/dialogs/toast.d.ts +1 -1
  140. package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
  141. package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
  142. package/dist/types/calls/getUserInfo.d.ts +9 -9
  143. package/dist/types/calls/index.d.ts +225 -231
  144. package/dist/types/calls/sendMessage.d.ts +13 -13
  145. package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
  146. package/dist/types/components/ChaynsContext.d.ts +3 -3
  147. package/dist/types/components/ChaynsProvider.d.ts +13 -13
  148. package/dist/types/components/WaitUntil.d.ts +7 -7
  149. package/dist/types/components/withCompatMode.d.ts +13 -13
  150. package/dist/types/helper/apiListenerHelper.d.ts +6 -6
  151. package/dist/types/hooks/geoLocationListener.d.ts +18 -18
  152. package/dist/types/hooks/index.d.ts +16 -16
  153. package/dist/types/hooks/scrollListener.d.ts +28 -28
  154. package/dist/types/hooks/useAccessToken.d.ts +5 -5
  155. package/dist/types/hooks/useCurrentPage.d.ts +4 -4
  156. package/dist/types/hooks/useCustomData.d.ts +4 -4
  157. package/dist/types/hooks/useDevice.d.ts +5 -5
  158. package/dist/types/hooks/useEnvironment.d.ts +5 -5
  159. package/dist/types/hooks/useFunctions.d.ts +5 -5
  160. package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
  161. package/dist/types/hooks/useLanguage.d.ts +5 -5
  162. package/dist/types/hooks/usePages.d.ts +18 -14
  163. package/dist/types/hooks/useParameters.d.ts +5 -5
  164. package/dist/types/hooks/useSite.d.ts +5 -5
  165. package/dist/types/hooks/useUser.d.ts +5 -5
  166. package/dist/types/hooks/useValues.d.ts +5 -5
  167. package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
  168. package/dist/types/host/ChaynsHost.d.ts +28 -28
  169. package/dist/types/host/iframe/HostIframe.d.ts +24 -24
  170. package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
  171. package/dist/types/host/module/ModuleHost.d.ts +23 -23
  172. package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
  173. package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -9
  174. package/dist/types/index.d.ts +16 -16
  175. package/dist/types/types/IChaynsReact.d.ts +622 -590
  176. package/dist/types/types/dialog.d.ts +41 -41
  177. package/dist/types/util/appCall.d.ts +2 -2
  178. package/dist/types/util/deviceHelper.d.ts +7 -7
  179. package/dist/types/util/heightHelper.d.ts +1 -1
  180. package/dist/types/util/postIframeForm.d.ts +1 -1
  181. package/dist/types/wrapper/AppWrapper.d.ts +18 -16
  182. package/dist/types/wrapper/FrameWrapper.d.ts +15 -15
  183. package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -10
  184. package/dist/types/wrapper/SsrWrapper.d.ts +11 -11
  185. package/package.json +76 -76
  186. package/toolkit.config.js +52 -52
  187. package/tsconfig.json +56 -56
  188. package/dist/cjs/bootstrap.js +0 -11
  189. package/dist/cjs/calls/abstractApiListener.js +0 -40
  190. package/dist/cjs/calls/apiEventListener.js +0 -40
  191. package/dist/cjs/calls/setVisibilityChangeListener.js +0 -1
  192. package/dist/cjs/calls/windowMetricsListener.js +0 -18
  193. package/dist/cjs/client.js +0 -93
  194. package/dist/cjs/components/App.js +0 -32
  195. package/dist/cjs/components/App.spec.js +0 -16
  196. package/dist/cjs/components/Button.js +0 -32
  197. package/dist/cjs/components/ChaynsModuleProvider.js +0 -457
  198. package/dist/cjs/components/ChaynsProviderExposed.js +0 -16
  199. package/dist/cjs/components/TestProvider.js +0 -236
  200. package/dist/cjs/components/Title.js +0 -162
  201. package/dist/cjs/functions/addApiListener.js +0 -37
  202. package/dist/cjs/functions/addGeoLocationListener.js +0 -26
  203. package/dist/cjs/functions/addScrollListener.js +0 -26
  204. package/dist/cjs/functions/addWindowMetricsListener.js +0 -37
  205. package/dist/cjs/helper/cssLoader.js +0 -28
  206. package/dist/cjs/hooks/addGeoLocationListener.js +0 -26
  207. package/dist/cjs/hooks/addScrollListener.js +0 -26
  208. package/dist/cjs/hooks/addWindowMetricsListener.js +0 -37
  209. package/dist/cjs/hooks/geoLocation.js +0 -48
  210. package/dist/cjs/hooks/useAddGeoLocationListener.js +0 -26
  211. package/dist/cjs/hooks/useAddScrollListener.js +0 -48
  212. package/dist/cjs/hooks/useAddWindowMetricsListener.js +0 -45
  213. package/dist/cjs/hooks/useAdddScrollListener.js +0 -26
  214. package/dist/cjs/hooks/windowMetrics.js +0 -45
  215. package/dist/cjs/host/HostIframe.js +0 -157
  216. package/dist/cjs/host/ModuleHost.js +0 -11
  217. package/dist/cjs/host/module/utils.js +0 -25
  218. package/dist/cjs/index.example.js +0 -7
  219. package/dist/cjs/index2.js +0 -64
  220. package/dist/cjs/types/DynamicApiImport.d.js +0 -5
  221. package/dist/cjs/types/DynamicImport.d.js +0 -5
  222. package/dist/cjs/types/chayns-components.d.js +0 -1
  223. package/dist/cjs/types/chayns-logger.d.js +0 -1
  224. package/dist/cjs/types/chayns.d.js +0 -1
  225. package/dist/cjs/types/tobit-websocket-service-client.d.js +0 -1
  226. package/dist/cjs/types/toolkit-types.d.js +0 -1
  227. package/dist/cjs/util/useFunctionsContext.js +0 -16
  228. package/dist/cjs/util/useIsAdminMode.js +0 -18
  229. package/dist/cjs/util/useUser.js +0 -16
  230. package/dist/esm/bootstrap.js +0 -4
  231. package/dist/esm/client.js +0 -8
  232. package/dist/esm/components/App.js +0 -35
  233. package/dist/esm/components/App.spec.js +0 -9
  234. package/dist/esm/components/Button.js +0 -34
  235. package/dist/esm/components/ChaynsModuleProvider.js +0 -517
  236. package/dist/esm/components/ChaynsProviderExposed.js +0 -3
  237. package/dist/esm/components/TestProvider.js +0 -308
  238. package/dist/esm/components/Title.js +0 -210
  239. package/dist/esm/helper/cssLoader.js +0 -21
  240. package/dist/esm/hooks/useAddGeoLocationListener.js +0 -18
  241. package/dist/esm/hooks/useAddScrollListener.js +0 -18
  242. package/dist/esm/hooks/useAddWindowMetricsListener.js +0 -18
  243. package/dist/esm/host/HostIframe.js +0 -153
  244. package/dist/esm/index.example.js +0 -1
  245. package/dist/esm/index2.js +0 -5
  246. package/dist/esm/types/DynamicApiImport.d.js +0 -1
  247. package/dist/esm/types/DynamicImport.d.js +0 -1
  248. package/dist/esm/types/chayns-components.d.js +0 -0
  249. package/dist/esm/types/chayns-logger.d.js +0 -0
  250. package/dist/esm/types/chayns.d.js +0 -0
  251. package/dist/esm/types/tobit-websocket-service-client.d.js +0 -0
  252. package/dist/esm/types/toolkit-types.d.js +0 -0
  253. package/dist/esm/util/useIsAdminMode.js +0 -9
  254. package/dist/esm/util/useUser.js +0 -7
  255. package/dist/types/bootstrap.d.ts +0 -1
  256. package/dist/types/client.d.ts +0 -7
  257. package/dist/types/components/App.d.ts +0 -5
  258. package/dist/types/components/Button.d.ts +0 -8
  259. package/dist/types/components/ChaynsModuleProvider.d.ts +0 -170
  260. package/dist/types/components/ChaynsProviderExposed.d.ts +0 -13
  261. package/dist/types/components/Title.d.ts +0 -3
  262. package/dist/types/host/HostIframe.d.ts +0 -20
  263. package/dist/types/index.example.d.ts +0 -0
@@ -1,231 +1,225 @@
1
- import { ChaynsApiDevice, ChaynsApiSite, UserInfo } from '../types/IChaynsReact';
2
- /**
3
- * This adds a listener to determine your location.
4
- * @category Event listener
5
- */
6
- export declare const addGeoLocationListener: (value: {
7
- timeout?: number | undefined;
8
- silent?: boolean | undefined;
9
- }, callback: (geoLocation: import("../types/IChaynsReact").GeoLocation) => void) => Promise<number>;
10
- /**
11
- * Adds a listener for scroll event by user.
12
- * @category Event listener
13
- */
14
- export declare const addScrollListener: (value: {
15
- throttle?: number | undefined;
16
- }, callback: (result: import("../types/IChaynsReact").ScrollListenerResult) => void) => Promise<number>;
17
- /**
18
- * This method will be executed when the page gets displayed or hidden.
19
- * @category Event listener
20
- */
21
- export declare const addVisibilityChangeListener: (callback: (result: import("../types/IChaynsReact").VisibilityChangeListenerResult) => void) => Promise<number>;
22
- /**
23
- * This adds a listener to get the actual height of the page.
24
- * @category Event listener
25
- */
26
- export declare const addWindowMetricsListener: (callback: (result: import("../types/IChaynsReact").WindowMetricsListenerResult) => void) => Promise<number>; /**
27
- * Allows a custom callback function to be defined
28
- */
29
- export declare const customCallbackFunction: (type: string, data: unknown) => Promise<unknown>;
30
- /**
31
- * Get the accessToken from the user.
32
- */
33
- export declare const getAccessToken: (value?: import("../types/IChaynsReact").AccessToken | undefined) => Promise<import("../types/IChaynsReact").AccessTokenResult>;
34
- /**
35
- * This method returns a list of installed share/social media apps.
36
- */
37
- export declare const getAvailableSharingServices: () => Promise<import("../types/IChaynsReact").AvailableSharingServices>;
38
- /**
39
- * This method determines your location. If you want to track a route, use addGeoLocationListener.
40
- */
41
- export declare const getGeoLocation: (value: {
42
- timeout?: number | undefined;
43
- silent?: boolean | undefined;
44
- }) => Promise<import("../types/IChaynsReact").GeoLocation>;
45
- /**
46
- * This method returns user information for a specific user.
47
- * @category User functions
48
- */
49
- export declare const getUserInfo: (value: import("../types/IChaynsReact").UserInfoQuery) => Promise<UserInfo | null>;
50
- /**
51
- * Return the current scroll position of the top frame
52
- */
53
- export declare const getScrollPosition: () => Promise<import("../types/IChaynsReact").ScrollListenerResult>;
54
- /**
55
- * Returns the window metrics.
56
- */
57
- export declare const getWindowMetrics: () => Promise<import("../types/IChaynsReact").WindowMetricsListenerResult>;
58
- /** @internal */
59
- export declare const invokeCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
60
- /** @internal */
61
- export declare const invokeDialogCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
62
- /**
63
- * This method will show a login dialog where the user has the opportunity to log in.
64
- */
65
- export declare const login: (value?: import("../types/IChaynsReact").Login | undefined, callback?: ((result: boolean) => void) | undefined, closeCallback?: (() => void) | undefined) => Promise<import("../types/IChaynsReact").LoginResult>;
66
- /**
67
- * This method will logout the user
68
- */
69
- export declare const logout: () => Promise<void>;
70
- /**
71
- * This function navigates you to the previous site.
72
- */
73
- export declare const navigateBack: () => Promise<void>;
74
- /**
75
- * The images specified in the url array is shown in gallery mode.
76
- */
77
- export declare const openImage: (value: import("../types/IChaynsReact").OpenImage) => Promise<void>;
78
- /**
79
- * Opens an URL in the chayns environment.
80
- */
81
- export declare const openUrl: (value: import("../types/IChaynsReact").OpenUrl) => Promise<void>;
82
- /**
83
- * The video specified in the URL is shown in video mode.
84
- */
85
- export declare const openVideo: (value: import("../types/IChaynsReact").OpenVideo) => Promise<void>;
86
- /**
87
- * Refresh badge count in navigation, user information and pages
88
- */
89
- export declare const refreshData: (value: import("../types/IChaynsReact").RefreshData) => Promise<void>;
90
- /**
91
- * Refresh accesstoken, should only be used when user object changes, not when token is invalid
92
- */
93
- export declare const refreshAccessToken: () => Promise<void>;
94
- /**
95
- * This removes a listener to determine your location.
96
- * @category Event listener
97
- */
98
- export declare const removeGeoLocationListener: (value: number) => Promise<void>;
99
- /**
100
- * Removes scroll listener.
101
- * @category Event listener
102
- */
103
- export declare const removeScrollListener: (value: number) => Promise<void>;
104
- /**
105
- * Removes visibility change listener.
106
- * @category Event listener
107
- */
108
- export declare const removeVisibilityChangeListener: (value: number) => Promise<void>;
109
- /**
110
- * Removes window metrics listener.
111
- * @category Event listener
112
- */
113
- export declare const removeWindowMetricsListener: (value: number) => Promise<void>;
114
- /**
115
- * Select other page on chayns site.
116
- */
117
- export declare const selectPage: (value: import("../types/IChaynsReact").SelectPage) => Promise<void>;
118
- /**
119
- * Scrolls to specific position.
120
- */
121
- export declare const scrollToY: (position: number, duration: number) => Promise<void>;
122
- /**
123
- * Sends intercom message to group.
124
- */
125
- export declare const sendMessageToGroup: (groupId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
126
- /**
127
- * Sends intercom message to page.
128
- */
129
- export declare const sendMessageToPage: (message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
130
- /**
131
- * Sends intercom message to an user.
132
- */
133
- export declare const sendMessageToUser: (userId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
134
- /**
135
- * Switches admin mode, also toggles admin switch in top frame.
136
- */
137
- export declare const setAdminMode: (enabled: boolean) => Promise<void>;
138
- /**
139
- * Sets the display timeout, only works in chayns App.
140
- */
141
- export declare const setDisplayTimeout: (enabled: boolean) => Promise<import("../types/IChaynsReact").DisplayTimeout>;
142
- /**
143
- * Enables or disables a button which floats over the page.
144
- */
145
- export declare const setFloatingButton: (value: import("../types/IChaynsReact").FloatingButton, callback: () => void) => Promise<void>;
146
- /**
147
- * Sets the height of the page.
148
- */
149
- export declare const setHeight: (height: number) => Promise<void>;
150
- /**
151
- * Enables or disables the ability to refresh a page
152
- */
153
- export declare const setRefreshScrollEnabled: (enabled: boolean) => Promise<import("../types/IChaynsReact").RefreshScrollEnabled>;
154
- /**
155
- * Scans a qr-code and returns the result
156
- */
157
- export declare const setScanQrCode: (value: import("../types/IChaynsReact").ScanQrCodeRequest) => Promise<import("../types/IChaynsReact").ScanQrCodeResult>;
158
- /**
159
- * Temporarily change design settings in top frame
160
- */
161
- export declare const setTempDesignSettings: (value: import("../types/IChaynsReact").DesignSettings) => Promise<void>;
162
- /**
163
- * Shows or hide a waitcursor
164
- */
165
- export declare const setWaitCursor: (value: import("../types/IChaynsReact").WaitCursor) => Promise<void>;
166
- /**
167
- * Retrieves the value that is assigned to the key from a storage outside the frame
168
- */
169
- export declare const storageGetItem: (key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<any>;
170
- /**
171
- * Removes the value that is assigned to the key from a storage outside the frame
172
- */
173
- export declare const storageRemoveItem: (key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<void>;
174
- /**
175
- * Sets the value that is assigned to the key from a storage outside the frame
176
- */
177
- export declare const storageSetItem: (key: string, value: any, accessMode?: import("../types/IChaynsReact").AccessMode | undefined, tappIds?: number[] | undefined) => Promise<void>;
178
- /**
179
- * This method lets a smartphone vibrate for the given time.
180
- */
181
- export declare const vibrate: (value: import("../types/IChaynsReact").Vibrate) => Promise<void>;
182
- /**
183
- * Displays an overlay
184
- */
185
- export declare const setOverlay: (value: import("../types/IChaynsReact").ShowOverlay, callback: () => void) => Promise<void>;
186
- /**
187
- * Returns user information, only when user is logged in
188
- * @category User functions
189
- */
190
- export declare const getUser: () => import("../types/IChaynsReact").ChaynsApiUser | undefined;
191
- export declare const getSite: () => ChaynsApiSite;
192
- export declare const getDevice: () => ChaynsApiDevice;
193
- export declare const getLanguage: () => {
194
- site: import("../types/IChaynsReact").Language;
195
- translation: import("../types/IChaynsReact").Language | null;
196
- /**
197
- * This method returns a list of installed share/social media apps.
198
- */
199
- device: import("../types/IChaynsReact").Language;
200
- active: import("../types/IChaynsReact").Language;
201
- };
202
- export declare const getParameters: () => {
203
- [key: string]: string;
204
- [key: symbol]: string;
205
- };
206
- export declare const getPages: () => import("../types/IChaynsReact").Page[];
207
- export declare const getEnvironment: () => {
208
- buildEnvironment: import("../types/IChaynsReact").Environment;
209
- runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
210
- };
211
- export declare const user: UserInfo;
212
- export declare const site: ChaynsApiSite;
213
- export declare const device: ChaynsApiDevice;
214
- export declare const language: {
215
- site: import("../types/IChaynsReact").Language;
216
- translation: import("../types/IChaynsReact").Language | null;
217
- /**
218
- * This method returns a list of installed share/social media apps.
219
- */
220
- device: import("../types/IChaynsReact").Language;
221
- active: import("../types/IChaynsReact").Language;
222
- };
223
- export declare const parameters: {
224
- [key: string]: string;
225
- [key: symbol]: string;
226
- };
227
- export declare const pages: import("../types/IChaynsReact").Page[];
228
- export declare const environment: {
229
- buildEnvironment: import("../types/IChaynsReact").Environment;
230
- runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
231
- };
1
+ import { ChaynsApiDevice, ChaynsApiSite, UserInfo } from '../types/IChaynsReact';
2
+ /**
3
+ * This adds a listener to determine your location.
4
+ * @category Event listener
5
+ */
6
+ export declare const addGeoLocationListener: (value: {
7
+ timeout?: number | undefined;
8
+ silent?: boolean | undefined;
9
+ }, callback: (geoLocation: import("../types/IChaynsReact").GeoLocation) => void) => Promise<number>;
10
+ /**
11
+ * Adds a listener for scroll event by user.
12
+ * @category Event listener
13
+ */
14
+ export declare const addScrollListener: (value: {
15
+ throttle?: number | undefined;
16
+ }, callback: (result: import("../types/IChaynsReact").ScrollListenerResult) => void) => Promise<number>;
17
+ /**
18
+ * This method will be executed when the page gets displayed or hidden.
19
+ * @category Event listener
20
+ */
21
+ export declare const addVisibilityChangeListener: (callback: (result: import("../types/IChaynsReact").VisibilityChangeListenerResult) => void) => Promise<number>;
22
+ /**
23
+ * This adds a listener to get the actual height of the page.
24
+ * @category Event listener
25
+ */
26
+ export declare const addWindowMetricsListener: (callback: (result: import("../types/IChaynsReact").WindowMetricsListenerResult) => void) => Promise<number>; /**
27
+ * Allows a custom callback function to be defined
28
+ */
29
+ export declare const customCallbackFunction: (type: string, data: unknown) => Promise<unknown>;
30
+ /**
31
+ * Get the accessToken from the user.
32
+ */
33
+ export declare const getAccessToken: (value?: import("../types/IChaynsReact").AccessToken | undefined) => Promise<import("../types/IChaynsReact").AccessTokenResult>;
34
+ /**
35
+ * This method returns a list of installed share/social media apps.
36
+ */
37
+ export declare const getAvailableSharingServices: () => Promise<import("../types/IChaynsReact").AvailableSharingServices>;
38
+ /**
39
+ * This method determines your location. If you want to track a route, use addGeoLocationListener.
40
+ */
41
+ export declare const getGeoLocation: (value: {
42
+ timeout?: number | undefined;
43
+ silent?: boolean | undefined;
44
+ }) => Promise<import("../types/IChaynsReact").GeoLocation>;
45
+ /**
46
+ * This method returns user information for a specific user.
47
+ * @category User functions
48
+ */
49
+ export declare const getUserInfo: (value: import("../types/IChaynsReact").UserInfoQuery) => Promise<UserInfo | null>;
50
+ /**
51
+ * Return the current scroll position of the top frame
52
+ */
53
+ export declare const getScrollPosition: () => Promise<import("../types/IChaynsReact").ScrollListenerResult>;
54
+ /**
55
+ * Returns the window metrics.
56
+ */
57
+ export declare const getWindowMetrics: () => Promise<import("../types/IChaynsReact").WindowMetricsListenerResult>;
58
+ /** @internal */
59
+ export declare const invokeCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
60
+ /** @internal */
61
+ export declare const invokeDialogCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
62
+ /**
63
+ * This method will show a login dialog where the user has the opportunity to log in.
64
+ */
65
+ export declare const login: (value?: import("../types/IChaynsReact").Login | undefined, callback?: ((result: boolean) => void) | undefined, closeCallback?: (() => void) | undefined) => Promise<import("../types/IChaynsReact").LoginResult>;
66
+ /**
67
+ * This method will logout the user
68
+ */
69
+ export declare const logout: () => Promise<void>;
70
+ /**
71
+ * This function navigates you to the previous site.
72
+ */
73
+ export declare const navigateBack: () => Promise<void>;
74
+ /**
75
+ * The images specified in the url array is shown in gallery mode.
76
+ */
77
+ export declare const openImage: (value: import("../types/IChaynsReact").OpenImage) => Promise<void>;
78
+ /**
79
+ * Opens an URL in the chayns environment.
80
+ */
81
+ export declare const openUrl: (value: import("../types/IChaynsReact").OpenUrl) => Promise<void>;
82
+ /**
83
+ * The video specified in the URL is shown in video mode.
84
+ */
85
+ export declare const openVideo: (value: import("../types/IChaynsReact").OpenVideo) => Promise<void>;
86
+ /**
87
+ * Refresh badge count in navigation, user information and pages
88
+ */
89
+ export declare const refreshData: (value: import("../types/IChaynsReact").RefreshData) => Promise<void>;
90
+ /**
91
+ * Refresh accesstoken, should only be used when user object changes, not when token is invalid
92
+ */
93
+ export declare const refreshAccessToken: () => Promise<void>;
94
+ /**
95
+ * This removes a listener to determine your location.
96
+ * @category Event listener
97
+ */
98
+ export declare const removeGeoLocationListener: (value: number) => Promise<void>;
99
+ /**
100
+ * Removes scroll listener.
101
+ * @category Event listener
102
+ */
103
+ export declare const removeScrollListener: (value: number) => Promise<void>;
104
+ /**
105
+ * Removes visibility change listener.
106
+ * @category Event listener
107
+ */
108
+ export declare const removeVisibilityChangeListener: (value: number) => Promise<void>;
109
+ /**
110
+ * Removes window metrics listener.
111
+ * @category Event listener
112
+ */
113
+ export declare const removeWindowMetricsListener: (value: number) => Promise<void>;
114
+ /**
115
+ * Select other page on chayns site.
116
+ */
117
+ export declare const selectPage: (value: import("../types/IChaynsReact").SelectPage) => Promise<void>;
118
+ /**
119
+ * Scrolls to specific position.
120
+ */
121
+ export declare const scrollToY: (position: number, duration: number) => Promise<void>;
122
+ /**
123
+ * Sends intercom message to group.
124
+ */
125
+ export declare const sendMessageToGroup: (groupId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
126
+ /**
127
+ * Sends intercom message to page.
128
+ */
129
+ export declare const sendMessageToPage: (message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
130
+ /**
131
+ * Sends intercom message to an user.
132
+ */
133
+ export declare const sendMessageToUser: (userId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
134
+ /**
135
+ * Switches admin mode, also toggles admin switch in top frame.
136
+ */
137
+ export declare const setAdminMode: (enabled: boolean) => Promise<void>;
138
+ /**
139
+ * Sets the display timeout, only works in chayns App.
140
+ */
141
+ export declare const setDisplayTimeout: (enabled: boolean) => Promise<import("../types/IChaynsReact").DisplayTimeout>;
142
+ /**
143
+ * Enables or disables a button which floats over the page.
144
+ */
145
+ export declare const setFloatingButton: (value: import("../types/IChaynsReact").FloatingButton, callback: () => void) => Promise<void>;
146
+ /**
147
+ * Sets the height of the page.
148
+ */
149
+ export declare const setHeight: (height: number) => Promise<void>;
150
+ /**
151
+ * Enables or disables the ability to refresh a page
152
+ */
153
+ export declare const setRefreshScrollEnabled: (enabled: boolean) => Promise<import("../types/IChaynsReact").RefreshScrollEnabled>;
154
+ /**
155
+ * Scans a qr-code and returns the result
156
+ */
157
+ export declare const setScanQrCode: (value: import("../types/IChaynsReact").ScanQrCodeRequest) => Promise<import("../types/IChaynsReact").ScanQrCodeResult>;
158
+ /**
159
+ * Temporarily change design settings in top frame
160
+ */
161
+ export declare const setTempDesignSettings: (value: import("../types/IChaynsReact").DesignSettings) => Promise<void>;
162
+ /**
163
+ * Shows or hide a waitcursor
164
+ */
165
+ export declare const setWaitCursor: (value: import("../types/IChaynsReact").WaitCursor) => Promise<void>;
166
+ /**
167
+ * Retrieves the value that is assigned to the key from a storage outside the frame
168
+ */
169
+ export declare const storageGetItem: (key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<any>;
170
+ /**
171
+ * Removes the value that is assigned to the key from a storage outside the frame
172
+ */
173
+ export declare const storageRemoveItem: (key: string, accessMode?: import("../types/IChaynsReact").AccessMode | undefined) => Promise<void>;
174
+ /**
175
+ * Sets the value that is assigned to the key from a storage outside the frame
176
+ */
177
+ export declare const storageSetItem: (key: string, value: any, accessMode?: import("../types/IChaynsReact").AccessMode | undefined, tappIds?: number[] | undefined) => Promise<void>;
178
+ /**
179
+ * This method lets a smartphone vibrate for the given time.
180
+ */
181
+ export declare const vibrate: (value: import("../types/IChaynsReact").Vibrate) => Promise<void>;
182
+ /**
183
+ * Displays an overlay
184
+ */
185
+ export declare const setOverlay: (value: import("../types/IChaynsReact").ShowOverlay, callback: () => void) => Promise<void>;
186
+ /**
187
+ * Returns user information, only when user is logged in
188
+ * @category User functions
189
+ */
190
+ export declare const getUser: () => import("../types/IChaynsReact").ChaynsApiUser | undefined;
191
+ export declare const getSite: () => ChaynsApiSite;
192
+ export declare const getDevice: () => ChaynsApiDevice;
193
+ export declare const getLanguage: () => {
194
+ site: import("../types/IChaynsReact").Language;
195
+ translation: import("../types/IChaynsReact").Language | null;
196
+ device: import("../types/IChaynsReact").Language;
197
+ active: import("../types/IChaynsReact").Language;
198
+ };
199
+ export declare const getParameters: () => {
200
+ [key: string]: string;
201
+ [key: symbol]: string;
202
+ };
203
+ export declare const getPages: () => import("../types/IChaynsReact").Page[];
204
+ export declare const getEnvironment: () => {
205
+ buildEnvironment: import("../types/IChaynsReact").Environment;
206
+ runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
207
+ };
208
+ export declare const user: UserInfo;
209
+ export declare const site: ChaynsApiSite;
210
+ export declare const device: ChaynsApiDevice;
211
+ export declare const language: {
212
+ site: import("../types/IChaynsReact").Language;
213
+ translation: import("../types/IChaynsReact").Language | null;
214
+ device: import("../types/IChaynsReact").Language;
215
+ active: import("../types/IChaynsReact").Language;
216
+ };
217
+ export declare const parameters: {
218
+ [key: string]: string;
219
+ [key: symbol]: string;
220
+ };
221
+ export declare const pages: import("../types/IChaynsReact").Page[];
222
+ export declare const environment: {
223
+ buildEnvironment: import("../types/IChaynsReact").Environment;
224
+ runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
225
+ };
@@ -1,13 +1,13 @@
1
- import type { IChaynsReact, IntercomMessage } from '../types/IChaynsReact';
2
- /**
3
- * @category Intercom functions
4
- */
5
- export declare const sendMessageToUser: (api: IChaynsReact, object: IntercomMessage, receiverUserId: number) => Promise<Response>;
6
- /**
7
- * @category Intercom functions
8
- */
9
- export declare const sendMessageToPage: (api: IChaynsReact, object: IntercomMessage) => Promise<Response>;
10
- /**
11
- * @category Intercom functions
12
- */
13
- export declare const sendMessageToGroup: (api: IChaynsReact, object: IntercomMessage, groupId: number) => Promise<Response>;
1
+ import type { IChaynsReact, IntercomMessage } from '../types/IChaynsReact';
2
+ /**
3
+ * @category Intercom functions
4
+ */
5
+ export declare const sendMessageToUser: (api: IChaynsReact, object: IntercomMessage, receiverUserId: number) => Promise<Response>;
6
+ /**
7
+ * @category Intercom functions
8
+ */
9
+ export declare const sendMessageToPage: (api: IChaynsReact, object: IntercomMessage) => Promise<Response>;
10
+ /**
11
+ * @category Intercom functions
12
+ */
13
+ export declare const sendMessageToGroup: (api: IChaynsReact, object: IntercomMessage, groupId: number) => Promise<Response>;
@@ -1,9 +1,9 @@
1
- import { VisibilityChangeListenerResult } from '../types/IChaynsReact';
2
- /**
3
- * @category Event listener
4
- */
5
- export declare const addVisibilityChangeListener: (callback: (result: VisibilityChangeListenerResult) => void) => number;
6
- /**
7
- * @category Event listener
8
- */
9
- export declare const removeVisibilityChangeListener: (id: number) => void;
1
+ import { VisibilityChangeListenerResult } from '../types/IChaynsReact';
2
+ /**
3
+ * @category Event listener
4
+ */
5
+ export declare const addVisibilityChangeListener: (callback: (result: VisibilityChangeListenerResult) => void) => number;
6
+ /**
7
+ * @category Event listener
8
+ */
9
+ export declare const removeVisibilityChangeListener: (id: number) => void;
@@ -1,3 +1,3 @@
1
- import { ChaynsReactFunctions, ChaynsReactValues } from '../types/IChaynsReact';
2
- export declare const ChaynsContext: import("use-context-selector").Context<ChaynsReactValues | null>;
3
- export declare const ChaynsFunctionsContext: import("use-context-selector").Context<ChaynsReactFunctions>;
1
+ import { ChaynsReactFunctions, ChaynsReactValues } from '../types/IChaynsReact';
2
+ export declare const ChaynsContext: import("use-context-selector").Context<ChaynsReactValues | null>;
3
+ export declare const ChaynsFunctionsContext: import("use-context-selector").Context<ChaynsReactFunctions>;
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
- import { ChaynsReactFunctions, ChaynsReactValues, IChaynsReact } from '../types/IChaynsReact';
3
- export declare const moduleWrapper: {
4
- current: IChaynsReact;
5
- };
6
- declare type ChaynsProviderProps = {
7
- data?: ChaynsReactValues;
8
- functions?: ChaynsReactFunctions;
9
- renderedByServer?: boolean;
10
- isModule?: boolean;
11
- };
12
- declare const ChaynsProvider: React.FC<ChaynsProviderProps>;
13
- export default ChaynsProvider;
1
+ import React from 'react';
2
+ import { ChaynsReactFunctions, ChaynsReactValues, IChaynsReact } from '../types/IChaynsReact';
3
+ export declare const moduleWrapper: {
4
+ current: IChaynsReact;
5
+ };
6
+ type ChaynsProviderProps = {
7
+ data?: ChaynsReactValues;
8
+ functions?: ChaynsReactFunctions;
9
+ renderedByServer?: boolean;
10
+ isModule?: boolean;
11
+ };
12
+ declare const ChaynsProvider: React.FC<ChaynsProviderProps>;
13
+ export default ChaynsProvider;
@@ -1,7 +1,7 @@
1
- import { FC, ReactNode } from "react";
2
- declare type TaskList = (TaskList | Promise<unknown> | (() => Promise<unknown>))[];
3
- export declare const WaitUntil: FC<{
4
- tasks: TaskList;
5
- loadingComponent?: ReactNode;
6
- }>;
7
- export {};
1
+ import { FC, ReactNode } from "react";
2
+ type TaskList = (TaskList | Promise<unknown> | (() => Promise<unknown>))[];
3
+ export declare const WaitUntil: FC<{
4
+ tasks: TaskList;
5
+ loadingComponent?: ReactNode;
6
+ }>;
7
+ export {};
@@ -1,13 +1,13 @@
1
- import React, { RefObject } from 'react';
2
- declare type Props = {
3
- innerRef?: RefObject<unknown>;
4
- } & object;
5
- export declare const withCompatMode: <P extends Props>(Component: React.ComponentType<P>) => {
6
- Component: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
7
- CompatComponent: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
8
- requiredVersion: any;
9
- environment: string | undefined;
10
- buildEnv: string | undefined;
11
- appVersion: string | undefined;
12
- };
13
- export {};
1
+ import React, { RefObject } from 'react';
2
+ type Props = {
3
+ innerRef?: RefObject<unknown>;
4
+ } & object;
5
+ export declare const withCompatMode: <P extends Props>(Component: React.ComponentType<P>) => {
6
+ Component: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
7
+ CompatComponent: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
8
+ requiredVersion: any;
9
+ environment: string | undefined;
10
+ buildEnv: string | undefined;
11
+ appVersion: string | undefined;
12
+ };
13
+ export {};
@@ -1,6 +1,6 @@
1
- export declare const addApiListener: (key: string, callback: (result: any) => unknown | void) => {
2
- id: number;
3
- shouldInitialize: boolean;
4
- };
5
- export declare const removeApiListener: (key: string, id: number) => boolean;
6
- export declare const dispatchApiEvent: (key: string, value: unknown) => void;
1
+ export declare const addApiListener: (key: string, callback: (result: any) => unknown | void) => {
2
+ id: number;
3
+ shouldInitialize: boolean;
4
+ };
5
+ export declare const removeApiListener: (key: string, id: number) => boolean;
6
+ export declare const dispatchApiEvent: (key: string, value: unknown) => void;
@@ -1,18 +1,18 @@
1
- import { GeoLocation } from '../types/IChaynsReact';
2
- /**
3
- * @category Hooks
4
- */
5
- export declare const useGeoLocationListener: () => (value: {
6
- timeout?: number;
7
- silent?: boolean;
8
- }, callback: (result: GeoLocation) => void) => () => void;
9
- /**
10
- * @category Hooks
11
- */
12
- export declare const useGeoLocation: ({ enabled, timeout, silent }?: {
13
- enabled?: boolean | undefined;
14
- timeout?: number | undefined;
15
- silent?: boolean | undefined;
16
- }) => {
17
- value: GeoLocation | null;
18
- };
1
+ import { GeoLocation } from '../types/IChaynsReact';
2
+ /**
3
+ * @category Hooks
4
+ */
5
+ export declare const useGeoLocationListener: () => (value: {
6
+ timeout?: number;
7
+ silent?: boolean;
8
+ }, callback: (result: GeoLocation) => void) => () => void;
9
+ /**
10
+ * @category Hooks
11
+ */
12
+ export declare const useGeoLocation: ({ enabled, timeout, silent }?: {
13
+ enabled?: boolean | undefined;
14
+ timeout?: number | undefined;
15
+ silent?: boolean | undefined;
16
+ }) => {
17
+ value: GeoLocation | null;
18
+ };