Rewrite module function declaration & export to match template

Follows template in TS docs now:
https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-function-d-ts.html

Also makes it possible to reference interfaces from the NodeVault
namespace outside of this module.
This commit is contained in:
Eric Heikes
2018-02-15 10:27:14 -08:00
parent 6d08c4cece
commit 4820191c9e
2 changed files with 3 additions and 5 deletions

View File

@@ -122,7 +122,5 @@ declare namespace NodeVault {
}
}
type GetClient = (options?: NodeVault.VaultOptions) => NodeVault.client;
declare const getClient: GetClient;
export = getClient;
declare function NodeVault(options?: NodeVault.VaultOptions): NodeVault.client;
export = NodeVault;

View File

@@ -1,7 +1,7 @@
import nv = require("node-vault");
// Test code came from the sample code in README of the module.
const options = {
const options: nv.VaultOptions = {
apiVersion: 'v1', // default
endpoint: 'http://127.0.0.1:8200', // default
token: '1234', // optional client token; can be fetched after valid initialization of the server