From bad2f23bd7f36989cd15acdb37d855ce4271b29f Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Thu, 25 Apr 2024 10:33:23 +0200 Subject: [PATCH] Improve types for the use in TypeScript in apps --- src/current.ts | 3 ++- tsconfig.json | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/current.ts b/src/current.ts index c13cd1c..7a61372 100644 --- a/src/current.ts +++ b/src/current.ts @@ -2,6 +2,7 @@ import { camelize } from "./util" type CurrentValueObject = { [key: string]: string } type CurrentValue = string | CurrentValueObject +type CurrentType = { [key: string]: CurrentValue | undefined } const currentProxy = { get(_target: object, propertyName: string): CurrentValue { @@ -25,7 +26,7 @@ const currentProxy = { }, } -export const Current = new Proxy({}, currentProxy) +export const Current: CurrentType = new Proxy({}, currentProxy) export const config = { prefix: "current", } diff --git a/tsconfig.json b/tsconfig.json index c1eaa6d..f9a62c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,5 +17,8 @@ "typeRoots": [ "./node_modules/@types" ] - } + }, + "include": [ + "src/**/*" + ], }