Add typings for the inert extension to hapi.js

see: https://github.com/hapijs/inert/pull/78
This commit is contained in:
Steve Ognibene
2016-12-13 10:45:14 -05:00
parent e871ceddab
commit 15fe2ba0e6
5 changed files with 52 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for inert 4.0
// Project: https://github.com/hapijs/inert/
// Definitions by: Steve Ognibene <http://github.com/nycdotnet>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Note: this definition contains only enough to make TypeScript happy (hapi?) when
// importing inert. The functionality that importing inert adds to the reply
// object and its other features are implemented in the hapi definition on
// DefinitelyTyped. The inert object is never actually used in practice except to
// be passed as an extension to the server.register() method which already takes
// an `any` argument, so just using `any` here is fine.
/// <reference types="node" />
export var inert: any;
+7
View File
@@ -0,0 +1,7 @@
import * as HapiES6 from 'hapi';
import * as InertES6 from 'inert';
const server = new HapiES6.Server({});
server.register(InertES6, () => {});
+9
View File
@@ -0,0 +1,9 @@
const Inert = require('inert');
const Hapi = require('hapi');
const server = new Hapi.Server({});
server.register(Inert, () => {});
export var makeThisAModule: any;
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"inert-tests.ts",
"inert-tests-es6.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }