mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
chore(): simplify overlay attribute types (#25074)
This commit is contained in:
@ -42,7 +42,7 @@ interface ToastOptions {
|
||||
translucent?: boolean;
|
||||
animated?: boolean;
|
||||
icon?: string;
|
||||
htmlAttributes?: ToastAttributes;
|
||||
htmlAttributes?: { [key: string]: any };
|
||||
|
||||
color?: Color;
|
||||
mode?: Mode;
|
||||
@ -54,11 +54,6 @@ interface ToastOptions {
|
||||
}
|
||||
```
|
||||
|
||||
### ToastAttributes
|
||||
```typescript
|
||||
interface ToastAttributes extends JSXBase.HTMLAttributes<HTMLElement> {}
|
||||
```
|
||||
|
||||
## Accessibility
|
||||
|
||||
### Focus Management
|
||||
@ -447,7 +442,7 @@ export default defineComponent({
|
||||
| `duration` | `duration` | How many milliseconds to wait before hiding the toast. By default, it will show until `dismiss()` is called. | `number` | `0` |
|
||||
| `enterAnimation` | -- | Animation to use when the toast is presented. | `((baseEl: any, opts?: any) => Animation) \| undefined` | `undefined` |
|
||||
| `header` | `header` | Header to be shown in the toast. | `string \| undefined` | `undefined` |
|
||||
| `htmlAttributes` | -- | Additional attributes to pass to the toast. | `ToastAttributes \| undefined` | `undefined` |
|
||||
| `htmlAttributes` | -- | Additional attributes to pass to the toast. | `undefined \| { [key: string]: any; }` | `undefined` |
|
||||
| `icon` | `icon` | The name of the icon to display, or the path to a valid SVG file. See `ion-icon`. https://ionic.io/ionicons | `string \| undefined` | `undefined` |
|
||||
| `keyboardClose` | `keyboard-close` | If `true`, the keyboard will be automatically dismissed when the overlay is presented. | `boolean` | `false` |
|
||||
| `leaveAnimation` | -- | Animation to use when the toast is dismissed. | `((baseEl: any, opts?: any) => Animation) \| undefined` | `undefined` |
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import type { JSXBase } from '@stencil/core/internal';
|
||||
|
||||
import type { AnimationBuilder, Color, Mode } from '../../interface';
|
||||
import type { IonicSafeString } from '../../utils/sanitization';
|
||||
|
||||
@ -24,7 +22,10 @@ export interface ToastOptions {
|
||||
leaveAnimation?: AnimationBuilder;
|
||||
}
|
||||
|
||||
export type ToastAttributes = JSXBase.HTMLAttributes<HTMLElement>;
|
||||
/**
|
||||
* @deprecated - Use { [key: string]: any } directly instead.
|
||||
*/
|
||||
export type ToastAttributes = { [key: string]: any };
|
||||
|
||||
export interface ToastButton {
|
||||
text?: string;
|
||||
|
||||
Reference in New Issue
Block a user