DefinitelyTyped/types/cloud-config-client/cloud-config-client-tests.ts
2019-09-04 16:27:22 -07:00

30 lines
677 B
TypeScript

import client = require('cloud-config-client');
client.load({
name: 'invoices'
}).then(config => {
const conf = config; // $ExpectType Config
const value1 = config.get('this.is.a.key'); // $ExpectType any
});
// Async through IFFE
(async () => {
const config = await client.load({name: 'invoices'}); // $ExpectType Config
})();
// With additional options
client.load({
name: 'invoices',
profiles: ['profile1', 'profile2'],
label: 'label',
auth: {
pass: 'password',
user: 'admin',
}
}).then(config => {
const conf = config; // $ExpectType Config
const value1 = config.get('this.is.a.key'); // $ExpectType any
});