chayns-api 1.0.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.
Files changed (205) hide show
  1. package/.babelrc +30 -0
  2. package/.eslintrc +17 -0
  3. package/.github/workflows/deploy_docs.yml +28 -0
  4. package/LICENSE +21 -0
  5. package/README.md +47 -0
  6. package/dist/cjs/calls/dialogs/alert.js +19 -0
  7. package/dist/cjs/calls/dialogs/chaynsDialog.js +59 -0
  8. package/dist/cjs/calls/dialogs/close.js +13 -0
  9. package/dist/cjs/calls/dialogs/communication.js +71 -0
  10. package/dist/cjs/calls/dialogs/confirm.js +33 -0
  11. package/dist/cjs/calls/dialogs/date.js +187 -0
  12. package/dist/cjs/calls/dialogs/dropUpAlert.js +12 -0
  13. package/dist/cjs/calls/dialogs/fileSelect.js +39 -0
  14. package/dist/cjs/calls/dialogs/iFrame.js +43 -0
  15. package/dist/cjs/calls/dialogs/index.js +178 -0
  16. package/dist/cjs/calls/dialogs/input.js +33 -0
  17. package/dist/cjs/calls/dialogs/mediaSelect.js +27 -0
  18. package/dist/cjs/calls/dialogs/open.js +19 -0
  19. package/dist/cjs/calls/dialogs/select.js +55 -0
  20. package/dist/cjs/calls/dialogs/signature.js +24 -0
  21. package/dist/cjs/calls/dialogs/toast.js +18 -0
  22. package/dist/cjs/calls/dialogs/utils/callback.js +12 -0
  23. package/dist/cjs/calls/dialogs/utils/environment.js +10 -0
  24. package/dist/cjs/calls/dialogs/utils/is.js +21 -0
  25. package/dist/cjs/calls/getUserInfo.js +40 -0
  26. package/dist/cjs/calls/index.js +300 -0
  27. package/dist/cjs/calls/sendMessage.js +120 -0
  28. package/dist/cjs/calls/visibilityChangeListener.js +38 -0
  29. package/dist/cjs/client.js +93 -0
  30. package/dist/cjs/components/ChaynsContext.js +12 -0
  31. package/dist/cjs/components/ChaynsModuleProvider.js +457 -0
  32. package/dist/cjs/components/ChaynsProvider.js +116 -0
  33. package/dist/cjs/components/WaitUntil.js +31 -0
  34. package/dist/cjs/components/withCompatMode.js +55 -0
  35. package/dist/cjs/helper/apiListenerHelper.js +34 -0
  36. package/dist/cjs/hooks/geoLocationListener.js +50 -0
  37. package/dist/cjs/hooks/index.js +153 -0
  38. package/dist/cjs/hooks/scrollListener.js +102 -0
  39. package/dist/cjs/hooks/useAccessToken.js +28 -0
  40. package/dist/cjs/hooks/useCurrentPage.js +13 -0
  41. package/dist/cjs/hooks/useCustomData.js +13 -0
  42. package/dist/cjs/hooks/useDevice.js +13 -0
  43. package/dist/cjs/hooks/useEnvironment.js +13 -0
  44. package/dist/cjs/hooks/useFunctions.js +16 -0
  45. package/dist/cjs/hooks/useIsAdminMode.js +16 -0
  46. package/dist/cjs/hooks/useLanguage.js +13 -0
  47. package/dist/cjs/hooks/usePages.js +38 -0
  48. package/dist/cjs/hooks/useParameters.js +13 -0
  49. package/dist/cjs/hooks/useSite.js +13 -0
  50. package/dist/cjs/hooks/useUser.js +14 -0
  51. package/dist/cjs/hooks/useValues.js +16 -0
  52. package/dist/cjs/hooks/windowMetricsListener.js +58 -0
  53. package/dist/cjs/host/ChaynsHost.js +102 -0
  54. package/dist/cjs/host/iframe/HostIframe.js +133 -0
  55. package/dist/cjs/host/iframe/utils/useUpdateData.js +21 -0
  56. package/dist/cjs/host/module/ModuleHost.js +82 -0
  57. package/dist/cjs/host/module/PagemakerFrame.js +105 -0
  58. package/dist/cjs/host/module/utils/loadComponent.js +61 -0
  59. package/dist/cjs/host/module/utils/useDynamicScript.js +61 -0
  60. package/dist/cjs/index.js +117 -0
  61. package/dist/cjs/types/DynamicApiImport.d.js +5 -0
  62. package/dist/cjs/types/IChaynsReact.js +235 -0
  63. package/dist/cjs/types/dialog.js +5 -0
  64. package/dist/cjs/util/appCall.js +23 -0
  65. package/dist/cjs/util/deviceHelper.js +71 -0
  66. package/dist/cjs/util/heightHelper.js +40 -0
  67. package/dist/cjs/util/postIframeForm.js +32 -0
  68. package/dist/cjs/wrapper/AppWrapper.js +244 -0
  69. package/dist/cjs/wrapper/FrameWrapper.js +288 -0
  70. package/dist/cjs/wrapper/ModuleFederationWrapper.js +61 -0
  71. package/dist/cjs/wrapper/SsrWrapper.js +30 -0
  72. package/dist/esm/calls/dialogs/alert.js +15 -0
  73. package/dist/esm/calls/dialogs/chaynsDialog.js +48 -0
  74. package/dist/esm/calls/dialogs/close.js +7 -0
  75. package/dist/esm/calls/dialogs/communication.js +66 -0
  76. package/dist/esm/calls/dialogs/confirm.js +30 -0
  77. package/dist/esm/calls/dialogs/date.js +211 -0
  78. package/dist/esm/calls/dialogs/dropUpAlert.js +7 -0
  79. package/dist/esm/calls/dialogs/fileSelect.js +32 -0
  80. package/dist/esm/calls/dialogs/iFrame.js +37 -0
  81. package/dist/esm/calls/dialogs/index.js +14 -0
  82. package/dist/esm/calls/dialogs/input.js +26 -0
  83. package/dist/esm/calls/dialogs/mediaSelect.js +22 -0
  84. package/dist/esm/calls/dialogs/open.js +13 -0
  85. package/dist/esm/calls/dialogs/select.js +47 -0
  86. package/dist/esm/calls/dialogs/signature.js +18 -0
  87. package/dist/esm/calls/dialogs/toast.js +13 -0
  88. package/dist/esm/calls/dialogs/utils/callback.js +7 -0
  89. package/dist/esm/calls/dialogs/utils/environment.js +3 -0
  90. package/dist/esm/calls/dialogs/utils/is.js +12 -0
  91. package/dist/esm/calls/getUserInfo.js +33 -0
  92. package/dist/esm/calls/index.js +323 -0
  93. package/dist/esm/calls/sendMessage.js +111 -0
  94. package/dist/esm/calls/visibilityChangeListener.js +30 -0
  95. package/dist/esm/client.js +8 -0
  96. package/dist/esm/components/ChaynsContext.js +4 -0
  97. package/dist/esm/components/ChaynsModuleProvider.js +517 -0
  98. package/dist/esm/components/ChaynsProvider.js +109 -0
  99. package/dist/esm/components/WaitUntil.js +25 -0
  100. package/dist/esm/components/withCompatMode.js +47 -0
  101. package/dist/esm/helper/apiListenerHelper.js +25 -0
  102. package/dist/esm/hooks/geoLocationListener.js +43 -0
  103. package/dist/esm/hooks/index.js +16 -0
  104. package/dist/esm/hooks/scrollListener.js +95 -0
  105. package/dist/esm/hooks/useAccessToken.js +22 -0
  106. package/dist/esm/hooks/useCurrentPage.js +7 -0
  107. package/dist/esm/hooks/useCustomData.js +7 -0
  108. package/dist/esm/hooks/useDevice.js +6 -0
  109. package/dist/esm/hooks/useEnvironment.js +6 -0
  110. package/dist/esm/hooks/useFunctions.js +9 -0
  111. package/dist/esm/hooks/useIsAdminMode.js +9 -0
  112. package/dist/esm/hooks/useLanguage.js +6 -0
  113. package/dist/esm/hooks/usePages.js +32 -0
  114. package/dist/esm/hooks/useParameters.js +6 -0
  115. package/dist/esm/hooks/useSite.js +6 -0
  116. package/dist/esm/hooks/useUser.js +7 -0
  117. package/dist/esm/hooks/useValues.js +9 -0
  118. package/dist/esm/hooks/windowMetricsListener.js +51 -0
  119. package/dist/esm/host/ChaynsHost.js +95 -0
  120. package/dist/esm/host/iframe/HostIframe.js +124 -0
  121. package/dist/esm/host/iframe/utils/useUpdateData.js +14 -0
  122. package/dist/esm/host/module/ModuleHost.js +74 -0
  123. package/dist/esm/host/module/PagemakerFrame.js +97 -0
  124. package/dist/esm/host/module/utils/loadComponent.js +55 -0
  125. package/dist/esm/host/module/utils/useDynamicScript.js +50 -0
  126. package/dist/esm/index.js +16 -0
  127. package/dist/esm/types/DynamicApiImport.d.js +1 -0
  128. package/dist/esm/types/IChaynsReact.js +215 -0
  129. package/dist/esm/types/dialog.js +1 -0
  130. package/dist/esm/util/appCall.js +16 -0
  131. package/dist/esm/util/deviceHelper.js +62 -0
  132. package/dist/esm/util/heightHelper.js +32 -0
  133. package/dist/esm/util/postIframeForm.js +26 -0
  134. package/dist/esm/wrapper/AppWrapper.js +241 -0
  135. package/dist/esm/wrapper/FrameWrapper.js +279 -0
  136. package/dist/esm/wrapper/ModuleFederationWrapper.js +56 -0
  137. package/dist/esm/wrapper/SsrWrapper.js +23 -0
  138. package/dist/types/calls/dialogs/alert.d.ts +1 -0
  139. package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -0
  140. package/dist/types/calls/dialogs/close.d.ts +1 -0
  141. package/dist/types/calls/dialogs/communication.d.ts +3 -0
  142. package/dist/types/calls/dialogs/confirm.d.ts +13 -0
  143. package/dist/types/calls/dialogs/date.d.ts +96 -0
  144. package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -0
  145. package/dist/types/calls/dialogs/fileSelect.d.ts +16 -0
  146. package/dist/types/calls/dialogs/iFrame.d.ts +10 -0
  147. package/dist/types/calls/dialogs/index.d.ts +14 -0
  148. package/dist/types/calls/dialogs/input.d.ts +15 -0
  149. package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -0
  150. package/dist/types/calls/dialogs/open.d.ts +1 -0
  151. package/dist/types/calls/dialogs/select.d.ts +6 -0
  152. package/dist/types/calls/dialogs/signature.d.ts +7 -0
  153. package/dist/types/calls/dialogs/toast.d.ts +1 -0
  154. package/dist/types/calls/dialogs/utils/callback.d.ts +1 -0
  155. package/dist/types/calls/dialogs/utils/environment.d.ts +3 -0
  156. package/dist/types/calls/dialogs/utils/is.d.ts +4 -0
  157. package/dist/types/calls/getUserInfo.d.ts +9 -0
  158. package/dist/types/calls/index.d.ts +231 -0
  159. package/dist/types/calls/sendMessage.d.ts +13 -0
  160. package/dist/types/calls/visibilityChangeListener.d.ts +9 -0
  161. package/dist/types/client.d.ts +7 -0
  162. package/dist/types/components/ChaynsContext.d.ts +3 -0
  163. package/dist/types/components/ChaynsModuleProvider.d.ts +170 -0
  164. package/dist/types/components/ChaynsProvider.d.ts +13 -0
  165. package/dist/types/components/WaitUntil.d.ts +7 -0
  166. package/dist/types/components/withCompatMode.d.ts +13 -0
  167. package/dist/types/helper/apiListenerHelper.d.ts +6 -0
  168. package/dist/types/hooks/geoLocationListener.d.ts +18 -0
  169. package/dist/types/hooks/index.d.ts +16 -0
  170. package/dist/types/hooks/scrollListener.d.ts +28 -0
  171. package/dist/types/hooks/useAccessToken.d.ts +5 -0
  172. package/dist/types/hooks/useCurrentPage.d.ts +4 -0
  173. package/dist/types/hooks/useCustomData.d.ts +4 -0
  174. package/dist/types/hooks/useDevice.d.ts +5 -0
  175. package/dist/types/hooks/useEnvironment.d.ts +5 -0
  176. package/dist/types/hooks/useFunctions.d.ts +5 -0
  177. package/dist/types/hooks/useIsAdminMode.d.ts +4 -0
  178. package/dist/types/hooks/useLanguage.d.ts +5 -0
  179. package/dist/types/hooks/usePages.d.ts +14 -0
  180. package/dist/types/hooks/useParameters.d.ts +5 -0
  181. package/dist/types/hooks/useSite.d.ts +5 -0
  182. package/dist/types/hooks/useUser.d.ts +5 -0
  183. package/dist/types/hooks/useValues.d.ts +5 -0
  184. package/dist/types/hooks/windowMetricsListener.d.ts +11 -0
  185. package/dist/types/host/ChaynsHost.d.ts +27 -0
  186. package/dist/types/host/iframe/HostIframe.d.ts +24 -0
  187. package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -0
  188. package/dist/types/host/module/ModuleHost.d.ts +23 -0
  189. package/dist/types/host/module/PagemakerFrame.d.ts +22 -0
  190. package/dist/types/host/module/utils/loadComponent.d.ts +1 -0
  191. package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -0
  192. package/dist/types/index.d.ts +16 -0
  193. package/dist/types/types/IChaynsReact.d.ts +590 -0
  194. package/dist/types/types/dialog.d.ts +41 -0
  195. package/dist/types/util/appCall.d.ts +2 -0
  196. package/dist/types/util/deviceHelper.d.ts +7 -0
  197. package/dist/types/util/heightHelper.d.ts +1 -0
  198. package/dist/types/util/postIframeForm.d.ts +1 -0
  199. package/dist/types/wrapper/AppWrapper.d.ts +16 -0
  200. package/dist/types/wrapper/FrameWrapper.d.ts +15 -0
  201. package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -0
  202. package/dist/types/wrapper/SsrWrapper.d.ts +11 -0
  203. package/package.json +76 -0
  204. package/toolkit.config.js +52 -0
  205. package/tsconfig.json +56 -0
