import * as _o3r_core from '@o3r/core'; import { Output, ItemIdentifier, ConfigPropertyWidget, CategoryDescription, AsyncStoreItem, AsyncRequest, FailAsyncStoreItemEntitiesActionPayload, FromApiActionPayload, UpdateAsyncStoreItemEntityActionPayloadWithId, UpdateEntityActionPayloadWithId, asyncEntitySerializer, Serializer, SetEntityActionPayload, OtterMessageContent, ConnectContentMessage, RequestMessagesContentMessage, MessageDataTypes, DevtoolsCommonOptions, DevtoolsServiceInterface, Configuration, ContextInput, BaseContextOutput, Context, Functionify } from '@o3r/core'; export { BaseContextOutput, Context, ContextInput, TemplateContext } from '@o3r/core'; import { Observable, BehaviorSubject } from 'rxjs'; import * as _ngrx_entity from '@ngrx/entity'; import { EntityState } from '@ngrx/entity'; import * as i0 from '@angular/core'; import { InjectionToken, ModuleWithProviders, OnChanges, OnDestroy, Type, InputSignal, ComponentRef, SimpleChanges, PipeTransform, OnInit, AfterViewChecked, Signal } from '@angular/core'; import * as _ngrx_store from '@ngrx/store'; import { ActionReducer, Action, ReducerTypes, ActionCreator } from '@ngrx/store'; import * as _o3r_components from '@o3r/components'; import { AbstractControl, FormControl } from '@angular/forms'; import * as i2 from '@angular/common'; /** Types of components config */ type ConfigType = 'Block' | 'Page' | 'AppRuntimeConfiguration' | 'AppBuildConfiguration' | 'ExposedComponent'; /** Type of components we can have in an application */ type ComponentStructure = 'PAGE' | 'BLOCK' | 'COMPONENT' | 'APPLICATION' | 'NESTED_ELEMENT' | 'EXPOSED_COMPONENT'; /** Component context information */ interface ComponentContext { /** Context library */ library: string; /** Context class name */ name: string; } /** Component config information */ interface ComponentConfig { /** Config library */ library: string; /** Config class name */ name: string; } /** Placeholder data identifier */ interface PlaceholderData { /** Id of the placeholder */ id: string; /** Description of the placeholder */ description: string; } /** Placeholder metadata */ interface PlaceholdersMetadata { /** Component library */ library: string; /** Component name */ name: string; /** Placeholders available for the component */ placeholders: PlaceholderData[]; } /** * Output generated for component class metadata */ interface ComponentClassOutput extends Output { /** Component library */ library: string; /** Component name */ name: string; /** Component path */ path: string; /** Component selector */ selector: string; /** Component type */ type: ComponentStructure; /** Component context */ context?: ComponentContext; /** Component config */ config?: ComponentConfig; /** Placeholders available for the component */ placeholders?: PlaceholderData[]; /** Determine if the component is activating a ruleset */ linkableToRuleset: boolean; /** List of localization keys used in the component */ localizationKeys?: string[]; } /** Property types */ type ConfigPropertyTypes = 'boolean' | 'number' | 'string' | 'string[]' | 'element[]' | 'enum' | 'enum[]' | 'unknown' | 'unknown[]'; /** * Interface that check if the Nested configuration defined match the cms requirements * It only supports a 1 level depth object, containing primitive types (string | number | boolean) */ interface NestedConfiguration { [key: string]: string | boolean | number; } /** Representation of a config field */ interface ConfigProperty { /** Name of the configuration property */ name: string; /** Description associated to the configuration property */ description: string; /** Configuration type: string, number, boolean ... */ type: ConfigPropertyTypes; /** Config property default value if primitive */ value?: string; /** Config property default values if array of primitive */ values?: (string | NestedConfiguration)[]; /** Label to be used in the CMS for this config */ label: string; /** Reference to the nested configuration if applicable */ reference?: ItemIdentifier; /** List of possible value options */ choices?: string[]; /** The category of the config property */ category?: string; /** The CMS widget information */ widget?: ConfigPropertyWidget; /** If true, the CMS user must specify a value for the property */ required?: boolean; /** Restriction keys */ restrictionKeys?: string[]; } /** * Output generated for component config metadata */ interface ComponentConfigOutput extends Output { /** Component's library */ library: string; /** Component type */ type: ComponentStructure; /** Flag for application config to identify it as a runtime config */ runtime?: boolean; /** Title of the configuration property */ title?: string; /** Description associated to the configuration property */ description?: string; /** Configuration tags */ tags?: string[]; /** Configuration fields */ properties: ConfigProperty[]; /** Category (taken from `@o3rCategories` tag) */ categories?: CategoryDescription[]; } /** * Output generated for component config metadata */ interface ComponentConfigOutputs { /** * List of configuration output for a component */ componentConfigOutput: ComponentConfigOutput[]; } /** * Output generated for component metadata */ interface ComponentOutput { components: ComponentClassOutput[]; configurations: ComponentConfigOutput[]; } /** * Buffers and emits data for lazy/progressive rendering of big lists * That could solve issues with long-running tasks when trying to render an array * of similar components. * @param delayMs Delay between data emits * @param concurrency Amount of elements that should be emitted at once */ declare function lazyArray(delayMs?: number, concurrency?: number): (source$: Observable) => Observable; /** * Variable model from the placeholder reply */ interface PlaceholderVariable { type: 'fact' | 'fullUrl' | 'relativeUrl' | 'localisation'; value: string; parameters?: Record; path?: string; } /** * Raw JSON template coming back from the CMS or any other source */ interface PlaceholderRequestReply { template?: string; vars?: Record; } /** * PlaceholderRequest model */ interface PlaceholderRequestModel extends AsyncStoreItem, PlaceholderRequestReply { /** Raw URL that is not localized, ex: my_url/[LANGUAGE]/my_placeholder.json */ id: string; /** Resolved URL that is localized, ex: my_url/en-GB/my_placeholder.json */ resolvedUrl: string; /** Rendered template associated to the resolved URL, can be dynamic */ renderedTemplate?: string; /** Unknown type found in the reply */ unknownTypeFound?: boolean; /** A mechanism to cache previous request results for a given language. This boolean disables the dynamic rendering when it is set to false */ used?: boolean; } /** * PlaceholderRequest state details */ interface PlaceholderRequestStateDetails extends AsyncStoreItem { } /** * PlaceholderRequest store state */ interface PlaceholderRequestState extends EntityState, PlaceholderRequestStateDetails { } /** * Name of the PlaceholderRequest Store */ declare const PLACEHOLDER_REQUEST_STORE_NAME = "placeholderRequest"; /** * PlaceholderRequest Store Interface */ interface PlaceholderRequestStore { /** PlaceholderRequest state */ [PLACEHOLDER_REQUEST_STORE_NAME]: PlaceholderRequestState; } /** Action to cancel a Request ID registered in the store. Can happen from effect based on a switchMap for instance */ declare const cancelPlaceholderRequest: _ngrx_store.ActionCreator<"[PlaceholderRequest] cancel request", (props: AsyncRequest & { id: string; }) => AsyncRequest & { id: string; } & _ngrx_store.Action<"[PlaceholderRequest] cancel request">>; /** Action to update failureStatus for PlaceholderRequestModels */ declare const failPlaceholderRequestEntity: _ngrx_store.ActionCreator<"[PlaceholderRequest] fail entities", (props: FailAsyncStoreItemEntitiesActionPayload) => FailAsyncStoreItemEntitiesActionPayload & _ngrx_store.Action<"[PlaceholderRequest] fail entities">>; /** Action to update an entity */ declare const updatePlaceholderRequestEntity: _ngrx_store.ActionCreator<"[PlaceholderRequest] update entity", (props: UpdateAsyncStoreItemEntityActionPayloadWithId) => UpdateAsyncStoreItemEntityActionPayloadWithId & _ngrx_store.Action<"[PlaceholderRequest] update entity">>; /** Action to update an entity without impact on request id */ declare const updatePlaceholderRequestEntitySync: _ngrx_store.ActionCreator<"[PlaceholderRequest] update entity sync", (props: UpdateEntityActionPayloadWithId) => UpdateEntityActionPayloadWithId & _ngrx_store.Action<"[PlaceholderRequest] update entity sync">>; /** Action to update PlaceholderRequest with known IDs, will create the entity with only the url, the call will be created in the effect */ declare const setPlaceholderRequestEntityFromUrl: _ngrx_store.FunctionWithParametersType<[props: FromApiActionPayload & { resolvedUrl: string; id: string; }], FromApiActionPayload & { resolvedUrl: string; id: string; } & AsyncRequest & _ngrx_store.Action<"[PlaceholderRequest] set entity from url">> & _ngrx_store.Action<"[PlaceholderRequest] set entity from url">; /** Token of the PlaceholderRequest reducer */ declare const PLACEHOLDER_REQUEST_REDUCER_TOKEN: InjectionToken>>; /** Provide default reducer for PlaceholderRequest store */ declare function getDefaultplaceholderRequestReducer(): ActionReducer>; declare class PlaceholderRequestStoreModule { static forRoot(reducerFactory: () => ActionReducer): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * PlaceholderRequest Store adapter */ declare const placeholderRequestAdapter: _o3r_core.EntityAsyncRequestAdapter; /** * PlaceholderRequest Store initial value */ declare const placeholderRequestInitialState: PlaceholderRequestState; /** * Reducers of Placeholder request store that handles the call to the placeholder template URL */ declare const placeholderRequestReducerFeatures: ReducerTypes[]; /** * PlaceholderRequest Store reducer */ declare const placeholderRequestReducer: _ngrx_store.ActionReducer>; declare const selectPlaceholderRequestState: _ngrx_store.MemoizedSelector>; /** Select the dictionary of PlaceholderRequest entities */ declare const selectPlaceholderRequestEntities: _ngrx_store.MemoizedSelector, (s1: PlaceholderRequestState) => _ngrx_entity.Dictionary<_o3r_components.PlaceholderRequestModel>>; /** * Select a specific PlaceholderRequest entity using a raw url as id * @param rawUrl */ declare const selectPlaceholderRequestEntityUsage: (rawUrl: string) => _ngrx_store.MemoizedSelector boolean | undefined>; declare const placeholderRequestStorageSerializer: typeof asyncEntitySerializer; declare const placeholderRequestStorageDeserializer: (rawObject: any) => PlaceholderRequestState; declare const placeholderRequestStorageSync: Readonly>; /** * PlaceholderTemplate model */ interface PlaceholderTemplateModel { /** Placeholder id that is unique*/ id: string; /** Urls to the templates to be fetched, and priority for rendering order */ urlsWithPriority: { rawUrl: string; priority: number; }[]; } /** Possible placeholder mode */ type PlaceholderMode = 'normal' | 'debug' | 'pending'; /** * PlaceholderTemplate store state */ interface PlaceholderTemplateState extends EntityState { mode: PlaceholderMode; } /** * Name of the PlaceholderTemplate Store */ declare const PLACEHOLDER_TEMPLATE_STORE_NAME = "placeholderTemplate"; /** * PlaceholderTemplate Store Interface */ interface PlaceholderTemplateStore { /** PlaceholderTemplate state */ [PLACEHOLDER_TEMPLATE_STORE_NAME]: PlaceholderTemplateState; } /** Action to delete a specific entity */ declare const deletePlaceholderTemplateEntity: _ngrx_store.ActionCreator<"[PlaceholderTemplate] delete entity", (props: { id: string; }) => { id: string; } & _ngrx_store.Action<"[PlaceholderTemplate] delete entity">>; /** Action to clear all placeholderTemplate and fill the store with the payload */ declare const setPlaceholderTemplateEntity: _ngrx_store.ActionCreator<"[PlaceholderTemplate] set entity", (props: SetEntityActionPayload) => SetEntityActionPayload & _ngrx_store.Action<"[PlaceholderTemplate] set entity">>; declare const togglePlaceholderModeTemplate: _ngrx_store.ActionCreator<"[PlaceholderTemplate] toggle mode", (props: { mode: PlaceholderMode; }) => { mode: PlaceholderMode; } & _ngrx_store.Action<"[PlaceholderTemplate] toggle mode">>; /** Token of the PlaceholderTemplate reducer */ declare const PLACEHOLDER_TEMPLATE_REDUCER_TOKEN: InjectionToken>>; /** Provide default reducer for PlaceholderTemplate store */ declare function getDefaultPlaceholderTemplateReducer(): ActionReducer>; declare class PlaceholderTemplateStoreModule { static forRoot(reducerFactory: () => ActionReducer): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * PlaceholderTemplate Store adapter */ declare const placeholderTemplateAdapter: _ngrx_entity.EntityAdapter; /** * PlaceholderTemplate Store initial value */ declare const placeholderTemplateInitialState: PlaceholderTemplateState; /** * List of basic actions for PlaceholderTemplate Store */ declare const placeholderTemplateReducerFeatures: ReducerTypes[]; /** * PlaceholderTemplate Store reducer */ declare const placeholderTemplateReducer: _ngrx_store.ActionReducer>; declare const selectPlaceholderTemplateState: _ngrx_store.MemoizedSelector>; /** Select the dictionary of PlaceholderTemplate entities */ declare const selectPlaceholderTemplateEntities: _ngrx_store.MemoizedSelector, (s1: PlaceholderTemplateState) => _ngrx_entity.Dictionary<_o3r_components.PlaceholderTemplateModel>>; /** * Select a specific PlaceholderTemplate * @param placeholderId */ declare const selectPlaceholderTemplateEntity: (placeholderId: string) => _ngrx_store.MemoizedSelector _o3r_components.PlaceholderTemplateModel | undefined>; /** * Select the ordered rendered placeholder template full data (url, priority etc.) for a given placeholderId * Return undefined if the placeholder is not found * Returns {orderedRenderedTemplates: undefined, isPending: true} if any of the request is still pending * @param placeholderId */ declare const selectSortedTemplates: (placeholderId: string) => _ngrx_store.MemoizedSelector { orderedTemplates: undefined; isPending: never; } | { orderedTemplates: { rawUrl: string; priority: number; renderedTemplate?: string; resolvedUrl: string; }[]; isPending: boolean; } | undefined>; declare const selectPlaceholderTemplateMode: _ngrx_store.MemoizedSelector _o3r_components.PlaceholderMode>; declare const placeholderTemplateStorageDeserializer: (rawObject: any) => PlaceholderTemplateState; declare const placeholderTemplateStorageSync: Readonly>; /** * Model to describe a group of elements */ interface GroupInfo { /** * Text color for the {@link displayName} */ color?: string; /** * Color of the border of the element once highlighted */ backgroundColor: string; /** * Name of the group display */ displayName: string; /** * Regexp to detect the elements part of the group */ regexp: string; } interface Ng { /** * Retrieves the component instance associated with a given DOM element. * * Usage: * * Given the following DOM structure: * ```html * *
* *
*
* ``` * Calling `getComponent` on `` will return the instance of `ChildComponent` * associated with this DOM element. * * Calling the function on `` will return the `MyApp` instance. * @param element DOM element from which the component should be retrieved. * @returns Component instance associated with the element or `null` if there * is no component associated with it. */ getComponent(element: Element): T | null; /** * Retrieves the component instance whose view contains the DOM element. * * For example, if `` is used in the template of `` * (i.e. a `ViewChild` of ``), calling `getOwningComponent` on `` * would return ``. * @param elementOrDir DOM element, component or directive instance * for which to retrieve the root components. * @returns Component instance whose view owns the DOM element or null if the element is not * part of a component view. */ getOwningComponent(elementOrDir: Element | object): T | null; /** * Retrieves the host element of a component or directive instance. * The host element is the DOM element that matched the selector of the directive. * @param componentOrDirective Component or directive instance for which the host * element should be retrieved. * @returns Host element of the target. */ getHostElement(componentOrDirective: object): Element; } interface OtterLikeComponentInfo { /** Container information */ container?: OtterLikeComponentInfo; /** Configuration ID */ configId?: string; /** Component name */ componentName: string; /** Component translation */ translations?: Record; /** Component analytics */ analytics?: Record; } /** * Otter inspector css class */ declare const INSPECTOR_CLASS = "otter-devtools-inspector"; /** * Determine if a node is an Otter container * @param node Element to check * @returns true if the node is an Otter container */ declare const isContainer: (node: Element | undefined | null) => node is Element; /** * Determine the config id of a component instance * @param instance component instance * @returns the config id of the component instance */ declare const getConfigId: (instance: any) => any; /** * Recursive method to determin the translations of a node * @param node HTMLElement to check * @param rec recursive method * @returns the trasnslations associated to their component name */ declare function getTranslationsRec(node: Element | null, rec: typeof getTranslationsRec): Record | undefined; /** * Determine the translations of a node * @param node HTMLElement to check * @returns the translations associated to their component name */ declare const getTranslations: (node: Element | null) => Record | undefined; /** * Recursive method to determine the analytics of a node * @param node Element to check * @param rec recursive method * @returns the analytics associated to their component name */ declare function getAnalyticEventsRec(node: Element | null, rec: typeof getAnalyticEventsRec): Record | undefined; /** * Determine the analytics of a node * @param node Element to check * @returns the analytics associated to their component name */ declare const getAnalyticEvents: (node: Element | null) => Record | undefined; /** * Determine all info from an Otter component * @param componentClassInstance component instance * @param host HTML element hosting the component * @returns all info from an Otter component */ declare const getOtterLikeComponentInfo: (componentClassInstance: any, host: Element) => OtterLikeComponentInfo; /** * Service to handle the custom inspector for the Otter Devtools Chrome extension. */ declare class OtterInspectorService { private readonly angularDevTools; private readonly elementMouseOverCallback; private readonly elementClickCallback; private readonly cancelEventCallback; private selectedComponent; private inspectorDiv; private readonly otterLikeComponentInfoToBeSent; /** * Stream of component info to be sent to the extension app. */ otterLikeComponentInfoToBeSent$: Observable; constructor(); private startInspecting; private elementClick; private isOtterLikeComponent; private findComponentInfo; private elementMouseOver; private highlight; private unHighlight; private cancelEvent; /** * Prepare the inspector div and add it to the DOM. */ prepareInspector(): void; /** * Toggle the inspector. * @param isRunning true if the inspector is running */ toggleInspector(isRunning: boolean): void; stopInspecting(): void; } /** * Component Devtools options */ interface ComponentsDevtoolsServiceOptions extends DevtoolsCommonOptions { } /** * Message to give the selected component information */ interface SelectedComponentInfoMessage extends OtterLikeComponentInfo, OtterMessageContent<'selectedComponentInfo'> { } /** * Message to toggle the inspector */ interface ToggleInspectorMessage extends OtterMessageContent<'toggleInspector'> { /** Is the inspector running */ isRunning: boolean; } /** * Message to toggle the highlight */ interface ToggleHighlightMessage extends OtterMessageContent<'toggleHighlight'> { /** Is the highlight displayed */ isRunning: boolean; } /** * Message the change the configuration of the `HighlightService` */ interface ChangeHighlightConfiguration extends OtterMessageContent<'changeHighlightConfiguration'> { /** * Minimum width of HTMLElement to be considered */ elementMinWidth?: number; /** * Minimum height of HTMLElement to be considered */ elementMinHeight?: number; /** * Throttle interval */ throttleInterval?: number; /** * Group information to detect elements */ groupsInfo?: Record; /** * Maximum number of ancestors */ maxDepth?: number; /** * Opacity of the chips */ chipsOpacity?: number; /** * Auto refresh */ autoRefresh?: boolean; } /** * Message to toggle the placeholder mode */ interface PlaceholderModeMessage extends OtterMessageContent<'placeholderMode'> { /** Placeholder mode */ mode: PlaceholderMode; } /** * Message to know the component selection availability */ interface IsComponentSelectionAvailableMessage extends OtterMessageContent<'isComponentSelectionAvailable'> { available: boolean; } type ComponentsMessageContents = IsComponentSelectionAvailableMessage | SelectedComponentInfoMessage | ToggleInspectorMessage | ToggleHighlightMessage | ChangeHighlightConfiguration | PlaceholderModeMessage; /** List of possible DataTypes for Components messages */ type ComponentsMessageDataTypes = MessageDataTypes; /** List of all messages for Components purpose */ type AvailableComponentsMessageContents = ComponentsMessageContents | ConnectContentMessage | RequestMessagesContentMessage; /** * Determine if the given message is a Components message * @param message message to check */ declare const isComponentsMessage: (message: any) => message is AvailableComponentsMessageContents; declare class ComponentsDevtoolsMessageService implements DevtoolsServiceInterface { private readonly logger; private readonly store; private readonly options; private readonly inspectorService; private readonly sendMessage; private readonly destroyRef; private readonly highlightService; constructor(); /** * Function to connect the plugin to the Otter DevTools extension */ private connectPlugin; private sendCurrentSelectedComponent; private sendIsComponentSelectionAvailable; /** * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension * @param only restricted list of messages to re-send */ private handleReEmitRequest; /** * Function to handle the incoming messages from Otter Chrome DevTools extension * @param message message coming from the Otter Chrome DevTools extension */ private handleEvents; /** @inheritDoc */ activate(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ComponentsDevtoolsModule { /** * Initialize Otter Devtools * @param options */ static instrument(options: Partial): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS: Readonly; declare const OTTER_COMPONENTS_DEVTOOLS_OPTIONS: InjectionToken; /** * Minimum interface for components used with c11n directive */ interface C11nComponent { [key: string]: any; config?: any; validate?: (control: AbstractControl) => any; } declare class C11nDirective> implements OnChanges, OnDestroy { private readonly viewContainerRef; private readonly differsService; private readonly injector; /** The component information passed to the directive */ component: Type; /** The information related to configuration */ config?: D; /** Formcontrol */ formControl?: FormControl; /** The input setter */ set inputs(value: { [K in keyof I]: I[K] | InputSignal; }); /** The input getter */ get inputs(): { [K in keyof I]: I[K] | InputSignal; }; /** The information related to output */ outputs?: Functionify; /** The component reference */ componentRef: ComponentRef; private componentSubscriptions; private _inputs; private differInputs; /** Set of inputs when the component was created. */ private readonly uninitializedInputs; /** * Type guard for component implementing CVA * @param _cmp Component instance */ private componentImplementsCva; private updateInputs; /** * called when data-bound property change * @param changes The changes that occur */ ngOnChanges(changes: SimpleChanges): void; /** * returns validation errors from component instance if validate method exists else returns null * @param control Form control */ validate(control: AbstractControl): any; /** * ngOnDestroy */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[c11n]", never, { "component": { "alias": "component"; "required": false; }; "config": { "alias": "config"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "inputs": { "alias": "inputs"; "required": false; }; "outputs": { "alias": "outputs"; "required": false; }; }, {}, never, never, true, never>; } /** Interface for grouping the arrays needed for custom component registration */ interface EntryCustomComponents { /** Array of custom presenters */ customComponents: Type[]; /** Array of custom presenter modules */ customComponentsModules: Type[]; } /** * Register a custom component * @param customComponentsMap an object containing the already registered custom component * @param customComponentKey * @param customComponent */ declare function registerCustomComponent(customComponentsMap: Map>, customComponentKey: string, customComponent: Type): Map>; /** C11n directive mock */ declare class MockC11nDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** C11n service mock */ declare class C11nMockService { addPresenter(_presKey: string, _presType: any): void; getPresenter(_defaultPres: any, _presKey: string): (source: Observable) => Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * The purpose of this module is to be imported in the unit tests of the components which are using c11n directive */ declare class C11nMockModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class C11nService { private readonly presentersMap; /** * Add a presenter * @param presKey The presenter key to set * @param presenter The new presenter */ addPresenter(presKey: string, presenter: Type): void; /** * Operator to retrieve the presenter based on a given presKey * @param defaultPres The default presenter * @param presKey The presenter key to retrieve */ getPresenter(defaultPres: Type, presKey?: string): (source: Observable) => Observable>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Customization service factory * @param config -> registerCompFunc - a function which returns the map of custom components which will be injected in c11n service * @param config.registerCompFunc */ declare function createC11nService(config: { registerCompFunc: () => Map; }): C11nService; /** * Returns a tuple of the key and the component * @note should be used with {@link provideCustomComponents} * @example * ```typescript * provideCustomComponents( * new Map(), * withComponent('example1', MyFirstComponent), * withComponent('example2', MySecondComponent), * ) * ``` * @param customComponentKey * @param customComponent */ declare function withComponent(customComponentKey: string, customComponent: Type): [string, Type]; /** * Provide custom components which will be injected in c11n service * @param customComponents * @param additionalComponents */ declare function provideCustomComponents(customComponents?: Map, ...additionalComponents: (ReturnType)[]): i0.EnvironmentProviders; /** The C11n injection token */ declare const C11N_PRESENTERS_MAP_TOKEN: InjectionToken; /** Function used to register custom components */ declare const C11N_REGISTER_FUNC_TOKEN: InjectionToken; declare class O3rCapitalizePipe implements PipeTransform { transform(value?: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** Time object to format duration */ interface TimeUnit { /** character defining the time unit */ formatCharacter: string; /** divider to get the time unit value */ divider: number; /** * modulo for the time unit * If not provided, it will either use the immediately higher unit time divider * or Number.MAX_SAFE_INTEGER for the highest one */ modulo?: number; } /** * Converts a duration in seconds into the HH:mm format */ declare class O3rDurationPipe implements PipeTransform { /** * Converts a duration in seconds into the HH:mm format * @param value the value in seconds * @param pattern the desired output format. * The pattern takes into account static format characters surrounded by braces * {d} for days, {h} for hours, {m} for minutes and {s} for seconds. * It accepts a double unit time in case a padding is wanted {dd} outputs 05 for instance * Should respect the following pattern `/(\{h+\})|(\{m+\})/` (ex: `'{h}h{m}m'` outputs `0h2m`, `'{h}H{mm}'` `0H02` etc.) * @param timeUnits the units time to be used in this transformation. This can be used for custom units in the pattern like * { * formatCharacter: 'w', * divider: 3600 * 24 * 7 * } * The above defines a week for {w} */ transform(value?: number, pattern?: string, timeUnits?: TimeUnit[]): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class O3rKeepWhiteSpacePipe implements PipeTransform { transform(value: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class O3rReplaceWithBoldPipe implements PipeTransform { transform(value: string, inputText: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Placeholder component that is bind to the PlaceholderTemplateStore to display a template based on its ID * A loading indication can be provided via projection * @example * Is loading ... */ declare class PlaceholderComponent implements OnInit, OnDestroy, AfterViewChecked { private readonly store; private readonly cd; readonly id$: BehaviorSubject; private readonly afterViewInit$; private readonly messages$; /** Determine if the placeholder content is pending */ isPending?: boolean; /** Generated HTML template */ template?: string; mode: Signal; private readonly destroyRef; /** template identify */ set id(value: string); constructor(); /** @inheritdoc */ ngOnInit(): void; ngAfterViewChecked(): void; /** @inheritdoc */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class PlaceholderModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { C11N_PRESENTERS_MAP_TOKEN, C11N_REGISTER_FUNC_TOKEN, C11nDirective, C11nMockModule, C11nMockService, C11nService, ComponentsDevtoolsMessageService, ComponentsDevtoolsModule, INSPECTOR_CLASS, MockC11nDirective, O3rCapitalizePipe, O3rDurationPipe, O3rKeepWhiteSpacePipe, O3rReplaceWithBoldPipe, OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS, OTTER_COMPONENTS_DEVTOOLS_OPTIONS, OtterInspectorService, PLACEHOLDER_REQUEST_REDUCER_TOKEN, PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, PLACEHOLDER_TEMPLATE_STORE_NAME, PlaceholderComponent, PlaceholderModule, PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule, cancelPlaceholderRequest, createC11nService, deletePlaceholderTemplateEntity, failPlaceholderRequestEntity, getAnalyticEvents, getAnalyticEventsRec, getConfigId, getDefaultPlaceholderTemplateReducer, getDefaultplaceholderRequestReducer, getOtterLikeComponentInfo, getTranslations, getTranslationsRec, isComponentsMessage, isContainer, lazyArray, placeholderRequestAdapter, placeholderRequestInitialState, placeholderRequestReducer, placeholderRequestReducerFeatures, placeholderRequestStorageDeserializer, placeholderRequestStorageSerializer, placeholderRequestStorageSync, placeholderTemplateAdapter, placeholderTemplateInitialState, placeholderTemplateReducer, placeholderTemplateReducerFeatures, placeholderTemplateStorageDeserializer, placeholderTemplateStorageSync, provideCustomComponents, registerCustomComponent, selectPlaceholderRequestEntities, selectPlaceholderRequestEntityUsage, selectPlaceholderRequestState, selectPlaceholderTemplateEntities, selectPlaceholderTemplateEntity, selectPlaceholderTemplateMode, selectPlaceholderTemplateState, selectSortedTemplates, setPlaceholderRequestEntityFromUrl, setPlaceholderTemplateEntity, togglePlaceholderModeTemplate, updatePlaceholderRequestEntity, updatePlaceholderRequestEntitySync, withComponent }; export type { AvailableComponentsMessageContents, ChangeHighlightConfiguration, ComponentClassOutput, ComponentConfig, ComponentConfigOutput, ComponentConfigOutputs, ComponentContext, ComponentOutput, ComponentStructure, ComponentsDevtoolsServiceOptions, ComponentsMessageDataTypes, ConfigProperty, ConfigPropertyTypes, ConfigType, EntryCustomComponents, IsComponentSelectionAvailableMessage, NestedConfiguration, Ng, OtterLikeComponentInfo, PlaceholderData, PlaceholderMode, PlaceholderModeMessage, PlaceholderRequestModel, PlaceholderRequestReply, PlaceholderRequestState, PlaceholderRequestStateDetails, PlaceholderRequestStore, PlaceholderTemplateModel, PlaceholderTemplateState, PlaceholderTemplateStore, PlaceholderVariable, PlaceholdersMetadata, SelectedComponentInfoMessage, ToggleHighlightMessage, ToggleInspectorMessage }; //# sourceMappingURL=o3r-components.d.ts.map