Skip to content

Commit b482359

Browse files
committed
Added typings for basic-auth
1 parent 54f0643 commit b482359

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

basic-auth/basic-auth-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference path="basic-auth.d.ts" />
2+
3+
import auth = require('basic-auth');
4+
5+
auth(null);

basic-auth/basic-auth.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Type definitions for basic-auth
2+
// Project: https://github.com/jshttp/basic-auth
3+
// Definitions by: Clément Bourgeois <https://github.com/moonpyk>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../express/express.d.ts" />
7+
8+
declare module BasicAuth {
9+
export interface BasicAuthResult {
10+
name:string;
11+
pass:string;
12+
}
13+
}
14+
15+
declare module "basic-auth" {
16+
function auth(req: Express.Request): BasicAuth.BasicAuthResult;
17+
18+
export = auth;
19+
}

0 commit comments

Comments
 (0)