@leapdevuk/component-toolbox 0.0.127 → 0.0.129

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.128 (2025-07-16)
4
+
5
+ ### Documentation
6
+
7
+ - Developer documentation add to date and time based Utility functions
8
+
3
9
  ## 0.0.127 (2025-07-16)
4
10
 
5
11
  ### Features
@@ -1,10 +1,10 @@
1
1
  export { default as LCTDatePicker } from './DatePicker';
2
+ export { dbDateOnlyFormat as lctDbDateOnlyFormat } from './utils';
3
+ export { formatAsDBDate as lctFormatAsDBDate } from './utils';
2
4
  export { formatDate as lctFormatDate } from './utils';
3
- export { lctFormatDateTime as lctFormatDateTime } from '../datepicker/utils';
5
+ export { formatDateTime as lctFormatDateTime } from './utils';
4
6
  export { formatReportDate as lctFormatReportDate } from './utils';
7
+ export { convertLocalDateToUTCDateTime as lctConvertLocalDateToUTCDateTime } from './utils';
5
8
  export { getLocale as lctGetLocale } from './utils';
6
9
  export { parseDate as lctParseDate } from './utils';
7
10
  export { utcFormat as lctUTCFormat } from './utils';
8
- export { dbDateOnlyFormat as lctDbDateOnlyFormat } from './utils';
9
- export { formatAsDBDate as lctFormatAsDBDate } from './utils';
10
- export { getFormattedLocalDateTime as lctGetFormattedLocalDateTime } from './utils';
@@ -1,134 +1,204 @@
1
1
  import { Api, LeapContext } from '@leapdev/leap-host';
2
2
  import { Locale } from 'date-fns';
3
+ /**
4
+ * This constant defines the date format used for database storage.
5
+ * It is used to ensure consistent date formatting across the application,
6
+ * especially when interacting with databases or APIs that require a specific date format.
7
+ */
8
+ export declare const dbDateOnlyFormat = "yyyy-MM-dd";
9
+ /**
10
+ * This constant defines the default date format used in the application.
11
+ * It is used for displaying dates in the user interface and for formatting dates in various components.
12
+ */
3
13
  export declare const defaultDateFormat = "dd/MM/yyyy";
14
+ /**
15
+ * This constant defines the default date and time format used in the application.
16
+ * It is used for displaying both date and time in the user interface and for formatting datetime values
17
+ */
4
18
  export declare const defaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
19
+ /**
20
+ * This constant defines the minimum date that can be used in the application.
21
+ * It is set to January 1, 1900, and is used to ensure that date inputs do not go below this value.
22
+ * It is useful for setting a minimum date in date pickers or other date-related components.
23
+ */
5
24
  export declare const minDateAsObject: Date;
25
+ /**
26
+ * This constant defines the timezone used in the application.
27
+ * It is derived from the user's system settings and is used for formatting dates and times in the user's local timezone.
28
+ * It ensures that date and time values are displayed correctly based on the user's timezone.
29
+ */
6
30
  export declare const timezone: string;
31
+ /**
32
+ * This constant defines the UTC format used for date and time values in the application.
33
+ * It is used to ensure that date and time values are stored and displayed in a consistent UTC format.
34
+ */
7
35
  export declare const utcFormat = "yyyy-MM-dd HH:mm:ss";
8
- export declare const dbDateOnlyFormat = "yyyy-MM-dd";
9
36
  /**
10
- * This function returns the minimum date as a string formatted in the default date format.
11
- * It is useful for setting a minimum date in date pickers or other date-related components.
12
- * @returns (string): The minimum date formatted as a string in the default date format.
13
- * @example
14
- * ```typescript
37
+ * This function returns the minimum date as a string formatted in the default date format.
38
+ * It is useful for setting a minimum date in date pickers or other date-related components.
39
+ * @returns (string): The minimum date formatted as a string in the default date format.
40
+ * @example
41
+ * ```typescript
15
42
  * const minDate = getMinDate(); // Returns "01/01/1900"
16
- * ```
43
+ * ```
17
44
  */
18
45
  export declare const minDate: string;
46
+ /**
47
+ * This function returns a date that is one week from today, formatted as a string.
48
+ * It is useful for scenarios where you need to calculate a date one week in the future,
49
+ * such as setting deadlines or reminders.
50
+ * @returns (string): A formatted date string representing one week from today.
51
+ * It can be used in various contexts, such as displaying future dates in a user interface or calculating due dates.
52
+ * @example
53
+ * ```typescript
54
+ * const oneWeekFromToday = getOneWeekFromToday(); // Returns "dd/MM/yyyy" format of the date one week from today
55
+ * ```
56
+ */
19
57
  export declare const oneWeek: string;
