From 58beaec9b61ceedb2bcee45fdf73ec1b378c2259 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Wed, 28 Apr 2021 11:17:58 -0700 Subject: [PATCH] fix(kv): define `null` return type from `KV.Namespace[get]` --- src/kv.d.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/kv.d.ts b/src/kv.d.ts index b2db533..9d398cd 100644 --- a/src/kv.d.ts +++ b/src/kv.d.ts @@ -13,20 +13,21 @@ export namespace KV { } interface Namespace { - get(key: string, type: 'json'): Promise; - get(key: string, options: GetOptions<'json'>): Promise; + get(key: string, type: 'json'): Promise; + get(key: string, options: GetOptions<'json'>): Promise; - get(key: string, type: 'stream'): Promise; - get(key: string, options: GetOptions<'stream'>): Promise; + get(key: string, type: 'stream'): Promise; + get(key: string, options: GetOptions<'stream'>): Promise; - get(key: string, type: 'arrayBuffer'): Promise; - get(key: string, options: GetOptions<'arrayBuffer'>): Promise; + get(key: string, type: 'arrayBuffer'): Promise; + get(key: string, options: GetOptions<'arrayBuffer'>): Promise; - get(key: string, type: 'text'): Promise; - get(key: string, options: GetOptions<'text'>): Promise; + get(key: string, type: 'text'): Promise; + get(key: string, options: GetOptions<'text'>): Promise; + + get(key: string, type?: GetFormat): Promise; // "text" + get(key: string, options?: GetOptions ): Promise; // "text" - get(key: string, type?: GetFormat): Promise; // "text" - get(key: string, options?: GetOptions ): Promise; // "text"