Sync plugin definitions to Hapi 17.

This commit is contained in:
Rodrigo Saboya
2018-02-17 15:08:34 -02:00
parent 2e4aad4d1f
commit d2ca629f0a
14 changed files with 51 additions and 51 deletions

View File

@@ -2,9 +2,9 @@
import Bcrypt = require('bcrypt');
import Basic = require('hapi-auth-basic');
import * as Hapi from 'hapi';
import { Server } from 'hapi';
const server = new Hapi.Server();
const server = new Server();
interface User {
username: string;

View File

@@ -5,7 +5,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import * as Hapi from 'hapi';
import { Plugin, Request, ResponseToolkit } from 'hapi';
declare namespace Basic {
interface ValidateCustomResponse {
@@ -18,10 +18,10 @@ declare namespace Basic {
}
interface Validate {
(request: Hapi.Request, username: string, password: string, h: object): Promise<ValidateResponse | ValidateCustomResponse>;
(request: Request, username: string, password: string, h: ResponseToolkit): Promise<ValidateResponse | ValidateCustomResponse>;
}
}
declare var Basic: Hapi.PluginFunction<{}>;
declare var Basic: Plugin<{}>;
export = Basic;

View File

@@ -16,9 +16,6 @@
"paths": {
"boom": [
"boom/v4"
],
"hapi": [
"hapi/v16"
]
},
"noEmit": true,
@@ -28,4 +25,4 @@
"index.d.ts",
"hapi-auth-basic-tests.ts"
]
}
}