docs(methods): update component method documentation #4145 (#30495)

Issue number: resolves ionic-team/ionic-docs#4145

---------

## What is the current behavior?
Some component methods are missing param tags in the JSDoc comments.
Some comments are out of order and the method description is below the
last param description. Some back ticks are misplaced around words
resulting in incorrect formatting in the docs site.

## What is the new behavior?
Method documentation in app, action-sheet, alert, datetime, loading,
menu, modal, popover, reorder-group, router, searchbar, and toast now
include descriptions for all params, all method descriptions are placed
above param descriptions, and back ticks are formatted correctly. All
changes are within JSDoc comments so will result in a change to the docs
site but no functional change to any components.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

In order to preview these changes I took the JSON generated from the
build on this branch and used it in the docusaurus script in place of
the fetch from unpkg. I set up a preview from my fork on Vercel -
https://ionic-docs-git-temptotestdocs-soundproofboots-projects.vercel.app/docs/components
. The change I made to the docusaurus script to use this temp data is
here - https://github.com/soundproofboot/ionic-docs/pull/1/files.
tempDocs.json is the output of the framework build after making these
changes.

---------

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
This commit is contained in:
Colin Bares
2025-06-26 13:15:14 -05:00
committed by GitHub
parent 4b5753a4ce
commit db915bf6c7
13 changed files with 100 additions and 59 deletions

View File

