From b482359ae78a7db7db2829bd6252103d9c875ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Bourgeois?= Date: Sat, 3 Oct 2015 20:52:42 +0200 Subject: [PATCH] Added typings for basic-auth --- basic-auth/basic-auth-tests.ts | 5 +++++ basic-auth/basic-auth.d.ts | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 basic-auth/basic-auth-tests.ts create mode 100644 basic-auth/basic-auth.d.ts diff --git a/basic-auth/basic-auth-tests.ts b/basic-auth/basic-auth-tests.ts new file mode 100644 index 0000000000..54be7af1f4 --- /dev/null +++ b/basic-auth/basic-auth-tests.ts @@ -0,0 +1,5 @@ +/// + +import auth = require('basic-auth'); + +auth(null); diff --git a/basic-auth/basic-auth.d.ts b/basic-auth/basic-auth.d.ts new file mode 100644 index 0000000000..e039989971 --- /dev/null +++ b/basic-auth/basic-auth.d.ts @@ -0,0 +1,19 @@ +// Type definitions for basic-auth +// Project: https://github.com/jshttp/basic-auth +// Definitions by: Clément Bourgeois +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module BasicAuth { + export interface BasicAuthResult { + name:string; + pass:string; + } +} + +declare module "basic-auth" { + function auth(req: Express.Request): BasicAuth.BasicAuthResult; + + export = auth; +}