diff --git a/preact.d.ts b/preact.d.ts index 334e04fe..f66298a5 100644 --- a/preact.d.ts +++ b/preact.d.ts @@ -9,11 +9,15 @@ declare module 'virtual:pwa-register/preact' { export function useRegisterSW(options?: RegisterSWOptions): { needRefresh: [boolean, StateUpdater] offlineReady: [boolean, StateUpdater] - /** - * Reloads the current window to allow the service worker take the control. - * - * @param reloadPage From version 0.13.2+ this param is not used anymore. - */ - updateServiceWorker: (reloadPage?: boolean) => Promise + updateServiceWorker: { + /** + * Reloads the current window to allow the service worker take the control. + */ + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } } diff --git a/react.d.ts b/react.d.ts index 500b355c..0f66c55e 100644 --- a/react.d.ts +++ b/react.d.ts @@ -9,11 +9,15 @@ declare module 'virtual:pwa-register/react' { export function useRegisterSW(options?: RegisterSWOptions): { needRefresh: [boolean, Dispatch>] offlineReady: [boolean, Dispatch>] - /** - * Reloads the current window to allow the service worker take the control. - * - * @param reloadPage From version 0.13.2+ this param is not used anymore. - */ - updateServiceWorker: (reloadPage?: boolean) => Promise + updateServiceWorker: { + /** + * Reloads the current window to allow the service worker take the control. + */ + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } } diff --git a/solid.d.ts b/solid.d.ts index 47c173d4..1836460d 100644 --- a/solid.d.ts +++ b/solid.d.ts @@ -9,11 +9,15 @@ declare module 'virtual:pwa-register/solid' { export function useRegisterSW(options?: RegisterSWOptions): { needRefresh: [Accessor, Setter] offlineReady: [Accessor, Setter] - /** - * Reloads the current window to allow the service worker take the control. - * - * @param reloadPage From version 0.13.2+ this param is not used anymore. - */ - updateServiceWorker: (reloadPage?: boolean) => Promise + updateServiceWorker: { + /** + * Reloads the current window to allow the service worker take the control. + */ + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } } diff --git a/svelte.d.ts b/svelte.d.ts index b0227bcd..e6ca5dd2 100644 --- a/svelte.d.ts +++ b/svelte.d.ts @@ -9,11 +9,15 @@ declare module 'virtual:pwa-register/svelte' { export function useRegisterSW(options?: RegisterSWOptions): { needRefresh: Writable offlineReady: Writable - /** - * Reloads the current window to allow the service worker take the control. - * - * @param reloadPage From version 0.13.2+ this param is not used anymore. - */ - updateServiceWorker: (reloadPage?: boolean) => Promise + updateServiceWorker: { + /** + * Reloads the current window to allow the service worker take the control. + */ + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } } diff --git a/vanillajs.d.ts b/vanillajs.d.ts index 058ce25d..a4b1ba89 100644 --- a/vanillajs.d.ts +++ b/vanillajs.d.ts @@ -7,7 +7,13 @@ declare module 'virtual:pwa-register' { * Registers the service worker returning a callback to reload the current page when an update is found. * * @param options the options to register the service worker. - * @return (reloadPage?: boolean) => Promise From version 0.13.2+ `reloadPage` param is not used anymore. + * @return (reloadPage?: boolean) => Promise From version 0.14.0+ `reloadPage` param is not used anymore. */ - export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise + export function registerSW(options?: RegisterSWOptions): { + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } diff --git a/vue.d.ts b/vue.d.ts index 278c98e8..f5213de3 100644 --- a/vue.d.ts +++ b/vue.d.ts @@ -9,11 +9,15 @@ declare module 'virtual:pwa-register/vue' { export function useRegisterSW(options?: RegisterSWOptions): { needRefresh: Ref offlineReady: Ref - /** - * Reloads the current window to allow the service worker take the control. - * - * @param reloadPage From version 0.13.2+ this param is not used anymore. - */ - updateServiceWorker: (reloadPage?: boolean) => Promise + updateServiceWorker: { + /** + * Reloads the current window to allow the service worker take the control. + */ + (): Promise + /** + * @deprecated The `reloadPage` param is not used anymore sice 0.14.0 + */ + (reloadPage: boolean): Promise + } } }