chore(overlays): generic for present/dismiss options (#26287)

This commit is contained in:
Sean Perkins
2022-11-21 16:57:17 -05:00
committed by GitHub
parent 8aa0aeca6b
commit c943dff5a3
7 changed files with 97 additions and 20 deletions

View File

@ -400,12 +400,12 @@ export const setRootAriaHidden = (hidden = false) => {
}
};
export const present = async (
export const present = async <OverlayPresentOptions>(
overlay: OverlayInterface,
name: keyof IonicConfig,
iosEnterAnimation: AnimationBuilder,
mdEnterAnimation: AnimationBuilder,
opts?: any
opts?: OverlayPresentOptions
) => {
if (overlay.presented) {
return;
@ -478,14 +478,14 @@ const focusPreviousElementOnDismiss = async (overlayEl: any) => {
previousElement.focus();
};
export const dismiss = async (
export const dismiss = async <OverlayDismissOptions>(
overlay: OverlayInterface,
data: any | undefined,
role: string | undefined,
name: keyof IonicConfig,
iosLeaveAnimation: AnimationBuilder,
mdLeaveAnimation: AnimationBuilder,
opts?: any
opts?: OverlayDismissOptions
): Promise<boolean> => {
if (!overlay.presented) {
return false;