mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +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:
@ -13,6 +13,28 @@ That means the `ion-router` never touches the DOM, it does NOT show the componen
|
||||
|
||||
In order to configure this relationship between components (to load/select) and URLs, `ion-router` uses a declarative syntax using JSX/HTML to define a tree of routes.
|
||||
|
||||
## Interfaces
|
||||
|
||||
### RouterEventDetail
|
||||
|
||||
```typescript
|
||||
interface RouterEventDetail {
|
||||
from: string | null;
|
||||
redirectedFrom: string | null;
|
||||
to: string;
|
||||
}
|
||||
```
|
||||
|
||||
### RouterCustomEvent
|
||||
|
||||
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 RouterCustomEvent extends CustomEvent {
|
||||
detail: RouterEventDetail;
|
||||
target: HTMLIonRouterElement;
|
||||
}
|
||||
```
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
@ -16,6 +16,11 @@ export interface RouterEventDetail {
|
||||
to: string;
|
||||
}
|
||||
|
||||
export interface RouterCustomEvent extends CustomEvent {
|
||||
detail: RouterEventDetail;
|
||||
target: HTMLIonRouterElement;
|
||||
}
|
||||
|
||||
export interface RouteRedirect {
|
||||
from: string[];
|
||||
to?: ParsedRoute;
|
||||
|
||||
Reference in New Issue
Block a user