mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 19:42:27 +08:00
Added types for koa-sslify
This commit is contained in:
25
types/koa-sslify/index.d.ts
vendored
Normal file
25
types/koa-sslify/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for koa-sslify 2.1
|
||||
// Project: https://github.com/turboMaCk/koa-sslify#readme
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as koa from 'koa';
|
||||
|
||||
declare namespace sslify {
|
||||
interface Options {
|
||||
trustProtoHeader?: boolean;
|
||||
trustAzureHeader?: boolean;
|
||||
port?: number;
|
||||
hostname?: string;
|
||||
ignoreUrl?: boolean;
|
||||
temporary?: boolean;
|
||||
redirectMethods?: string[];
|
||||
internalRedirectMethods?: string[];
|
||||
specCompliantDisallow?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare function sslify(options: sslify.Options): koa.Middleware;
|
||||
|
||||
export = sslify;
|
||||
40
types/koa-sslify/koa-sslify-tests.ts
Normal file
40
types/koa-sslify/koa-sslify-tests.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import Koa = require('koa');
|
||||
import sslify = require('koa-sslify');
|
||||
|
||||
new Koa().use(sslify({}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
trustAzureHeader: true,
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
trustProtoHeader: true,
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
specCompliantDisallow: true,
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
port: 1234,
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
hostname: 'my-host',
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
temporary: false,
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
internalRedirectMethods: ['GET'],
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
redirectMethods: ['GET'],
|
||||
}));
|
||||
|
||||
new Koa().use(sslify({
|
||||
ignoreUrl: true,
|
||||
}));
|
||||
23
types/koa-sslify/tsconfig.json
Normal file
23
types/koa-sslify/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"koa-sslify-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/koa-sslify/tslint.json
Normal file
1
types/koa-sslify/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user