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" }