58
+ /**
59
+ * This function returns today's date formatted as a string in the default date format.
60
+ * It is useful for displaying the current date in a user interface or for date calculations.
61
+ * @returns (string): Today's date formatted as a string in the default date format.
62
+ * It can be used in various contexts, such as displaying the current date in a user interface or calculating date differences.
63
+ * @example
64
+ * ```typescript
65
+ * const todayDate = getTodayDate(); // Returns "dd/MM/yyyy" format of today's date
66
+ * ```
67
+ */
20
68
  export declare const today: string;
69
+ /**
70
+ * This function returns a date that is one day from today, formatted as a string.
71
+ * It is useful for scenarios where you need to calculate a date one day in the future,
72
+ * such as setting deadlines or reminders.
73
+ * @returns (string): A formatted date string representing tomorrow's date.
74
+ * It can be used in various contexts, such as displaying future dates in a user interface or calculating due dates.
75
+ * @example
76
+ * ```typescript
77
+ * const tomorrowDate = getTomorrowDate(); // Returns "dd/MM/yyyy" format of the date tomorrow
78
+ * ```
79
+ */
21
80
  export declare const tomorrow: string;
81
+ /**
82
+ * This function returns a date that is two weeks from today, formatted as a string.
83
+ * It is useful for scenarios where you need to calculate a date two weeks in the future,
84
+ * such as setting deadlines or reminders.
85
+ * @returns (string): A formatted date string representing two weeks from today.
86
+ * It can be used in various contexts, such as displaying future dates in a user interface or calculating due dates.
87
+ * @example
88
+ * ```typescript
89
+ * const twoWeeksFromToday = getTwoWeeksFromToday(); // Returns "dd/MM/yyyy" format of the date two weeks from today
90
+ * ```
91
+ */
22
92
  export declare const twoWeeks: string;
23
93
  /**
24
- * This function returns the current date formatted as a string based on the provided format.
25
- * @param formatString (optional) The format string to use for the date. Defaults to "dd/MM/yyyy".
26
- * It is useful for getting the current date in a specific format, such as "dd/MM/yyyy" or "MM/dd/yyyy".
27
- * If no format string is provided, it defaults to "dd/MM/yyyy".
28
- * @returns (string): The current date formatted as a string.
29
- * It can be used in various contexts, such as displaying the current date in a user interface or storing it in a database.
30
- * @example
31
- * ```typescript
94
+ * This function returns the current date formatted as a string based on the provided format.
95
+ * @param formatString (optional) The format string to use for the date. Defaults to "dd/MM/yyyy".
96
+ * It is useful for getting the current date in a specific format, such as "dd/MM/yyyy" or "MM/dd/yyyy".
97
+ * If no format string is provided, it defaults to "dd/MM/yyyy".
98
+ * @returns (string): The current date formatted as a string.
99
+ * It can be used in various contexts, such as displaying the current date in a user interface or storing it in a database.
100
+ * @example
101
+ * ```typescript
32
102
  * const formattedDate = defaultDate(); // Returns the current date in "dd/MM/yyyy" format
33
103
  * const formattedDateUS = defaultDate("MM/dd/yyyy"); // Returns the current date in "MM/dd/yyyy" format
34
- * ```
104
+ * ```
35
105
  */
36
106
  export declare const defaultDate: (formatString?: string) => string;
