Add package kms-json (#22908)

This commit is contained in:
sunnyone
2018-01-18 03:44:57 +09:00
committed by Wesley Wigham
parent a2b1522a8d
commit cc8ffe17f0
4 changed files with 56 additions and 0 deletions

22
types/kms-json/index.d.ts vendored Normal file
View File

@@ -0,0 +1,22 @@
// Type definitions for kms-json 1.1
// Project: https://github.com/AlexanderMS/kms-json
// Definitions by: Yoichi Imai <https://github.com/sunnyone>
// 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;

View File

@@ -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");

View File

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

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }