From ba3d104da95daf5921e06fd5126a3be165d49628 Mon Sep 17 00:00:00 2001 From: eskelter Date: Thu, 12 Oct 2017 15:56:10 -0400 Subject: [PATCH 1/2] Adds Typescript definition file index.d.ts --- index.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..0e847a6 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,19 @@ +declare namespace keypair { + export interface Options { + bits?: number, + e?: number + } + + export interface Results { + public: string, + private: string + } +} + +/** + * Get an RSA PEM key pair. + * @param opts + */ +declare function keypair (opts?: keypair.Options): keypair.Results; + +export = keypair; \ No newline at end of file From 38537374a94abdef92507cda81abb5c45685ccb2 Mon Sep 17 00:00:00 2001 From: eskelter Date: Sat, 14 Oct 2017 10:19:13 -0400 Subject: [PATCH 2/2] Improves type declarations --- index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/index.d.ts b/index.d.ts index 0e847a6..ce5ec94 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,19 +1,19 @@ -declare namespace keypair { - export interface Options { - bits?: number, - e?: number - } - - export interface Results { - public: string, - private: string - } +// Type definitions for keypair 1.0 +// Project: https://www.npmjs.com/package/keypair +// Definitions by: eskelter +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +export interface KeypairOptions { + bits?: number; + e?: number; +} +export interface KeypairResults { + public: string; + private: string; } /** * Get an RSA PEM key pair. * @param opts */ -declare function keypair (opts?: keypair.Options): keypair.Results; - -export = keypair; \ No newline at end of file +export function keypair(opts?: KeypairOptions): KeypairResults;