37
107
  /**
38
- * This function formats a date based on the provided parameters.
39
- * It can format the date to the start or end of the day, handle UTC dates,
40
- * and format it as a date-only string.
41
- * It is useful for displaying dates in a specific format,
42
- * such as in a date picker or when saving dates to a database.
43
- * @param date (Date | null | undefined): The date to format. If null or undefined, it returns null.
44
- * @param startOfDate (boolean): If true, formats the date to the start of the day.
45
- * @param endOfDate (boolean): If true, formats the date to the end of the day.
46
- * @param isUTC (boolean): If true, formats the date in UTC format.
47
- * @param dateOnly (boolean): If true, formats the date as a date-only string (e.g., "yyyy-MM-dd").
48
- * This is useful for scenarios where you need to display or store only the date part without the time.
49
- * It can be used in various contexts, such as displaying dates in a user interface or saving them to a database.
50
- * @example
51
- * ```typescript
108
+ * This function formats a date based on the provided parameters.
109
+ * It can format the date to the start or end of the day, handle UTC dates,
110
+ * and format it as a date-only string.
111
+ * It is useful for displaying dates in a specific format,
112
+ * such as in a date picker or when saving dates to a database.
113
+ * @param date (Date | null | undefined): The date to format. If null or undefined, it returns null.
114
+ * @param startOfDate (boolean): If true, formats the date to the start of the day.
115
+ * @param endOfDate (boolean): If true, formats the date to the end of the day.
116
+ * @param isUTC (boolean): If true, formats the date in UTC format.
117
+ * @param dateOnly (boolean): If true, formats the date as a date-only string (e.g., "yyyy-MM-dd").
118
+ * This is useful for scenarios where you need to display or store only the date part without the time.
119
+ * It can be used in various contexts, such as displaying dates in a user interface or saving them to a database.
120
+ * @example
121
+ * ```typescript
52
122
  * const formattedDate = formatDate(new Date(), true, false, false, true); // Formats the current date to the start of the day as a date-only string
53
123
  * const formattedUTCDate = formatDate(new Date(), false, false, true); // Formats the current date in UTC format
54
124
  * const formattedEndDate = formatDate(new Date(), false, true); // Formats the current date to the end of the day
55
- * ```
56
- * @returns (string | null): A formatted date string based on the provided parameters. If the input date is null or undefined, it returns null.
125
+ * ```
126
+ * @returns (string | null): A formatted date string based on the provided parameters. If the input date is null or undefined, it returns null.
57
127
  */
58
128
  export declare const formatDate: (date?: Date | null, startOfDate?: boolean, endOfDate?: boolean, isUTC?: boolean, dateOnly?: boolean) => string | null;
59
129
  /**
60
- * This function parses a date string into a Date object based on the provided format.
61
- * It splits the date string into parts (day, month, year) and constructs a Date object.
62
- * If the date string is invalid or cannot be parsed, it returns null.
63
- * It also handles two-digit years by converting them to four-digit years.
64
- * @param date (any): The date string to parse. It can be in various formats (e.g., "dd/MM/yyyy", "MM/dd/yyyy").
65
- * @param formatString (string): The format string to use for parsing the date.
66
- * @param localDateformat (string): The local date format to use for parsing. It should match the format of the input date string.
67
- * @param parseKeyboardVal (boolean): Whether to parse the date from a keyboard input. Defaults to false.
68
- * @returns (string | null): Returns a formatted date string if parsing is successful, or null if the input is invalid.
69
- * This function is useful for converting user input or string representations of dates into a Date object.
70
- * It can handle various date formats and ensures that the resulting Date object is valid.
71
- * If the input date string is invalid or cannot be parsed, it returns null.
72
- * It also includes logic to handle two-digit years by converting them to four-digit years.
73
- * @example
74
- * ```typescript
130
+ * This function parses a date string into a Date object based on the provided format.
131
+ * It splits the date string into parts (day, month, year) and constructs a Date object.
132
+ * If the date string is invalid or cannot be parsed, it returns null.
133
+ * It also handles two-digit years by converting them to four-digit years.
134
+ * @param date (any): The date string to parse. It can be in various formats (e.g., "dd/MM/yyyy", "MM/dd/yyyy").
135
+ * @param formatString (string): The format string to use for parsing the date.
136
+ * @param localDateformat (string): The local date format to use for parsing. It should match the format of the input date string.
137
+ * @param parseKeyboardVal (boolean): Whether to parse the date from a keyboard input. Defaults to false.
138
+ * @returns (string | null): Returns a formatted date string if parsing is successful, or null if the input is invalid.
139
+ * This function is useful for converting user input or string representations of dates into a Date object.
140
+ * It can handle various date formats and ensures that the resulting Date object is valid.
141
+ * If the input date string is invalid or cannot be parsed, it returns null.
142
+ * It also includes logic to handle two-digit years by converting them to four-digit years.
143
+ * @example
144
+ * ```typescript
75
145
  * const parsedDate = parseDate("25/12/2023", "dd/MM/yyyy", "dd/MM/yyyy");
76
146
  * console.log(parsedDate); // Returns "2023-12-25" in the "yyyy-MM-dd" format
77
147
  * const parsedDateUS = parseDate("12/25/23", "MM/dd/yyyy", "MM/dd/yyyy");
78
148
  * console.log(parsedDateUS); // Returns "2023-12-25" in the "yyyy-MM-dd" format
79
149
  * const parsedInvalidDate = parseDate("31/02/2023", "dd/MM/yyyy", "dd/MM/yyyy");
80
150
  * console.log(parsedInvalidDate); // Returns null, as February 31st is invalid
81
- * ```
151
+ * ```
82
152
  */
