mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
feat(all): add optional generics typings for overlay component methods (#21393)
This commit is contained in:
committed by
GitHub
parent
c7e94a1f23
commit
5bf83b80d7
@ -161,7 +161,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
* Returns a promise that resolves when the loading did dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onDidDismiss(): Promise<OverlayEventDetail> {
|
||||
onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
|
||||
return eventMethod(this.el, 'ionLoadingDidDismiss');
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
* Returns a promise that resolves when the loading will dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onWillDismiss(): Promise<OverlayEventDetail> {
|
||||
onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
|
||||
return eventMethod(this.el, 'ionLoadingWillDismiss');
|
||||
}
|
||||
|
||||
|
||||
@ -307,23 +307,23 @@ Type: `Promise<boolean>`
|
||||
|
||||
|
||||
|
||||
### `onDidDismiss() => Promise<OverlayEventDetail<any>>`
|
||||
### `onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>`
|
||||
|
||||
Returns a promise that resolves when the loading did dismiss.
|
||||
|
||||
#### Returns
|
||||
|
||||
Type: `Promise<OverlayEventDetail<any>>`
|
||||
Type: `Promise<OverlayEventDetail<T>>`
|
||||
|
||||
|
||||
|
||||
### `onWillDismiss() => Promise<OverlayEventDetail<any>>`
|
||||
### `onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>`
|
||||
|
||||
Returns a promise that resolves when the loading will dismiss.
|
||||
|
||||
#### Returns
|
||||
|
||||
Type: `Promise<OverlayEventDetail<any>>`
|
||||
Type: `Promise<OverlayEventDetail<T>>`
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user