@elliemae/pui-scripting-object 1.51.0 → 1.51.2

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.
@@ -286,9 +286,13 @@ export declare enum ToastType {
286
286
  */
287
287
  export type ToastOptions = {
288
288
  /**
289
- * title of the toast message
289
+ * title of the toast
290
290
  */
291
- message: string;
291
+ title: string;
292
+ /**
293
+ * content of the toast
294
+ */
295
+ content: string;
292
296
  /**
293
297
  * {@link ToastType}
294
298
  *
@@ -562,14 +566,25 @@ export interface IApplication extends IScriptingObject {
562
566
  /**
563
567
  * open a modal
564
568
  * @param options modal properties
565
- * @returns user selected modal action value as string
569
+ * @returns action selected by the user
570
+ * @example
571
+ * ```typescript
572
+ * const result = await application.openModal({
573
+ * type: ModalType.WARNING,
574
+ * data: {
575
+ * title: 'Warning',
576
+ * body: 'This operation is final and cannot be reversed. Do you want to proceed?',
577
+ * actions: ['Ok', 'Cancel']
578
+ * }
579
+ * });
580
+ * if (result === 'Ok') {
581
+ * // user clicked Ok
582
+ * } else {
583
+ * // user clicked Cancel
584
+ * }
585
+ * ```
566
586
  */
567
587
  openModal(options: ModalOptions): Promise<string>;
568
- /**
569
- * open a toast message
570
- * @param options toast properties
571
- */
572
- openToast(options: ToastOptions): Promise<void>;
573
588
  /**
574
589
  * Perform an action
575
590
  * @param action action name
@@ -581,6 +596,19 @@ export interface IApplication extends IScriptingObject {
581
596
  * @param options Print options
582
597
  */
583
598
  print(options: PrintOptions): Promise<void>;
599
+ /**
600
+ * show toast message
601
+ * @param options toast options
602
+ * @example
603
+ * ```typescript
604
+ * await application.showToast({
605
+ * title: 'Greeting',
606
+ * content: 'Hello World',
607
+ * type: ToastType.INFO
608
+ * });
609
+ * ```
610
+ */
611
+ showToast(options: ToastOptions): Promise<void>;
584
612
  /**
585
613
  * get supportability of an action
586
614
  * @param name action name