From 981c9d1112a5151c714aeec84e20ce0a92083256 Mon Sep 17 00:00:00 2001 From: Nimish Telang Date: Wed, 13 Jan 2016 17:18:43 +0000 Subject: [PATCH] Add missing methods to config --- convict/convict-tests.ts | 9 +++++++++ convict/convict.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/convict/convict-tests.ts b/convict/convict-tests.ts index 54a570141..3bd64c592 100644 --- a/convict/convict-tests.ts +++ b/convict/convict-tests.ts @@ -19,6 +19,9 @@ const format : convict.Format = { } }; + + + convict.addFormat(format); convict.addFormats({ prime: { @@ -113,4 +116,10 @@ if (conf.has('key')) { } }); } + +conf.getSchema(); +conf.getProperties(); +conf.getSchemaString(); +conf.toString(); + // vim:et:sw=2:ts=2 diff --git a/convict/convict.d.ts b/convict/convict.d.ts index 332441b20..51c1f6a68 100644 --- a/convict/convict.d.ts +++ b/convict/convict.d.ts @@ -31,6 +31,28 @@ declare module "convict" { loadFile(file: string): void; loadFile(files: string[]): void; validate(): void; + /** + * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getProperties() : Object; + /** + * Exports the schema as a {JSON} {Object} + * @returns {Object} A {JSON} compliant {Object} + */ + getSchema() : Object; + + /** + * Exports all the properties (that is the keys and their current values) as a JSON string. + * @returns {String} a string representing this object + */ + toString() : string; + + /** + * Exports the schema as a JSON string. + * @returns {String} a string representing the schema of this {Config} + */ + getSchemaString() : string; } } interface convict {