@@ -0,0 +1,96 @@
1
+ import { DialogButton, DialogTextBlock, IntervalItem, WeekDayIntervalObject } from "../../types/dialog";
2
+ /**
3
+ * The config object for date dialog
4
+ * @typedef {Object} dateConfig
5
+ * @property {Date} preSelect - The date object which should be preselected.
6
+ * @property {Date} minDate - The min date which you could select.
7
+ * @property {Date} maxDate - The max date which you could select.
8
+ * @property {dateDialogType} dateType - The type of dialog you want to display.
9
+ * @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
10
+ * @property {string} message - The message that is displayed above the date dialog, only in apps supported
11
+ * @property {string} title - The title that is displayed above the message, only in apps supported
12
+ */
13
+ /**
14
+ * This call will open a date select dialog.
15
+ * <div>Call: 30</div>
16
+ * @param {dateConfig} config - Define the configuration of this call
17
+ * @return {Promise} contains a timestamp as result
18
+ * @example chayns.dialog.date({
19
+ * 'dateType': chayns.dialog.dateType.DATE_TIME,
20
+ * 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
21
+ * 'minDate': new Date(2018, 6, 1, 15, 0, 0),
22
+ * 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
23
+ * 'minuteInterval': 15
24
+ * ).then(function (data) {
25
+ * console.log(data);
26
+ * });
27
+ */
28
+ type DateConfig = {
29
+ title?: string;
30
+ message?: string;
31
+ buttons?: DialogButton[];
32
+ minDate?: Date | number;
33
+ maxDate?: Date | number;
34
+ minuteInterval?: number;
35
+ preSelect?: Date | undefined | number;
36
+ multiselect?: boolean;
37
+ disabledDates?: Date[] | number[];
38
+ textBlocks?: DialogTextBlock[];
39
+ yearSelect?: boolean;
40
+ monthSelect?: boolean;
41
+ interval?: boolean;
42
+ minInterval?: number;
43
+ maxInterval?: number;
44
+ disabledIntervals?: Array<IntervalItem>;
45
+ disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
46
+ getLocalTime?: boolean;
47
+ dateType?: number;
48
+ autoSelectDate?: boolean;
49
+ };
50
+ export declare function date(config?: DateConfig): Promise<any>;
51
+ type preSelectObj = {
52
+ start?: number | undefined | Date;
53
+ end?: number | undefined | Date;
54
+ };
55
+ type preSelect = preSelectObj | Date | undefined | number | number[];
56
+ type AdvancedDateConfig = {
57
+ title?: string;
58
+ message?: string;
59
+ buttons?: DialogButton[];
60
+ minDate?: Date | number;
61
+ maxDate?: Date | number;
62
+ minuteInterval?: number;
63
+ preSelect?: preSelect;
64
+ multiselect?: boolean;
65
+ disabledDates?: Date[] | number[];
66
+ textBlocks?: DialogTextBlock[];
67
+ yearSelect?: boolean;
68
+ monthSelect?: boolean;
69
+ interval?: boolean;
70
+ minInterval?: number;
71
+ maxInterval?: number;
72
+ disabledIntervals?: Array<IntervalItem>;
73
+ disabledWeekDayIntervals?: Array<WeekDayIntervalObject>[7];
74
+ getLocalTime?: boolean;
75
+ dateType?: number;
76
+ autoSelectDate?: boolean;
77
+ };
78
+ export declare function advancedDate(config?: AdvancedDateConfig): Promise<unknown>;
79
+ /**
80
+ * @typedef {number} dateDialogType
81
+ */
82
+ /**
83
+ * Enum for date dialog
84
+ * <div>DATE will open a dialog where you can select a special day</div>
85
+ * <div>TIME will open a dialog where you can only select a special time</div>
86
+ * <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
87
+ * @readonly
88
+ * @enum {dateDialogType}
89
+ * @type {{DATE: number, TIME: number, DATE_TIME: number}}
90
+ */
91
+ export declare const dateType: {
92
+ DATE: number;
93
+ TIME: number;
94
+ DATE_TIME: number;
95
+ };
96
+ export {};
@@ -0,0 +1,5 @@
1
+ type DropUpAlert = {
2
+ callType?: number;
3
+ };
4
+ export declare function dropUpAlert(dialog?: DropUpAlert): Promise<unknown>;
5
+ export {};
@@ -0,0 +1,16 @@
1
+ import { DialogButton } from "../../types/dialog";
2
+ export declare const fileType: {
3
+ IMAGE: string;
4
+ VIDEO: string;
5
+ AUDIO: string;
6
+ DOCUMENT: string[];
7
+ };
8
+ type FileSelectInput = {
9
+ buttons?: DialogButton[];
10
+ callType?: number;
11
+ multiselect?: boolean;
12
+ directory?: boolean;
13
+ chaynsToken?: string;
14
+ };
15
+ export declare function fileSelect(dialog?: FileSelectInput): Promise<unknown>;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ import { DialogButton } from "../../types/dialog";
2
+ type iFrameDialog = {
3
+ buttons?: DialogButton[];
4
+ callType?: number;
5
+ tappIframeName?: string;
6
+ url: string;
7
+ };
8
+ export declare function iFrame(dialog?: iFrameDialog): Promise<unknown>;
9
+ export declare function _chaynsCallResponder(obj: any): void;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ export { buttonText, buttonType } from './chaynsDialog';
2
+ export * from './alert';
3
+ export * from './confirm';
4
+ export * from './select';
5
+ export * from './date';
6
+ export * from './input';
7
+ export * from './close';
8
+ export * from './dropUpAlert';
9
+ export * from './iFrame';
10
+ export * from './mediaSelect';
11
+ export * from './fileSelect';
12
+ export * from './communication';
13
+ export * from './toast';
14
+ export * from './signature';
@@ -0,0 +1,15 @@
1
+ import { DialogButton } from "../../types/dialog";
2
+ type InputDialog = {
3
+ buttons?: DialogButton[];
4
+ callType?: number;
5
+ formatter?: string;
6
+ };
7
+ export declare function input(dialog?: InputDialog): Promise<unknown>;
8
+ export declare const inputType: {
9
+ DEFAULT: number;
10
+ PASSWORD: number;
11
+ TEXTAREA: number;
12
+ INPUT: number;
13
+ NUMBER: number;
14
+ };
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import { DialogButton } from "../../types/dialog";
2
+ type MediaSelectInput = {
3
+ buttons?: DialogButton[];
4
+ callType?: number;
5
+ chaynsToken?: string;
6
+ };
7
+ export declare function mediaSelect(dialog?: MediaSelectInput): Promise<unknown>;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function open(json: any): Promise<unknown>;
@@ -0,0 +1,6 @@
1
+ import { SelectInput } from '../../types/IChaynsReact';
2
+ export declare function select(config: SelectInput): Promise<unknown>;
3
+ export declare const selectType: {
4
+ DEFAULT: number;
5
+ ICON: number;
6
+ };
@@ -0,0 +1,7 @@
1
+ import { DialogButton } from "../../types/dialog";
2
+ type SignatureInput = {
3
+ buttons?: DialogButton[];
4
+ callType?: number;
5
+ };
6
+ export declare function signature(dialog?: SignatureInput): Promise<unknown>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function toast(config?: {}): Promise<any>;
@@ -0,0 +1 @@
1
+ export declare function getCallbackName(fnName: any, framePrefix?: string): string;
@@ -0,0 +1,3 @@
1
+ export declare let environment: {
2
+ language: string;
3
+ };
@@ -0,0 +1,4 @@
1
+ export declare function isObject(value: any): boolean;
2
+ export declare function isNumber(value: any): boolean;
3
+ export declare function isDate(value: any): boolean;
4
+ export declare function isPresent(value: any): boolean;
@@ -0,0 +1,9 @@
1
+ import type { IChaynsReact, UserInfoQuery } from '../types/IChaynsReact';
2
+ declare const getUserInfo: (api: IChaynsReact, value: UserInfoQuery) => Promise<{
3
+ firstName: string;
4
+ lastName: string;
5
+ userId: number;
6
+ personId: string;
7
+ name: string;
8
+ } | null>;
9
+ export default getUserInfo;
@@ -0,0 +1,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
+ /**
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
+ };
@@ -0,0 +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>;
@@ -0,0 +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;
@@ -0,0 +1,7 @@
1
+ export { default as ChaynsProvider } from './components/ChaynsModuleProvider';
2
+ export { default as ChaynsHost } from './host/ChaynsHost';
3
+ export { default as getDeviceInfo, getScreenSize } from './util/deviceHelper';
4
+ export * from './components/ChaynsModuleProvider';
5
+ export * from './components/withCompatMode';
6
+ export * as dialog from './calls/dialogs/index';
7
+ export * from './types/IChaynsReact';
@@ -0,0 +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>;