Merge pull request #15233 from pe8ter/master

[koa-cache-control] Add new typings.
This commit is contained in:
Paul van Brenk
2017-03-20 14:23:30 -07:00
committed by GitHub
5 changed files with 72 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for koa-cache-control 2.0
// Project: https://github.com/DaMouse404/koa-cache-control
// Definitions by: Peter Safranek <https://github.com/pe8ter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Koa from "koa";
declare function cacheControl(options?: {
private?: boolean;
public?: boolean;
noStore?: boolean;
noCache?: boolean;
noTransform?: boolean;
mustRevalidate?: boolean;
staleIfError?: number;
staleWhileRevalidate?: number;
maxAge?: number;
sMaxAge?: number;
}): Koa.Middleware;
declare namespace cacheControl {}
export = cacheControl;
@@ -0,0 +1,19 @@
import * as Koa from "koa";
import * as cacheControl from "koa-cache-control";
const app = new Koa();
app.use(cacheControl());
app.use(cacheControl({}));
app.use(cacheControl({
private: true,
public: true,
noStore: true,
noCache: true,
noTransform: true,
mustRevalidate: true,
staleIfError: 0,
staleWhileRevalidate: 0,
maxAge: 0,
sMaxAge: 0,
}));
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"koa-cache-control-tests.ts"
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../tslint.json",
"noImplicitAny": "true",
"noImplicitThis": "true",
"strictNullChecks": "true"
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }