Skip to content

Type definitions for ServiceWorker(and optionally Workbox)

License

Notifications You must be signed in to change notification settings

shqld/types-serviceworker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

types-serviceworker

Type definitions for ServiceWorker(and optionally Workbox)

See example.

Install

yarn add -D types-serviceworker

Usage

Use Triple-Slash Directives:

/// <reference types="node_modules/types-serviceworker" />
/// <reference types="node_modules/types-serviceworker/lib/workbox" />

Or if you write Service Worker scripts with a dedicated tsconfig.json for that, you also can do by simply adding:

{
  "compilerOptions": {
    "types": [/* ...others */, "node_modules/types-serviceworker"],
    /* ... */
  }
  /* ... */
}

NOTE: There are some caveats using types field. See this for detail.

If types is specified, only packages listed will be included

Credits

types-serviceworker partially uses 2 files(src/webworkers.d.ts, src/workbox.d.ts) respectively copied from

and modifies them under the lincenses.

About

Type definitions for ServiceWorker(and optionally Workbox)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published