DefinitelyTyped/types/cryptex/cryptex-tests.ts
Robert Brownstein b7f07cfbbd Add type definitions for cryptex (#35345)
* Add type information for cryptex module

* update tests

* Add test file to 'files'

* fix definitions for cryptex

* create additional tests
2019-05-14 11:13:56 -07:00

17 lines
415 B
TypeScript

import * as cryptex from "cryptex";
cryptex.update({
config: {
keySource: "none",
algorithm: "plaintext",
secretEncoding: "binary",
secrets: {
foo: "bar"
}
}
});
const value: Promise<string> = cryptex.getSecret("foo", true);
const decryptedValue: Promise<string> = cryptex.decrypt("foo");
const encryptedValue: Promise<string> = cryptex.encrypt("bar");