From 080c6e8dd9db355202fd2c84702ec8684aee49a9 Mon Sep 17 00:00:00 2001 From: Brice BERNARD Date: Fri, 8 Dec 2017 16:09:44 +0100 Subject: [PATCH] Fix req definition --- types/accepts/index.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/types/accepts/index.d.ts b/types/accepts/index.d.ts index 08ac71e919..33ee0db8a1 100644 --- a/types/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -1,13 +1,14 @@ // Type definitions for accepts 1.3 // Project: https://github.com/jshttp/accepts // Definitions by: Stefan Reichel +// Brice BERNARD // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace accepts { - interface Headers { - [key: string]: string | string[]; - } +/// +import { IncomingMessage } from "http"; + +declare namespace accepts { interface Accepts { /** * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. @@ -55,6 +56,6 @@ declare namespace accepts { } } -declare function accepts(req: { headers: accepts.Headers }): accepts.Accepts; +declare function accepts(req: IncomingMessage): accepts.Accepts; export = accepts;