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:
Liam DeBeasi
2021-09-24 16:28:49 -04:00
committed by GitHub
parent 285a371101
commit 8708095111
48 changed files with 763 additions and 58 deletions

View File

@ -10,3 +10,12 @@ export interface ScrollDetail extends GestureDetail, ScrollBaseDetail {
}
export type ScrollCallback = (detail?: ScrollDetail) => boolean | void;
export interface ScrollBaseCustomEvent extends CustomEvent {
detail: ScrollBaseDetail;
target: HTMLIonContentElement;
}
export interface ScrollCustomEvent extends ScrollBaseCustomEvent {
detail: ScrollDetail;
}

View File

@ -11,6 +11,46 @@ Content, along with many other Ionic components, can be customized to modify its
In order to place elements outside of the scrollable area, `slot="fixed"` can be added to the element. This will absolutely position the element placing it in the top left. In order to place the element in a different position, style it using [top, right, bottom, and left](https://developer.mozilla.org/en-US/docs/Web/CSS/position).
## Interfaces
### ScrollBaseDetail
```typescript
interface ScrollBaseDetail {
isScrolling: boolean;
}
```
### ScrollDetail
```typescript
interface ScrollDetail extends GestureDetail, ScrollBaseDetail {
scrollTop: number;
scrollLeft: number;
}
```
### ScrollBaseCustomEvent
While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing on the `ionScrollStart` and `ionScrollEnd` events.
```typescript
interface ScrollBaseCustomEvent extends CustomEvent {
detail: ScrollBaseDetail;
target: HTMLIonContentElement;
}
```
### ScrollCustomEvent
While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing on the `ionScroll` event.
```typescript
interface ScrollCustomEvent extends ScrollBaseCustomEvent {
detail: ScrollDetail;
}
```
<!-- Auto Generated Below -->