Merge pull request #34524 from wessberg/master

Update workbox-sw types to v4.2.0
This commit is contained in:
Benjamin Lichtman
2019-04-10 10:27:42 -07:00
committed by GitHub
6 changed files with 2619 additions and 521 deletions

File diff suppressed because it is too large Load Diff

1426
types/workbox-sw/v3/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
{
"files": [
"index.d.ts",
"workbox-sw-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"lib": [
"es2015",
"webworker"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": ["../../"],
"paths": {
"workbox-sw": [
"workbox-sw/v3"
],
"workbox-sw/*": [
"workbox-sw/v3/*"
]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
}

View 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
}
}

View File

@@ -0,0 +1,11 @@
import WorkboxSW = require("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

View File

@@ -1,7 +1,6 @@
import WorkboxSW = require("workbox-sw");
// $ExpectError
WorkboxSW.core.setLogLevel(5); // $ExpectType void
WorkboxSW.routing.registerRoute("/", new WorkboxSW.strategies.NetworkFirst()); // $ExpectType Route
WorkboxSW.routing.registerRoute("/", WorkboxSW.strategies.networkFirst()); // $ExpectType Route