refactor(configuration): Setup configuration and menu to be reuseable

This commit is contained in:
Michel Fedde 2025-06-23 00:57:02 +02:00
parent 863ae3fab2
commit d46bbd84c5
21 changed files with 551 additions and 452 deletions

View file

@ -0,0 +1,20 @@
import {ConfigurationModel} from "../Database/Models/ConfigurationModel";
import {Model} from "../Database/Models/Model";
import {ValueOf} from "../types/Class";
import {Nullable} from "../types/Nullable";
import {ConfigurationTransformer} from "./ConfigurationTransformer";
export interface ConfigurationProvider<
TProviderModel extends ConfigurationModel = ConfigurationModel,
TRuntimeConfiguration extends object = object
> {
get(path: string): Nullable<TProviderModel>;
getAll(): TProviderModel[];
get defaults(): TRuntimeConfiguration;
save(value: Omit<ConfigurationModel, "id"> & Partial<Model>): void;
getTransformer(): ConfigurationTransformer;
}