@ -174,9 +174,9 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the action sheet overlay after it has been presented.
* Dismiss the action sheet overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the action sheet. This can be useful in a button handler for determining which button was clicked to dismiss the action sheet. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the action sheet. This can be useful in a button handler for determining which button was clicked to dismiss the action sheet. Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
"dismiss": (data?: any, role?: string) => Promise<boolean>;
/**
@ -262,9 +262,9 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the alert overlay after it has been presented.
* Dismiss the alert overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the alert. This can be useful in a button handler for determining which button was clicked to dismiss the alert. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the alert. This can be useful in a button handler for determining which button was clicked to dismiss the alert. Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
"dismiss": (data?: any, role?: string) => Promise<boolean>;
/**
@ -340,6 +340,7 @@ export namespace Components {
interface IonApp {
/**
* Used to set focus on an element that uses `ion-focusable`. Do not use this if focusing the element as a result of a keyboard event as the focus utility should handle this for us. This method should be used when we want to programmatically focus an element as a result of another user action. (Ex: We focus the first element inside of a popover when the user presents it, but the popover is not always presented as a result of keyboard action.)
* @param elements An array of HTML elements to set focus on.
*/
"setFocus": (elements: HTMLElement[]) => Promise<void>;
}
@ -910,6 +911,7 @@ export namespace Components {
interface IonDatetime {
/**
* Emits the ionCancel event and optionally closes the popover or modal that the datetime was presented in.
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
*/
"cancel": (closeOverlay?: boolean) => Promise<void>;
/**
@ -929,6 +931,7 @@ export namespace Components {
"color"?: Color;
/**
* Confirms the selected datetime value, updates the `value` property, and optionally closes the popover or modal that the datetime was presented in.
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
*/
"confirm": (closeOverlay?: boolean) => Promise<void>;
/**
@ -1022,6 +1025,7 @@ export namespace Components {
"readonly": boolean;
/**
* Resets the internal state of the datetime but does not update the value. Passing a valid ISO-8601 string will reset the state of the component to the provided date. If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
* @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
*/
"reset": (startDate?: string) => Promise<void>;
/**
@ -1749,9 +1753,9 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the loading overlay after it has been presented.
* Dismiss the loading overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the loading. This can be useful in a button handler for determining which button was clicked to dismiss the loading. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the loading. This can be useful in a button handler for determining which button was clicked to dismiss the loading. Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
"dismiss": (data?: any, role?: string) => Promise<boolean>;
/**
@ -1828,6 +1832,8 @@ export namespace Components {
interface IonMenu {
/**
* Closes the menu. If the menu is already closed or it can't be closed, it returns `false`.
* @param animated If `true`, the menu will animate when closing. If `false`, the menu will close instantly without animation. Defaults to `true`.
* @param role The role of the element that is closing the menu. This can be useful in a button handler for determining which button was clicked to close the menu. Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
"close": (animated?: boolean, role?: string) => Promise<boolean>;
/**
@ -1840,7 +1846,7 @@ export namespace Components {
*/
"disabled": boolean;
/**
* Returns `true` is the menu is active. A menu is active when it can be opened or closed, meaning it's enabled and it's not part of a `ion-split-pane`.
* Returns `true` if the menu is active. A menu is active when it can be opened or closed, meaning it's enabled and it's not part of a `ion-split-pane`.
*/
"isActive": () => Promise<boolean>;
/**
@ -1858,10 +1864,14 @@ export namespace Components {
"menuId"?: string;
/**
* Opens the menu. If the menu is already open or it can't be opened, it returns `false`.
* @param animated If `true`, the menu will animate when opening. If `false`, the menu will open instantly without animation. Defaults to `true`.
*/
"open": (animated?: boolean) => Promise<boolean>;
/**
* Opens or closes the button. If the operation can't be completed successfully, it returns `false`.
* Opens or closes the menu. If the operation can't be completed successfully, it returns `false`.
* @param shouldOpen If `true`, the menu will open. If `false`, the menu will close.
* @param animated If `true`, the menu will animate when opening/closing. If `false`, the menu will open/close instantly without animation.
* @param role The role of the element that is closing the menu.
*/
"setOpen": (shouldOpen: boolean, animated?: boolean, role?: string) => Promise<boolean>;
/**
@ -1876,6 +1886,7 @@ export namespace Components {
"swipeGesture": boolean;
/**
* Toggles the menu. If the menu is already open, it will try to close, otherwise it will try to open it. If the operation can't be completed successfully, it returns `false`.
* @param animated If `true`, the menu will animate when opening/closing. If `false`, the menu will open/close instantly without animation. Defaults to `true`.
*/
"toggle": (animated?: boolean) => Promise<boolean>;
/**
@ -1962,9 +1973,9 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the modal overlay after it has been presented.
* Dismiss the modal overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the modal. For example, `cancel` or `backdrop`.
*/
"dismiss": (data?: any, role?: string) => Promise<boolean>;
/**
@ -2047,7 +2058,8 @@ export namespace Components {
*/
"presentingElement"?: HTMLElement;
/**
* Move a sheet style modal to a specific breakpoint. The breakpoint value must be a value defined in your `breakpoints` array.
* Move a sheet style modal to a specific breakpoint.
* @param breakpoint The breakpoint value to move the sheet modal to. Must be a value defined in your `breakpoints` array.
*/
"setCurrentBreakpoint": (breakpoint: number) => Promise<void>;
/**
@ -2408,10 +2420,10 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the popover overlay after it has been presented.
* Dismiss the popover overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'.
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss a parent popover if this popover is nested. Defaults to `true`. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`.
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss a parent popover if this popover is nested. Defaults to `true`.
*/
"dismiss": (data?: any, role?: string, dismissParentPopover?: boolean) => Promise<boolean>;
/**
@ -2479,6 +2491,7 @@ export namespace Components {
"overlayIndex": number;
/**
* Present the popover overlay after it has been created. Developers can pass a mouse, touch, or pointer event to position the popover relative to where that event was dispatched.
* @param event The event to position the popover relative to.
*/
"present": (event?: MouseEvent | TouchEvent | PointerEvent | CustomEvent) => Promise<void>;
/**
@ -2838,6 +2851,7 @@ export namespace Components {
* Navigate to the specified path.
* @param path The path to navigate to.
* @param direction The direction of the animation. Defaults to `"forward"`.
* @param animation A custom animation to use for the transition.
*/
"push": (path: string, direction?: RouterDirection, animation?: AnimationBuilder) => Promise<boolean>;
/**
@ -3569,9 +3583,9 @@ export namespace Components {
"cssClass"?: string | string[];
"delegate"?: FrameworkDelegate;
/**
* Dismiss the toast overlay after it has been presented.
* Dismiss the toast overlay after it has been presented. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the toast. This can be useful in a button handler for determining which button was clicked to dismiss the toast. Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. This is a no-op if the overlay has not been presented yet. If you want to remove an overlay from the DOM that was never presented, use the [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* @param role The role of the element that is dismissing the toast. This can be useful in a button handler for determining which button was clicked to dismiss the toast. Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
"dismiss": (data?: any, role?: string) => Promise<boolean>;
/**

View File

@ -210,16 +210,15 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
/**
* Dismiss the action sheet overlay after it has been presented.
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the action sheet.
* This can be useful in a button handler for determining which button was
* clicked to dismiss the action sheet.
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* clicked to dismiss the action sheet. Some examples include:
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
@Method()
async dismiss(data?: any, role?: string): Promise<boolean> {

View File

@ -432,16 +432,15 @@ export class Alert implements ComponentInterface, OverlayInterface {
/**
* Dismiss the alert overlay after it has been presented.
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the alert.
* This can be useful in a button handler for determining which button was
* clicked to dismiss the alert.
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* clicked to dismiss the alert. Some examples include:
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
@Method()
async dismiss(data?: any, role?: string): Promise<boolean> {

View File

@ -68,6 +68,8 @@ export class App implements ComponentInterface {
* a result of another user action. (Ex: We focus the first element
* inside of a popover when the user presents it, but the popover is not always
* presented as a result of keyboard action.)
*
* @param elements An array of HTML elements to set focus on.
*/
@Method()
async setFocus(elements: HTMLElement[]) {

View File

@ -524,6 +524,8 @@ export class Datetime implements ComponentInterface {
* Confirms the selected datetime value, updates the
* `value` property, and optionally closes the popover
* or modal that the datetime was presented in.
*
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
*/
@Method()
async confirm(closeOverlay = false) {
@ -559,6 +561,8 @@ export class Datetime implements ComponentInterface {
* Resets the internal state of the datetime but does not update the value.
* Passing a valid ISO-8601 string will reset the state of the component to the provided date.
* If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
*
* @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
*/
@Method()
async reset(startDate?: string) {
@ -570,6 +574,8 @@ export class Datetime implements ComponentInterface {
* optionally closes the popover
* or modal that the datetime was
* presented in.
*
* @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
*/
@Method()
async cancel(closeOverlay = false) {

View File

@ -264,16 +264,15 @@ export class Loading implements ComponentInterface, OverlayInterface {
/**
* Dismiss the loading overlay after it has been presented.
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the loading.
* This can be useful in a button handler for determining which button was
* clicked to dismiss the loading.
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* clicked to dismiss the loading. Some examples include:
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
@Method()
async dismiss(data?: any, role?: string): Promise<boolean> {

View File

@ -353,7 +353,7 @@ export class Menu implements ComponentInterface, MenuI {
}
/**
* Returns `true` is the menu is active.
* Returns `true` if the menu is active.
*
* A menu is active when it can be opened or closed, meaning it's enabled
* and it's not part of a `ion-split-pane`.
@ -366,6 +366,10 @@ export class Menu implements ComponentInterface, MenuI {
/**
* Opens the menu. If the menu is already open or it can't be opened,
* it returns `false`.
*
* @param animated If `true`, the menu will animate when opening.
* If `false`, the menu will open instantly without animation.
* Defaults to `true`.
*/
@Method()
open(animated = true): Promise<boolean> {
@ -375,6 +379,13 @@ export class Menu implements ComponentInterface, MenuI {
/**
* Closes the menu. If the menu is already closed or it can't be closed,
* it returns `false`.
*
* @param animated If `true`, the menu will animate when closing. If `false`,
* the menu will close instantly without animation. Defaults to `true`.
* @param role The role of the element that is closing the menu.
* This can be useful in a button handler for determining which button was
* clicked to close the menu. Some examples include:
* `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
@Method()
close(animated = true, role?: string): Promise<boolean> {
@ -382,8 +393,13 @@ export class Menu implements ComponentInterface, MenuI {
}
/**
* Toggles the menu. If the menu is already open, it will try to close, otherwise it will try to open it.
* Toggles the menu. If the menu is already open, it will try to close,
* otherwise it will try to open it.
* If the operation can't be completed successfully, it returns `false`.
*
* @param animated If `true`, the menu will animate when opening/closing.
* If `false`, the menu will open/close instantly without animation.
* Defaults to `true`.
*/
@Method()
toggle(animated = true): Promise<boolean> {
@ -391,8 +407,14 @@ export class Menu implements ComponentInterface, MenuI {
}
/**
* Opens or closes the button.
* Opens or closes the menu.
* If the operation can't be completed successfully, it returns `false`.
*
* @param shouldOpen If `true`, the menu will open. If `false`, the menu
* will close.
* @param animated If `true`, the menu will animate when opening/closing.
* If `false`, the menu will open/close instantly without animation.
* @param role The role of the element that is closing the menu.
*/
@Method()
setOpen(shouldOpen: boolean, animated = true, role?: string): Promise<boolean> {

View File

@ -739,13 +739,13 @@ export class Modal implements ComponentInterface, OverlayInterface {
/**
* Dismiss the modal overlay after it has been presented.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the modal.
* For example, `cancel` or `backdrop`.
*/
@Method()
async dismiss(data?: any, role?: string): Promise<boolean> {
@ -841,8 +841,10 @@ export class Modal implements ComponentInterface, OverlayInterface {
}
/**
* Move a sheet style modal to a specific breakpoint. The breakpoint value must
* be a value defined in your `breakpoints` array.
* Move a sheet style modal to a specific breakpoint.
*
* @param breakpoint The breakpoint value to move the sheet modal to.
* Must be a value defined in your `breakpoints` array.
*/
@Method()
async setCurrentBreakpoint(breakpoint: number): Promise<void> {

View File

@ -459,6 +459,8 @@ export class Popover implements ComponentInterface, PopoverInterface {
* Developers can pass a mouse, touch, or pointer event
* to position the popover relative to where that event
* was dispatched.
*
* @param event The event to position the popover relative to.
*/
@Method()
async present(event?: MouseEvent | TouchEvent | PointerEvent | CustomEvent): Promise<void> {
@ -540,15 +542,14 @@ export class Popover implements ComponentInterface, PopoverInterface {
/**
* Dismiss the popover overlay after it has been presented.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'.
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss
* a parent popover if this popover is nested. Defaults to `true`.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`.
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss
* a parent popover if this popover is nested. Defaults to `true`.
*/
@Method()
async dismiss(data?: any, role?: string, dismissParentPopover = true): Promise<boolean> {

View File

@ -89,7 +89,6 @@ export class ReorderGroup implements ComponentInterface {
/**
* Completes the reorder operation. Must be called by the `ionItemReorder` event.
*
* If a list of items is passed, the list will be reordered and returned in the
* proper order.
*

View File

@ -124,6 +124,7 @@ export class Router implements ComponentInterface {
*
* @param path The path to navigate to.
* @param direction The direction of the animation. Defaults to `"forward"`.
* @param animation A custom animation to use for the transition.
*/
@Method()
async push(path: string, direction: RouterDirection = 'forward', animation?: AnimationBuilder) {

View File

@ -302,10 +302,8 @@ export class Searchbar implements ComponentInterface {
/**
* Sets focus on the native `input` in `ion-searchbar`. Use this method instead of the global
* `input.focus()`.
*
* Developers who wish to focus an input when a page enters
* should call `setFocus()` in the `ionViewDidEnter()` lifecycle method.
*
* Developers who wish to focus an input when an overlay is presented
* should call `setFocus` after `didPresent` has resolved.
*

View File

@ -397,16 +397,15 @@ export class Toast implements ComponentInterface, OverlayInterface {
/**
* Dismiss the toast overlay after it has been presented.
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
*
* @param data Any data to emit in the dismiss events.
* @param role The role of the element that is dismissing the toast.
* This can be useful in a button handler for determining which button was
* clicked to dismiss the toast.
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
*
* This is a no-op if the overlay has not been presented yet. If you want
* to remove an overlay from the DOM that was never presented, use the
* [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
* Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
*/
@Method()
async dismiss(data?: any, role?: string): Promise<boolean> {