mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
Merge pull request #26546 from wessberg/master
Added type definitions for workbox-sw
This commit is contained in:
1424
types/workbox-sw/index.d.ts
vendored
Normal file
1424
types/workbox-sw/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
26
types/workbox-sw/tsconfig.json
Normal file
26
types/workbox-sw/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"workbox-sw-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"lib": [
|
||||
"es2015",
|
||||
"dom",
|
||||
"webworker"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
12
types/workbox-sw/tslint.json
Normal file
12
types/workbox-sw/tslint.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-empty-interface": false,
|
||||
"array-type": false,
|
||||
"interface-name": false,
|
||||
"space-before-function-paren": false
|
||||
}
|
||||
}
|
||||
11
types/workbox-sw/workbox-sw-tests.ts
Normal file
11
types/workbox-sw/workbox-sw-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import WorkboxSW from "workbox-sw";
|
||||
|
||||
// $ExpectError
|
||||
WorkboxSW.core.setLogLevel(5); // $ExpectType void
|
||||
|
||||
WorkboxSW.routing.registerRoute("/", WorkboxSW.strategies.networkFirst()); // $ExpectType Route
|
||||
|
||||
// $ExpectError
|
||||
WorkboxSW.precaching.precacheAndRoute(/foo/);
|
||||
|
||||
WorkboxSW.precaching.precacheAndRoute(["some-resource.js"], {directoryIndex: "/"}); // $ExpectType void
|
||||
Reference in New Issue
Block a user