diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 01bf58a496..102ce79199 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -74,7 +74,7 @@ export namespace Components { /** * Dismiss the open action sheet overlay. */ - 'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number | undefined) => Promise; /** * Get the most recently opened action sheet overlay. */ @@ -223,7 +223,7 @@ export namespace Components { /** * Dismiss the open alert overlay. */ - 'dismiss': (data?: any, role?: string | undefined, alertId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, alertId?: number | undefined) => Promise; /** * Get the most recently opened alert overlay. */ @@ -2229,7 +2229,7 @@ export namespace Components { /** * Dismiss the open loading overlay. */ - 'dismiss': (data?: any, role?: string | undefined, loadingId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, loadingId?: number | undefined) => Promise; /** * Get the most recently opened loading overlay. */ @@ -2572,7 +2572,7 @@ export namespace Components { /** * Dismiss the open modal overlay. */ - 'dismiss': (data?: any, role?: string | undefined, modalId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, modalId?: number | undefined) => Promise; /** * Get the most recently opened modal overlay. */ @@ -2880,7 +2880,7 @@ export namespace Components { interface IonPickerController { 'create': (opts?: PickerOptions | undefined) => Promise; - 'dismiss': (data?: any, role?: string | undefined, pickerId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, pickerId?: number | undefined) => Promise; 'getTop': () => HTMLIonPickerElement; } interface IonPickerControllerAttributes extends StencilHTMLAttributes {} @@ -3024,7 +3024,7 @@ export namespace Components { /** * Dismiss the open popover overlay. */ - 'dismiss': (data?: any, role?: string | undefined, popoverId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, popoverId?: number | undefined) => Promise; /** * Get the most recently opened popover overlay. */ @@ -4861,7 +4861,7 @@ export namespace Components { /** * Dismiss the open toast overlay. */ - 'dismiss': (data?: any, role?: string | undefined, toastId?: number) => Promise; + 'dismiss': (data?: any, role?: string | undefined, toastId?: number | undefined) => Promise; /** * Get the most recently opened toast overlay. */ diff --git a/core/src/components/action-sheet-controller/action-sheet-controller.tsx b/core/src/components/action-sheet-controller/action-sheet-controller.tsx index 6980da4224..353f0699ac 100644 --- a/core/src/components/action-sheet-controller/action-sheet-controller.tsx +++ b/core/src/components/action-sheet-controller/action-sheet-controller.tsx @@ -22,7 +22,7 @@ export class ActionSheetController implements OverlayController { * Dismiss the open action sheet overlay. */ @Method() - dismiss(data?: any, role?: string, actionSheetId = -1) { + dismiss(data?: any, role?: string, actionSheetId?: number) { return dismissOverlay(this.doc, data, role, 'ion-action-sheet', actionSheetId); } diff --git a/core/src/components/alert-controller/alert-controller.tsx b/core/src/components/alert-controller/alert-controller.tsx index ee60bca122..c102c88d94 100644 --- a/core/src/components/alert-controller/alert-controller.tsx +++ b/core/src/components/alert-controller/alert-controller.tsx @@ -22,7 +22,7 @@ export class AlertController implements OverlayController { * Dismiss the open alert overlay. */ @Method() - dismiss(data?: any, role?: string, alertId = -1) { + dismiss(data?: any, role?: string, alertId?: number) { return dismissOverlay(this.doc, data, role, 'ion-alert', alertId); } diff --git a/core/src/components/loading-controller/loading-controller.tsx b/core/src/components/loading-controller/loading-controller.tsx index 833db60203..ccb15f7502 100644 --- a/core/src/components/loading-controller/loading-controller.tsx +++ b/core/src/components/loading-controller/loading-controller.tsx @@ -22,7 +22,7 @@ export class LoadingController implements OverlayController { * Dismiss the open loading overlay. */ @Method() - dismiss(data?: any, role?: string, loadingId = -1) { + dismiss(data?: any, role?: string, loadingId?: number) { return dismissOverlay(this.doc, data, role, 'ion-loading', loadingId); } diff --git a/core/src/components/modal-controller/modal-controller.tsx b/core/src/components/modal-controller/modal-controller.tsx index b54774e6be..445a6890df 100644 --- a/core/src/components/modal-controller/modal-controller.tsx +++ b/core/src/components/modal-controller/modal-controller.tsx @@ -22,7 +22,7 @@ export class ModalController implements OverlayController { * Dismiss the open modal overlay. */ @Method() - dismiss(data?: any, role?: string, modalId = -1) { + dismiss(data?: any, role?: string, modalId?: number) { return dismissOverlay(this.doc, data, role, 'ion-modal', modalId); } diff --git a/core/src/components/picker-controller/picker-controller.tsx b/core/src/components/picker-controller/picker-controller.tsx index cbe26a713d..4318a0aa8b 100644 --- a/core/src/components/picker-controller/picker-controller.tsx +++ b/core/src/components/picker-controller/picker-controller.tsx @@ -23,7 +23,7 @@ export class PickerController implements OverlayController { * Dismiss the open picker overlay. */ @Method() - dismiss(data?: any, role?: string, pickerId = -1) { + dismiss(data?: any, role?: string, pickerId?: number) { return dismissOverlay(this.doc, data, role, 'ion-picker', pickerId); } diff --git a/core/src/components/popover-controller/popover-controller.tsx b/core/src/components/popover-controller/popover-controller.tsx index d4092aeea8..1ba1b1624b 100644 --- a/core/src/components/popover-controller/popover-controller.tsx +++ b/core/src/components/popover-controller/popover-controller.tsx @@ -22,7 +22,7 @@ export class PopoverController implements OverlayController { * Dismiss the open popover overlay. */ @Method() - dismiss(data?: any, role?: string, popoverId = -1) { + dismiss(data?: any, role?: string, popoverId?: number) { return dismissOverlay(this.doc, data, role, 'ion-popover', popoverId); } diff --git a/core/src/components/toast-controller/toast-controller.tsx b/core/src/components/toast-controller/toast-controller.tsx index 1c00880591..b8c8fdd63c 100644 --- a/core/src/components/toast-controller/toast-controller.tsx +++ b/core/src/components/toast-controller/toast-controller.tsx @@ -22,7 +22,7 @@ export class ToastController implements OverlayController { * Dismiss the open toast overlay. */ @Method() - dismiss(data?: any, role?: string, toastId = -1) { + dismiss(data?: any, role?: string, toastId?: number) { return dismissOverlay(this.doc, data, role, 'ion-toast', toastId); } diff --git a/core/src/utils/overlays.ts b/core/src/utils/overlays.ts index 9c24a18f87..ed6caba75e 100644 --- a/core/src/utils/overlays.ts +++ b/core/src/utils/overlays.ts @@ -41,7 +41,7 @@ export function connectListeners(doc: Document) { } } -export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id: number): Promise { +export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id?: number): Promise { const overlay = getOverlay(doc, overlayTag, id); if (!overlay) { return Promise.reject('overlay does not exist');