refactor(configuration): Setup configuration and menu to be reuseable
This commit is contained in:
parent
863ae3fab2
commit
d46bbd84c5
21 changed files with 551 additions and 452 deletions
20
source/Configuration/ConfigurationProvider.ts
Normal file
20
source/Configuration/ConfigurationProvider.ts
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue