UNPKG

@o3r/configuration

Version:

This module contains configuration-related features such as CMS compatibility, Configuration override, store and debugging. It enables your application runtime configuration and comes with an integrated ng builder to help you generate configurations suppo

57 lines 2.97 kB
import { Store } from '@ngrx/store'; import { Configuration, CustomConfig } from '@o3r/core'; import { Observable } from 'rxjs'; import { ConfigOverrideStore } from '../../stores/config-override/index'; import { ConfigurationStore } from '../../stores/index'; import * as i0 from "@angular/core"; /** * Configuration service */ export declare class ConfigurationBaseService { private readonly store; private readonly extendedConfiguration; constructor(store: Store<ConfigurationStore & ConfigOverrideStore>); /** * Update a specific component config or add it to the store if does not exist * @param configuration to edit/add * @param configurationId Configuration ID */ upsertConfiguration<T extends Configuration>(configuration: T, configurationId?: string): void; /** * Update a specific component config * @param configuration Partial config to edit * @param configurationId Configuration ID */ updateConfiguration<T extends Partial<Configuration>>(configuration: T, configurationId?: string): void; /** * This function will get the configuration stored in the data attribute of the html's body tag * @param configTagName Value used to identify the data attribute where the config is pushed in the index.html */ getConfigFromBodyTag<T extends Configuration>(configTagName?: string): void; /** * Transform the custom configuration in store configuration model * @param customConfigObject Configuration object (extracted from body tag for static config or downloaded in case of dynamic config) */ computeConfiguration<T extends Configuration>(customConfigObject: CustomConfig<T>[]): void; /** * Complete a stored configuration by adding the missing fields * @param extension Configuration extension to be included in the store * @param configurationId Configuration ID to extend * @param forceUpdate Force update the configuration in the store */ extendConfiguration<T extends Configuration>(extension: T, configurationId?: string, forceUpdate?: boolean): void; /** * Operator to get the configuration from store for a given component and merge it with the global config * @param id Id of the component * @param defaultValue Default value of the configuration */ getComponentConfig<T extends Configuration>(id: string, defaultValue: T): (source: Observable<Partial<T> | undefined>) => Observable<T>; /** * Get an observable of the configuration from store for a given component and merge it with the global config + the config overrides from the rules engine * @param id Id of the component */ getConfig<T extends Configuration>(id: string): Observable<T>; static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurationBaseService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationBaseService>; } //# sourceMappingURL=configuration.base.service.d.ts.map