mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
feat(all): add CustomEvents types to components that emit events (#23956)
resolves #22925 BREAKING CHANGE: The `RadioChangeEventDetail` interface has been removed in favor of `RadioGroupChangeEventDetail`.
This commit is contained in:
@ -22,6 +22,27 @@ The component has full keyboard support for navigating between and selecting `io
|
||||
| `End` | Focuses the last focusable element. |
|
||||
| `Space` or `Enter` | Selects the element that is currently focused. |
|
||||
|
||||
## Interfaces
|
||||
|
||||
### SegmentChangeEventDetail
|
||||
|
||||
```typescript
|
||||
interface SegmentChangeEventDetail {
|
||||
value?: string;
|
||||
}
|
||||
```
|
||||
|
||||
### SegmentCustomEvent
|
||||
|
||||
While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component.
|
||||
|
||||
```typescript
|
||||
interface SegmentCustomEvent extends CustomEvent {
|
||||
target: HTMLIonSegmentElement;
|
||||
detail: SegmentChangeEventDetail;
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
|
@ -2,5 +2,10 @@
|
||||
export type SegmentButtonLayout = 'icon-top' | 'icon-start' | 'icon-end' | 'icon-bottom' | 'icon-hide' | 'label-hide';
|
||||
|
||||
export interface SegmentChangeEventDetail {
|
||||
value: string | undefined;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface SegmentCustomEvent extends CustomEvent {
|
||||
detail: SegmentChangeEventDetail;
|
||||
target: HTMLIonSegmentElement;
|
||||
}
|
||||
|
Reference in New Issue
Block a user