-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: Added configuration module for static components
- Loading branch information
1 parent
e218a10
commit b0cd9d8
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
/** | ||
* The configuration object for the application. | ||
*/ | ||
export interface ConfiUI { | ||
|
||
/** | ||
* The image node to use. | ||
*/ | ||
image?: React.ElementType<any>; | ||
|
||
} | ||
|
||
/** | ||
* The configuration object that should persist throughout the application. | ||
*/ | ||
const configuration: ConfiUI = {}; | ||
|
||
/** | ||
* This object is exported to provide a way to expose configuration settings. | ||
*/ | ||
export const configUI = { | ||
|
||
/** | ||
* Initializes the configuration. | ||
*/ | ||
init(config: ConfiUI) { | ||
Object.assign(configuration, config); | ||
}, | ||
|
||
/** | ||
* Gets the configuration based on the key. | ||
*/ | ||
get<K extends keyof ConfiUI>(key: K): ConfiUI[K] { | ||
return configuration[key]; | ||
} | ||
|
||
}; |