From 146309c2024d92ce04941bd30ae43fd54a401d86 Mon Sep 17 00:00:00 2001 From: Rafael Santana Date: Thu, 28 May 2020 09:19:54 -0300 Subject: [PATCH] fix(types): support for generic types in interfaces and methods (#1981) --- sweetalert2.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sweetalert2.d.ts b/sweetalert2.d.ts index d6ec80fcd..f5abbc80c 100644 --- a/sweetalert2.d.ts +++ b/sweetalert2.d.ts @@ -21,7 +21,7 @@ declare module 'sweetalert2' { * Swal.fire('The Internet?', 'That thing is still around?', 'question'); * ``` */ - function fire(title?: string, html?: string, icon?: SweetAlertIcon): Promise; + function fire(title?: string, html?: string, icon?: SweetAlertIcon): Promise>; /** * Function to display a SweetAlert2 popup, with an object of options, all being optional. @@ -36,7 +36,7 @@ declare module 'sweetalert2' { * }) * ``` */ - function fire(options: SweetAlertOptions): Promise; + function fire(options: SweetAlertOptions): Promise>; /** * Reuse configuration by creating a `Swal` instance. @@ -80,7 +80,7 @@ declare module 'sweetalert2' { * @param result The promise originally returned by `Swal.fire()` will be resolved with this value. * If no object is given, the promise is resolved with an empty `SweetAlertResult` object. */ - function close(result?: SweetAlertResult): void; + function close(result?: SweetAlertResult): void; /** * Gets the popup. @@ -350,8 +350,8 @@ declare module 'sweetalert2' { export type SweetAlertGrow = 'row' | 'column' | 'fullscreen' | false; - export interface SweetAlertResult { - value?: any; + export interface SweetAlertResult { + value?: T; dismiss?: Swal.DismissReason; isConfirmed: boolean; isDismissed: boolean;