From 907e39efb23ade2facb23c88f39c1c1406919b25 Mon Sep 17 00:00:00 2001 From: "Dominik.Sigmund" <dominik.sigmund@br.de> Date: Tue, 19 Mar 2024 14:16:18 +0100 Subject: [PATCH] add factory function --- index.d.ts | 19 ++++++++++++------- package.json | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index 2959103..e849d18 100755 --- a/index.d.ts +++ b/index.d.ts @@ -1,7 +1,12 @@ -export class Config { - constructor(basePath?: string, envPrefix?: string); - _reload(): void; - _show(): any; - // Index signature - [key: string]: any; -} \ No newline at end of file +// Define the shape of the return type of the config function +interface Config { + _reload(): void; + _show(): any; + [key: string]: any; // Index signature for dynamic properties +} + +// Declare the function that returns a Config object +declare function createConfig(basePath?: string, envPrefix?: string): Config; + +// Export the declared function +export = createConfig; diff --git a/package.json b/package.json index 2fb9470..d143900 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@libs/config", - "version": "1.13.3", + "version": "1.13.4", "description": "Simple Config with ENV Support", "main": "index.js", "scripts": { -- GitLab