83
153
  export declare const parseDate: (date: any, formatString: string | undefined, localDateformat: string, parseKeyboardVal?: boolean) => string | null;
84
154
  /**
85
- * This function returns a locale object based on the provided LeapContext.
86
- * It checks the hostInfo.region and returns the corresponding locale with weekStartsOn set to 1.
87
- * If the region is not recognized, it returns undefined.
88
- * @param leapContext (LeapContext | undefined): The LeapContext object containing hostInfo with region information.
89
- * @returns The function supports UK, US, AU (including NZ), and CA regions. If the region is not recognized, it returns undefined.
90
- * @example
91
- * ```typescript
155
+ * This function returns a locale object based on the provided LeapContext.
156
+ * It checks the hostInfo.region and returns the corresponding locale with weekStartsOn set to 1.
157
+ * If the region is not recognized, it returns undefined.
158
+ * @param leapContext (LeapContext | undefined): The LeapContext object containing hostInfo with region information.
159
+ * @returns The function supports UK, US, AU (including NZ), and CA regions. If the region is not recognized, it returns undefined.
160
+ * @example
161
+ * ```typescript
92
162
  * const locale = getLocale(leapContext); // Returns the appropriate locale based on the region
93
163
  * const localeUS = getLocale({ hostInfo: { region: "us" } }); // Returns enUS locale
94
164
  * const localeUK = getLocale({ hostInfo: { region: "uk" } }); // Returns enGB locale
95
165
  * const localeAU = getLocale({ hostInfo: { region: "au" } }); // Returns enAU locale
96
166
  * const localeCA = getLocale({ hostInfo: { region: "ca" } }); // Returns enGB locale
97
- * ```
167
+ * ```
98
168
  */
99
169
  export declare const getLocale: (leapContext?: LeapContext) => Locale | undefined;
100
170
  /**
101
- * This function formats a date or datetime value into a string based on the provided locale.
102
- * It supports both date-only and datetime formats, and can handle UTC dates.
103
- * @param value (string | Date | undefined): The date or datetime value to format.
104
- * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
105
- * @param isUtc (boolean): Whether the date is in UTC format. Defaults to true.
106
- * @param dateOnly (boolean): Whether to format the value as a date only.
107
- * @param show24H (boolean): Whether to show the time in 24-hour format. Defaults to false.
108
- * @returns (string): A formatted date or datetime string. If the input value is invalid or locale is undefined, it returns an empty string.
109
- * @example
110
- * ```typescript
171
+ * This function formats a date or datetime value into a string based on the provided locale.
172
+ * It supports both date-only and datetime formats, and can handle UTC dates.
173
+ * @param inputValue (string | Date | undefined): The date or datetime value to format.
174
+ * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
175
+ * @param outputAsUtc (boolean): Whether the date is in UTC format. Defaults to true.
176
+ * @param outputAsDateOnly (boolean): Whether to format the value as a date only.
177
+ * @param outputAs24H (boolean): Whether to show the time in 24-hour format. Defaults to false.
178
+ * @returns (string): A formatted date or datetime string. If the input value is invalid or locale is undefined, it returns an empty string.
179
+ * @example
180
+ * ```typescript
111
181
  * const formattedDate = lctFormatDateTime(new Date(), enGB, true, false, true); // Returns "01/01/2023 14:30"
112
182
  * const formattedDateTime = lctFormatDateTime("2023-01-01T14:30:00Z", enUS, true, false, false); // Returns "01/01/2023 02:30 PM"
113
183
  * const formattedDateOnly = lctFormatDateTime("2023-01-01", enAU, false, true); // Returns "01/01/2023"
114
184
  * const formattedInvalid = lctFormatDateTime(undefined, enGB); // Returns ""
115
185
  * ```
116
186
  */
