Skip to content

Commit

Permalink
feat(all): add optional generics typings for overlay component methods (
Browse files Browse the repository at this point in the history
  • Loading branch information
aivinog1 authored Jun 3, 2020
1 parent c7e94a1 commit 5bf83b8
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 70 deletions.
28 changes: 14 additions & 14 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ion-action-sheet,prop,mode,"ios" | "md",undefined,false,false
ion-action-sheet,prop,subHeader,string | undefined,undefined,false,false
ion-action-sheet,prop,translucent,boolean,false,false,false
ion-action-sheet,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-action-sheet,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-action-sheet,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-action-sheet,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-action-sheet,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-action-sheet,method,present,present() => Promise<void>
ion-action-sheet,event,ionActionSheetDidDismiss,OverlayEventDetail<any>,true
ion-action-sheet,event,ionActionSheetDidPresent,void,true
Expand Down Expand Up @@ -58,8 +58,8 @@ ion-alert,prop,mode,"ios" | "md",undefined,false,false
ion-alert,prop,subHeader,string | undefined,undefined,false,false
ion-alert,prop,translucent,boolean,false,false,false
ion-alert,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-alert,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-alert,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-alert,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-alert,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-alert,method,present,present() => Promise<void>
ion-alert,event,ionAlertDidDismiss,OverlayEventDetail<any>,true
ion-alert,event,ionAlertDidPresent,void,true
Expand Down Expand Up @@ -612,8 +612,8 @@ ion-loading,prop,showBackdrop,boolean,true,false,false
ion-loading,prop,spinner,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-small" | null | undefined,undefined,false,false
ion-loading,prop,translucent,boolean,false,false,false
ion-loading,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-loading,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-loading,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-loading,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-loading,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-loading,method,present,present() => Promise<void>
ion-loading,event,ionLoadingDidDismiss,OverlayEventDetail<any>,true
ion-loading,event,ionLoadingDidPresent,void,true
Expand Down Expand Up @@ -695,8 +695,8 @@ ion-modal,prop,presentingElement,HTMLElement | undefined,undefined,false,false
ion-modal,prop,showBackdrop,boolean,true,false,false
ion-modal,prop,swipeToClose,boolean,false,false,false
ion-modal,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-modal,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-modal,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-modal,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-modal,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-modal,method,present,present() => Promise<void>
ion-modal,event,ionModalDidDismiss,OverlayEventDetail<any>,true
ion-modal,event,ionModalDidPresent,void,true
Expand Down Expand Up @@ -761,8 +761,8 @@ ion-picker,prop,mode,"ios" | "md",undefined,false,false
ion-picker,prop,showBackdrop,boolean,true,false,false
ion-picker,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-picker,method,getColumn,getColumn(name: string) => Promise<PickerColumn | undefined>
ion-picker,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-picker,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-picker,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-picker,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-picker,method,present,present() => Promise<void>
ion-picker,event,ionPickerDidDismiss,OverlayEventDetail<any>,true
ion-picker,event,ionPickerDidPresent,void,true
Expand Down Expand Up @@ -796,8 +796,8 @@ ion-popover,prop,mode,"ios" | "md",undefined,false,false
ion-popover,prop,showBackdrop,boolean,true,false,false
ion-popover,prop,translucent,boolean,false,false,false
ion-popover,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-popover,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-popover,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-popover,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-popover,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-popover,method,present,present() => Promise<void>
ion-popover,event,ionPopoverDidDismiss,OverlayEventDetail<any>,true
ion-popover,event,ionPopoverDidPresent,void,true
Expand Down Expand Up @@ -1242,8 +1242,8 @@ ion-toast,prop,mode,"ios" | "md",undefined,false,false
ion-toast,prop,position,"bottom" | "middle" | "top",'bottom',false,false
ion-toast,prop,translucent,boolean,false,false,false
ion-toast,method,dismiss,dismiss(data?: any, role?: string | undefined) => Promise<boolean>
ion-toast,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-toast,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-toast,method,onDidDismiss,onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-toast,method,onWillDismiss,onWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>
ion-toast,method,present,present() => Promise<void>
ion-toast,event,ionToastDidDismiss,OverlayEventDetail<any>,true
ion-toast,event,ionToastDidPresent,void,true
Expand Down
28 changes: 14 additions & 14 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the action sheet did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the action sheet will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the action sheet overlay after it has been created.
Expand Down Expand Up @@ -128,11 +128,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the alert did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the alert will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the alert overlay after it has been created.
Expand Down Expand Up @@ -1159,11 +1159,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the loading did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the loading will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the loading overlay after it has been created.
Expand Down Expand Up @@ -1315,11 +1315,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the modal did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the modal will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the modal overlay after it has been created.
Expand Down Expand Up @@ -1528,11 +1528,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the picker did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the picker will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the picker overlay after it has been created.
Expand Down Expand Up @@ -1600,11 +1600,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the popover did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the popover will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* Present the popover overlay after it has been created.
Expand Down Expand Up @@ -2510,11 +2510,11 @@ export namespace Components {
/**
* Returns a promise that resolves when the toast did dismiss.
*/
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
/**
* Returns a promise that resolves when the toast will dismiss.
*/
"onWillDismiss": () => Promise<OverlayEventDetail<any>>;
"onWillDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
"overlayIndex": number;
/**
* The position of the toast on the screen.
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/action-sheet/action-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
* Returns a promise that resolves when the action sheet did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionActionSheetDidDismiss');
}

Expand All @@ -148,7 +148,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
*
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {
onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionActionSheetWillDismiss');
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/components/action-sheet/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,23 +381,23 @@ Type: `Promise<boolean>`



### `onDidDismiss() => Promise<OverlayEventDetail<any>>`
### `onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>`

Returns a promise that resolves when the action sheet 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 action sheet will dismiss.

#### Returns

Type: `Promise<OverlayEventDetail<any>>`
Type: `Promise<OverlayEventDetail<T>>`



Expand Down
4 changes: 2 additions & 2 deletions core/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,15 @@ export class Alert implements ComponentInterface, OverlayInterface {
* Returns a promise that resolves when the alert did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionAlertDidDismiss');
}

/**
* Returns a promise that resolves when the alert will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {
onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionAlertWillDismiss');
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/components/alert/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1460,23 +1460,23 @@ Type: `Promise<boolean>`



### `onDidDismiss() => Promise<OverlayEventDetail<any>>`
### `onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>`

Returns a promise that resolves when the alert 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 alert will dismiss.

#### Returns

Type: `Promise<OverlayEventDetail<any>>`
Type: `Promise<OverlayEventDetail<T>>`



Expand Down
4 changes: 2 additions & 2 deletions core/src/components/loading/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ 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');
}

/**
* 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');
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/components/loading/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>>`



Expand Down
4 changes: 2 additions & 2 deletions core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ export class Modal implements ComponentInterface, OverlayInterface {
* Returns a promise that resolves when the modal did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionModalDidDismiss');
}

/**
* Returns a promise that resolves when the modal will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {
onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionModalWillDismiss');
}

Expand Down
8 changes: 4 additions & 4 deletions core/src/components/modal/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,23 +644,23 @@ Type: `Promise<boolean>`
### `onDidDismiss() => Promise<OverlayEventDetail<any>>`
### `onDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>`
Returns a promise that resolves when the modal 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 modal will dismiss.
#### Returns
Type: `Promise<OverlayEventDetail<any>>`
Type: `Promise<OverlayEventDetail<T>>`
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/picker/picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ export class Picker implements ComponentInterface, OverlayInterface {
* Returns a promise that resolves when the picker did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
onDidDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionPickerDidDismiss');
}

/**
* Returns a promise that resolves when the picker will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {
onWillDismiss<T = any>(): Promise<OverlayEventDetail<T>> {
return eventMethod(this.el, 'ionPickerWillDismiss');
}

Expand Down
Loading

0 comments on commit 5bf83b8

Please sign in to comment.