Repository: ionic-team/ionic-framework
File: core/src/components/menu/menu.tsx (TypeScript)

Code before:
   * 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`.
   */
  @Method()
  isActive(): Promise<boolean> {
    return Promise.resolve(this._isActive());
  }

  /**
   * Opens the menu. If the menu is already open or it can't be opened,
   * it returns `false`.
   * 
   * @param animated If `true`, open the menu with animation. Defaults to `true`.
   */
  @Method()
  open(animated = true): Promise<boolean> {
    return this.setOpen(true, animated);
  }

  /**
   * Closes the menu. If the menu is already closed or it can't be closed,
   * it returns `false`.
   * 
   * @param animated If `true`, close the menu with 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> {
    return this.setOpen(false, animated, role);
  }

  /**
   * 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`, toggle the menu with animation. Defaults to `true`.
   */
  @Method()
  toggle(animated = true): Promise<boolean> {
    return this.setOpen(!this._isOpen, animated);
  }

  /**
   * Opens or closes the button.
   * If the operation can't be completed successfully, it returns `false`.
   * 

Review comment (suggestion):
```suggestion
   * @param animated If `true`, the menu will animate when closing. If `false`, the menu will close instantly without animation. Defaults to `true`.
```

Code after:
   * 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`.
   */
  @Method()
  isActive(): Promise<boolean> {
    return Promise.resolve(this._isActive());
  }

  /**
   * 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> {
    return this.setOpen(true, animated);
  }

  /**
   * 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> {
    return this.setOpen(false, animated, role);
  }

  /**
   * 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> {
    return this.setOpen(!this._isOpen, animated);