From db915bf6c7c8c960ae1c02103d7173632ec94b25 Mon Sep 17 00:00:00 2001 From: Colin Bares Date: Thu, 26 Jun 2025 13:15:14 -0500 Subject: [PATCH] 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 Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com> Co-authored-by: Maria Hutt --- core/src/components.d.ts | 50 ++++++++++++------- .../components/action-sheet/action-sheet.tsx | 11 ++-- core/src/components/alert/alert.tsx | 11 ++-- core/src/components/app/app.tsx | 2 + core/src/components/datetime/datetime.tsx | 6 +++ core/src/components/loading/loading.tsx | 11 ++-- core/src/components/menu/menu.tsx | 28 +++++++++-- core/src/components/modal/modal.tsx | 14 +++--- core/src/components/popover/popover.tsx | 13 ++--- .../reorder-group/reorder-group.tsx | 1 - core/src/components/router/router.tsx | 1 + core/src/components/searchbar/searchbar.tsx | 2 - core/src/components/toast/toast.tsx | 9 ++-- 13 files changed, 100 insertions(+), 59 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 3fc70d62b0..6e0e240584 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -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; /** @@ -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; /** @@ -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; } @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** - * 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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -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; /** @@ -2770,7 +2783,7 @@ export namespace Components { } interface IonReorderGroup { /** - * 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. If no parameters are passed or if `true` is passed in, the reorder will complete and the item will remain in the position it was dragged to. If `false` is passed, the reorder will complete and the item will bounce back to its original position. + * 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. If no parameters are passed or if `true` is passed in, the reorder will complete and the item will remain in the position it was dragged to. If `false` is passed, the reorder will complete and the item will bounce back to its original position. * @param listOrReorder A list of items to be sorted and returned in the new order or a boolean of whether or not the reorder should reposition the item. */ "complete": (listOrReorder?: boolean | any[]) => Promise; @@ -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; /** @@ -2988,7 +3002,7 @@ export namespace Components { */ "searchIcon"?: string; /** - * 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. See [managing focus](/docs/developing/managing-focus) for more information. + * 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. See [managing focus](/docs/developing/managing-focus) for more information. */ "setFocus": () => Promise; /** @@ -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; /** diff --git a/core/src/components/action-sheet/action-sheet.tsx b/core/src/components/action-sheet/action-sheet.tsx index 1b4cfe3141..dcd7c03847 100644 --- a/core/src/components/action-sheet/action-sheet.tsx +++ b/core/src/components/action-sheet/action-sheet.tsx @@ -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 { diff --git a/core/src/components/alert/alert.tsx b/core/src/components/alert/alert.tsx index c126d9b0d2..a29f4e0fe1 100644 --- a/core/src/components/alert/alert.tsx +++ b/core/src/components/alert/alert.tsx @@ -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 { diff --git a/core/src/components/app/app.tsx b/core/src/components/app/app.tsx index 4f4919667f..f7aba5fb15 100644 --- a/core/src/components/app/app.tsx +++ b/core/src/components/app/app.tsx @@ -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[]) { diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index 71a9512e56..1ede831377 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -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) { diff --git a/core/src/components/loading/loading.tsx b/core/src/components/loading/loading.tsx index 785f221c20..1666c86963 100644 --- a/core/src/components/loading/loading.tsx +++ b/core/src/components/loading/loading.tsx @@ -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 { diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 0fee7bda16..6306801ce5 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/core/src/components/modal/modal.tsx b/core/src/components/modal/modal.tsx index 2ec55fca02..eb56d50e73 100644 --- a/core/src/components/modal/modal.tsx +++ b/core/src/components/modal/modal.tsx @@ -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 { @@ -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 { diff --git a/core/src/components/popover/popover.tsx b/core/src/components/popover/popover.tsx index 61d525dff9..9b07ab2f27 100644 --- a/core/src/components/popover/popover.tsx +++ b/core/src/components/popover/popover.tsx @@ -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 { @@ -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 { diff --git a/core/src/components/reorder-group/reorder-group.tsx b/core/src/components/reorder-group/reorder-group.tsx index 3dba0535b8..fe4d424ba0 100644 --- a/core/src/components/reorder-group/reorder-group.tsx +++ b/core/src/components/reorder-group/reorder-group.tsx @@ -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. * diff --git a/core/src/components/router/router.tsx b/core/src/components/router/router.tsx index c68c9c4701..a5c0c67bf0 100644 --- a/core/src/components/router/router.tsx +++ b/core/src/components/router/router.tsx @@ -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) { diff --git a/core/src/components/searchbar/searchbar.tsx b/core/src/components/searchbar/searchbar.tsx index 852567c64a..0c038962a5 100644 --- a/core/src/components/searchbar/searchbar.tsx +++ b/core/src/components/searchbar/searchbar.tsx @@ -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. * diff --git a/core/src/components/toast/toast.tsx b/core/src/components/toast/toast.tsx index 45ec9fc064..4fdcc90f42 100644 --- a/core/src/components/toast/toast.tsx +++ b/core/src/components/toast/toast.tsx @@ -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 {