From cc8ffe17f0c122cf7bf4d40835ad6dc8dca351b4 Mon Sep 17 00:00:00 2001 From: sunnyone Date: Thu, 18 Jan 2018 03:44:57 +0900 Subject: [PATCH] Add package kms-json (#22908) --- types/kms-json/index.d.ts | 22 ++++++++++++++++++++++ types/kms-json/kms-json-tests.ts | 10 ++++++++++ types/kms-json/tsconfig.json | 23 +++++++++++++++++++++++ types/kms-json/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/kms-json/index.d.ts create mode 100644 types/kms-json/kms-json-tests.ts create mode 100644 types/kms-json/tsconfig.json create mode 100644 types/kms-json/tslint.json diff --git a/types/kms-json/index.d.ts b/types/kms-json/index.d.ts new file mode 100644 index 0000000000..b7a7881f85 --- /dev/null +++ b/types/kms-json/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for kms-json 1.1 +// Project: https://github.com/AlexanderMS/kms-json +// Definitions by: Yoichi Imai +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +declare namespace KmsJson { + interface KmsJsonOptions { + awsKmsSettings?: object; + keyId: string; + encoding?: string; + } +} + +declare class KmsJson { + constructor(options: KmsJson.KmsJsonOptions); + encrypt(inputJson: object): string; + decrypt(cipherText: string): object; +} + +export = KmsJson; diff --git a/types/kms-json/kms-json-tests.ts b/types/kms-json/kms-json-tests.ts new file mode 100644 index 0000000000..d9825f949c --- /dev/null +++ b/types/kms-json/kms-json-tests.ts @@ -0,0 +1,10 @@ +import KmsJson = require('kms-json'); + +const kmsJson = new KmsJson({ + awsKmsSettings: { }, + keyId: "foo", + encoding: "base64" +}); + +kmsJson.encrypt({ abc: 123 }); +kmsJson.decrypt("bar"); diff --git a/types/kms-json/tsconfig.json b/types/kms-json/tsconfig.json new file mode 100644 index 0000000000..f8ac8d1921 --- /dev/null +++ b/types/kms-json/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "kms-json-tests.ts" + ] +} diff --git a/types/kms-json/tslint.json b/types/kms-json/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/kms-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }