mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #15233 from pe8ter/master
[koa-cache-control] Add new typings.
This commit is contained in:
Vendored
+23
@@ -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,
|
||||
}));
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
|
||||
"noImplicitAny": "true",
|
||||
"noImplicitThis": "true",
|
||||
"strictNullChecks": "true"
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }
|
||||
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }
|
||||
|
||||
Reference in New Issue
Block a user