117
- export declare const lctFormatDateTime: (value?: string | Date, locale?: Locale, isUtc?: boolean, dateOnly?: boolean, show24H?: boolean) => string;
187
+ export declare const formatDateTime: (inputValue?: string | Date, locale?: Locale, outputAsUtc?: boolean, outputAsDateOnly?: boolean, outputAs24H?: boolean) => string;
118
188
  /**
119
- * This function formats a date string into a report-friendly format based on the provided locale.
120
- * It handles both ISO date strings and strings in the format "yyyy-MM-dd".
189
+ * This function formats a date string into a report-friendly format based on the provided locale.
190
+ * It handles both ISO date strings and strings in the format "yyyy-MM-dd".
121
191
  *
122
- * @param date (string | null): The date string to format. It can be in ISO format or "yyyy-MM-dd".
123
- * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
124
- * @returns (string): A formatted date string. If the input date is invalid or locale is undefined, it returns an empty string and logs a warning.
125
- * @example
126
- * ```typescript
192
+ * @param date (string | null): The date string to format. It can be in ISO format or "yyyy-MM-dd".
193
+ * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
194
+ * @returns (string): A formatted date string. If the input date is invalid or locale is undefined, it returns an empty string and logs a warning.
195
+ * @example
196
+ * ```typescript
127
197
  * const formattedReportDate = formatReportDate("2023-12-25", enGB); // Returns "25-12-2023"
128
198
  * const formattedReportDateISO = formatReportDate("2023-12-25T00:00:00Z", enUS); // Returns "12-25-2023"
129
199
  * const formattedReportDateInvalid = formatReportDate("31-02-2023", enGB); // Returns "", logs warning
130
200
  * const formattedReportDateNull = formatReportDate(null, enGB); // Returns "", logs warning
131
- * ```
201
+ * ```
132
202
  */
133
203
  export declare const formatReportDate: (date: string | null, locale?: Locale) => string;
134
204
  /**
@@ -136,34 +206,53 @@ export declare const formatReportDate: (date: string | null, locale?: Locale) =>
136
206
  */
137
207
  export declare const getDateTimeWithOffset: (date: string) => Date;
138
208
  /**
139
- * This function checks if a string is null or undefined.
140
- * It returns true if the string is null, undefined, or an empty string.
141
- * @param value (string | null | undefined): The string to check.
142
- * @returns (boolean): Returns true if the string is null, undefined, or empty; otherwise, false.
143
- * @example
144
- * ```typescript
209
+ * This function checks if a string is null or undefined.
210
+ * It returns true if the string is null, undefined, or an empty string.
211
+ * @param value (string | null | undefined): The string to check.
212
+ * @returns (boolean): Returns true if the string is null, undefined, or empty; otherwise, false.
213
+ * @example
214
+ * ```typescript
145
215
  * const isNullOrUndefined = isStringNullOrUndefined(null); // Returns true
146
216
  * const isEmptyString = isStringNullOrUndefined(""); // Returns true
147
217
  * const isValidString = isStringNullOrUndefined("Hello"); // Returns false
148
- * ```
218
+ * ```
149
219
  */
150
220
  export declare const isStringNullOrUndefined: (value?: string | null) => boolean;
151
221
  /**
152
- * This function formats a date as a string in the "yyyy-MM-dd" format, suitable for database storage.
153
- * It takes a Date object as input and returns the formatted string.
154
- * @param date (Date): The date to format.
155
- * @returns (string): A formatted date string in the "yyyy-MM-dd" format.
156
- * @example
157
- * ```typescript
222
+ * This function formats a date as a string in the "yyyy-MM-dd" format, suitable for database storage.
223
+ * It takes a Date object as input and returns the formatted string.
224
+ * @param date (Date): The date to format.
225
+ * @returns (string): A formatted date string in the "yyyy-MM-dd" format.
226
+ * @example
227
+ * ```typescript
158
228
  * const dbFormattedDate = formatAsDBDate(new Date()); // Returns "2023-12-25"
159
229
  * const dbFormattedDateInvalid = formatAsDBDate(new Date("Invalid Date")); // Returns "Invalid date"
160
- * ```
230
+ * ```
161
231
  */
162
232
  export declare const formatAsDBDate: (date: Date) => string;
163
- export declare const getFormattedLocalDateTime: (value?: string | Date, locale?: Locale, isUtc?: boolean, dateOnly?: boolean, show24H?: boolean, formatString?: string, formatStartOfDay?: boolean, formatEndOfDay?: boolean) => string;
164
233
  /**
165
- * This enum defines the types of buttons available in the dialog.
166
- * It is used to identify which button was clicked by the user.
234
+ * This function formats a date or datetime value into a string based on the provided locale.
235
+ * It supports both date-only and datetime formats, and can handle UTC dates.
236
+ * It also allows for formatting the start or end of the day.
237
+ * @param inputValue (string | Date | undefined): The date or datetime value to format.
238
+ * @param locale (Locale | undefined): The locale to use for formatting. If undefined, it will not format the date.
239
+ * @param outputAsStartOfDay (boolean): If true, formats the date to the start of the day.
240
+ * @param outputAsEndOfDay (boolean): If true, formats the date to the end of the day.
241
+ * @returns (string): A formatted date or datetime string. If the input value is invalid or locale is undefined, it returns an empty string.
242
+ * @example
243
+ * ```typescript
244
+ * const formattedDate = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true); // Returns "01/01/2023 14:30"
245
+ * const formattedDateTime = convertLocalDateToUTCDateTime("2023-01-01T14:30:00Z", enUS, true, false, false); // Returns "01/01/2023 02:30 PM"
246
+ * const formattedDateOnly = convertLocalDateToUTCDateTime("2023-01-01", enAU, false, true); // Returns "01/01/2023"
247
+ * const formattedInvalid = convertLocalDateToUTCDateTime(undefined, enGB); // Returns ""
248
+ * const outputAsStartOfDay = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true, undefined, true); // Returns "01/01/2023 00:00"
249
+ * const outputAsEndOfDay = convertLocalDateToUTCDateTime(new Date(), enGB, true, false, true, undefined, false, true); // Returns "01/01/2023 23:59"
250
+ * ```
251
+ */
252
+ export declare const convertLocalDateToUTCDateTime: (inputValue?: string | Date, locale?: Locale, outputAsStartOfDay?: boolean, outputAsEndOfDay?: boolean) => string;
253
+ /**
254
+ * This enum defines the types of buttons available in the dialog.
255
+ * It is used to identify which button was clicked by the user.
167
256
  */
168
257
  export declare enum DialogButtonType {
169
258
  Confirm = 1,
@@ -171,19 +260,19 @@ export declare enum DialogButtonType {
171
260
  Cancel = 3
172
261
  }
173
262
  /**
174
- * This function shows a 3-button alert dialog using the Leap SDK.
175
- * It allows the user to confirm, refuse, or cancel an action.
176
- * It takes a message, button texts, and callbacks for each action.
177
- * @param message (string): The message to display in the dialog.
178
- * @param confirmButtonText (string): The text for the confirm button.
179
- * @param confirmCallback (function): The callback function to execute when the confirm button is clicked.
180
- * @param refuseButtonText (string): The text for the refuse button. Optional.
181
- * @param refuseCallback (function): The callback function to execute when the refuse button is clicked. Optional.
182
- * @param cancelButtonText (string): The text for the cancel button. Optional.
183
- * @param sdkApi (Api): The Leap SDK API instance to use for showing the dialog.
184
- * @returns A promise that resolves when the dialog is closed.
185
- * @example
186
- * ```typescript
263
+ * This function shows a 3-button alert dialog using the Leap SDK.
264
+ * It allows the user to confirm, refuse, or cancel an action.
265
+ * It takes a message, button texts, and callbacks for each action.
266
+ * @param message (string): The message to display in the dialog.
267
+ * @param confirmButtonText (string): The text for the confirm button.
268
+ * @param confirmCallback (function): The callback function to execute when the confirm button is clicked.
269
+ * @param refuseButtonText (string): The text for the refuse button. Optional.
270
+ * @param refuseCallback (function): The callback function to execute when the refuse button is clicked. Optional.
271
+ * @param cancelButtonText (string): The text for the cancel button. Optional.
272
+ * @param sdkApi (Api): The Leap SDK API instance to use for showing the dialog.
273
+ * @returns A promise that resolves when the dialog is closed.
274
+ * @example
275
+ * ```typescript
187
276
  * show3buttonAlert(
188
277
  * "Are you sure you want to proceed?",
189
278
  * "Yes",
@@ -193,6 +282,6 @@ export declare enum DialogButtonType {
193
282
  * "Cancel",
194
283
  * sdkApi
195
284
  * );
196
- * ```
285
+ * ```
197
286
  */
198
287
  export declare const show3buttonAlert: (message: string, confirmButtonText: string, confirmCallback: () => void, refuseButtonText?: string, refuseCallback?: () => void, cancelButtonText?: string, sdkApi?: Api) => Promise<void> | undefined;