From 120dbdb0e2224f5cc69b0ae6db9a8d818fe07c34 Mon Sep 17 00:00:00 2001 From: Dave Wasmer Date: Sat, 3 Feb 2018 12:49:52 -0700 Subject: [PATCH 1/3] Fix accepts.encodings parameters --- types/accepts/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/accepts/index.d.ts b/types/accepts/index.d.ts index 33ee0db8a1..0b36e3b640 100644 --- a/types/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -24,6 +24,7 @@ declare namespace accepts { /** * Return the first accepted encoding. If nothing in `encodings` is accepted, then `false` is returned. */ + encoding(): string[]; encoding(encodings: string[]): string | false; encoding(...encodings: string[]): string | false; @@ -31,6 +32,8 @@ declare namespace accepts { * Return the encodings that the request accepts, in the order of the client's preference (most preferred first). */ encodings(): string[]; + encodings(encodings: string[]): string | false; + encodings(...encodings: string[]): string | false; /** * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. From 197062a1790ad3fe7ff6faae98c3ef3020bf0dc9 Mon Sep 17 00:00:00 2001 From: Dave Wasmer Date: Sat, 3 Feb 2018 12:57:30 -0700 Subject: [PATCH 2/3] Fix charset signatures, update doc comments --- types/accepts/index.d.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/types/accepts/index.d.ts b/types/accepts/index.d.ts index 0b36e3b640..c5cc9a7936 100644 --- a/types/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -12,24 +12,35 @@ declare namespace accepts { interface Accepts { /** * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. + * If no charsets are supplied, all accepted charsets are returned, in the order of the client's preference + * (most preferred first). */ + charset(): string[]; charset(charsets: string[]): string | false; charset(...charsets: string[]): string | false; /** - * Return the charsets that the request accepts, in the order of the client's preference (most preferred first). + * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. + * If no charsets are supplied, all accepted charsets are returned, in the order of the client's preference + * (most preferred first). */ charsets(): string[]; + charsets(charsets: string[]): string | false; + charsets(...charsets: string[]): string | false; /** * Return the first accepted encoding. If nothing in `encodings` is accepted, then `false` is returned. + * If no encodings are supplied, all accepted encodings are returned, in the order of the client's preference + * (most preferred first). */ encoding(): string[]; encoding(encodings: string[]): string | false; encoding(...encodings: string[]): string | false; /** - * Return the encodings that the request accepts, in the order of the client's preference (most preferred first). + * Return the first accepted encoding. If nothing in `encodings` is accepted, then `false` is returned. + * If no encodings are supplied, all accepted encodings are returned, in the order of the client's preference + * (most preferred first). */ encodings(): string[]; encodings(encodings: string[]): string | false; From c459668c8ca1c9c6810f3e680f9edc7c82495407 Mon Sep 17 00:00:00 2001 From: Dave Wasmer Date: Sat, 3 Feb 2018 13:01:04 -0700 Subject: [PATCH 3/3] Fix language(s) signatures --- types/accepts/index.d.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/types/accepts/index.d.ts b/types/accepts/index.d.ts index c5cc9a7936..02cb0fbb97 100644 --- a/types/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -48,14 +48,39 @@ declare namespace accepts { /** * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. + * If no languaes are supplied, all accepted languages are returned, in the order of the client's preference + * (most preferred first). */ + language(): string[]; language(languages: string[]): string | false; language(...languages: string[]): string | false; /** - * Return the languages that the request accepts, in the order of the client's preference (most preferred first). + * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. + * If no languaes are supplied, all accepted languages are returned, in the order of the client's preference + * (most preferred first). */ languages(): string[]; + languages(languages: string[]): string | false; + languages(...languages: string[]): string | false; + + /** + * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. + * If no languaes are supplied, all accepted languages are returned, in the order of the client's preference + * (most preferred first). + */ + lang(): string[]; + lang(languages: string[]): string | false; + lang(...languages: string[]): string | false; + + /** + * Return the first accepted language. If nothing in `languages` is accepted, then `false` is returned. + * If no languaes are supplied, all accepted languages are returned, in the order of the client's preference + * (most preferred first). + */ + langs(): string[]; + langs(languages: string[]): string | false; + langs(...languages: string[]): string | false; /** * Return the first accepted type (and it is returned as the same text as what appears in the `types` array). If nothing in `types` is accepted, then `false` is returned.