npm.io
0.0.3 • Published 2 years ago

@types/service-worker-updater

Licence
MIT
Version
0.0.3
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/service-worker-updater

Summary

This package contains type definitions for service-worker-updater (https://github.com/cactoo/service-worker-updater#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/service-worker-updater.

index.d.ts

// Minimum TypeScript Version: 4.0

import * as React from "react";

export type UpdateHandler = () => void;

export interface CheckOptions {
    checkInterval?: number;
    updateOnLoad?: boolean;
}

export type UpdateHookResult = [hasUpdate: boolean, updateHandler: UpdateHandler];
export function useSWUpdateChecker(opts?: CheckOptions): UpdateHookResult;

export interface InjectedUpdateProps {
    hasUpdate: boolean;
    updateHandler: UpdateHandler;
}

export function withSWUpdateChecker<P extends InjectedUpdateProps>(
    WrappedComponent: React.ComponentType<P>,
    opts?: CheckOptions,
): React.ComponentClass<Omit<P, keyof InjectedUpdateProps>>;

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: @types/react

Credits

These definitions were written by mike castleman.