From fc1405f019488b023516198ae3b28be069bd84bf Mon Sep 17 00:00:00 2001 From: Brendan Hurley Date: Wed, 26 Jun 2019 12:02:12 +0100 Subject: [PATCH 1/3] added typescript definition --- index.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..e25fa75 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,16 @@ +export = Credstash; + +declare class Credstash { + public list(options: Credstash.IConfig, callback: Credstash.Callback): void; + public get(value: string, options: Credstash.IConfig, callback: Credstash.Callback): void; +} + +declare namespace Credstash { + type Callback = (err: Error | null, response: T) => void; + + interface IConfig { + limit?: number, + region?: string, + table?: string + }; +} \ No newline at end of file From 923122f7fa75b054aed705eca54d39e0f8fb3159 Mon Sep 17 00:00:00 2001 From: Brendan Hurley Date: Wed, 26 Jun 2019 13:42:26 +0100 Subject: [PATCH 2/3] overloading for optionals --- index.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index e25fa75..98518dd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,16 +1,19 @@ export = Credstash; declare class Credstash { - public list(options: Credstash.IConfig, callback: Credstash.Callback): void; - public get(value: string, options: Credstash.IConfig, callback: Credstash.Callback): void; + list(options: Credstash.IOptions, callback: Credstash.Callback): void; + list(callback: Credstash.Callback): void; + + get(value: string, options: Credstash.IOptions, callback: Credstash.Callback): void; + get(value: string, callback: Credstash.Callback): void; } declare namespace Credstash { type Callback = (err: Error | null, response: T) => void; - interface IConfig { + interface IOptions { limit?: number, region?: string, table?: string - }; + } } \ No newline at end of file From 679b64a00f1651ea3c8c2fd59ebba062b36ae79f Mon Sep 17 00:00:00 2001 From: Brendan Hurley Date: Wed, 26 Jun 2019 13:49:06 +0100 Subject: [PATCH 3/3] 1.3.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e601063..bdc3274 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@pizza-hut/credstash", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 613a9aa..6238838 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pizza-hut/credstash", - "version": "1.3.0", + "version": "1.3.1", "description": "Module for reading credstash secrets", "main": "index.js", "scripts": {