import { RulesEngineAction, RulesEngineActionHandler } from '@o3r/core'; import { Observable, Subject } from 'rxjs'; import * as i2 from '@o3r/components'; import { PlaceholderRequestReply } from '@o3r/components'; import * as i0 from '@angular/core'; import * as i1 from '@ngrx/effects'; /** * Minimal subset of the underlying translation service (ngx-translate's `TranslateService` or * transloco's `TranslocoService`) exposing language-change notifications. * TODO: remove this abstraction and rely on the single supported translation service in v16 */ interface PlaceholderTranslateService { /** Language-change stream exposed by ngx-translate (`@o3r/localization`) */ onLangChange?: Observable<{ lang: string; }>; /** Language-change stream exposed by transloco (`@o3r/transloco`) */ langChanges$?: Observable; } /** * Minimal subset of the `LocalizationService` API (from `@o3r/localization` or `@o3r/transloco`) * used by the placeholder rules engine. Declared locally so that neither package is a hard dependency. * TODO: remove this abstraction and import `LocalizationService` directly from the single supported translation package in v16 */ interface PlaceholderLocalizationService { /** Translate a localization key, resolving the given interpolation parameters */ translate(key: string, interpolateParams?: object): Observable; /** Get the underlying translation service used by the localization service */ getTranslateService(): PlaceholderTranslateService; /** Get the current active language */ getCurrentLanguage(): string; } /** ActionUpdatePlaceholderBlock */ declare const RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE = "UPDATE_PLACEHOLDER"; /** * Content of action that updates a placeholder */ interface ActionUpdatePlaceholderBlock extends RulesEngineAction { actionType: typeof RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE; placeholderId: string; value: string; priority?: number; } /** * Service to handle async PlaceholderTemplate actions */ declare class PlaceholderRulesEngineActionHandler implements RulesEngineActionHandler { private readonly logger; private readonly injector; private readonly translationService; protected placeholdersActions$: Subject<{ placeholderId: string; templateUrl: string; priority: number; }[]>; /** @inheritdoc */ readonly supportingActions: readonly ["UPDATE_PLACEHOLDER"]; constructor(); /** * Localize the url, replacing the language marker * @param url * @param language */ protected resolveUrlWithLang(url: string, language: string | null): string; /** * Retrieve template as json from a given url * @param url */ protected retrieveTemplate(url: string): Promise; /** @inheritdoc */ executeActions(actions: ActionUpdatePlaceholderBlock[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class PlaceholderRulesEngineActionModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { PlaceholderRulesEngineActionHandler, PlaceholderRulesEngineActionModule, RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE }; export type { ActionUpdatePlaceholderBlock, PlaceholderLocalizationService, PlaceholderTranslateService }; //# sourceMappingURL=o3r-components-rules-engine.d.ts.map