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 {