mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
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:
6
types/node-vault/index.d.ts
vendored
6
types/node-vault/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user