UNPKG

@studiohyperdrive/ngx-gov-flanders

Version:

An integrated Angular approach to common use-cases for applications for the Flemish Government.

110 lines (106 loc) 4.85 kB
import * as i0 from '@angular/core'; import { Signal } from '@angular/core'; import { GlobalFooterClient } from '@govflanders/vl-widget-global-footer-types'; import { ApplicationMenuLink, ProfileConfig, GlobalHeaderClient } from '@govflanders/vl-widget-global-header-types'; import { Observable } from 'rxjs'; /** * Configuration to inject an ACM component */ interface NgxAcmComponentInjectionConfiguration<ConfigurationType extends NgxAcmComponentConfiguration = NgxAcmComponentConfiguration> { /** * The selector of the element where the component should be mounted. */ selector: string; /** * The configuration of the component */ configuration: ConfigurationType; /** * An optional list of links we want to display in the components */ links?: ApplicationMenuLink[]; } /** * The configuration of the component */ interface NgxAcmComponentConfiguration { /** * The URL of the widget (e.g. 'https://<environment>.widgets.burgerprofiel.vlaanderen.be/') */ url: string; /** * The id of the widget (e.g. '7502b557-5d49-4ab3-9995-168718b81be5') */ id: string; } /** * The configuration of the Global Header component */ interface NgxAcmHeaderComponentConfiguration extends NgxAcmComponentConfiguration { /** * The profile configuration object */ profile: ProfileConfig; } /** * The `NgxAcmComponentInjectionService` is a service that provides methods to inject either a GlobalHeader or a GlobalFooter by ACM to your application. */ declare class NgxAcmComponentInjectionService { globalHeaderClient: GlobalHeaderClient; private readonly _globalHeaderClientInitialized; readonly globalHeaderClientInitialized: Signal<boolean>; globalFooterClient: GlobalFooterClient; private readonly _globalFooterClientInitialized; readonly globalFooterClientInitialized: Signal<boolean>; /** * An instance of the RendererFactory2 */ private rendererFactory; /** * An instance of the Renderer2 */ private renderer; /** * An instance of the NgxWindowService */ private windowService; /** * Initializes the VO Global Header widget and sets optional applicationMenuLinks. * * @param selector - The selector of the element where the header widget should be mounted. * @param configuration - The configuration object * @param configuration.url - The URL of the widget (e.g. 'https://<environment>.widgets.burgerprofiel.vlaanderen.be/') * @param configuration.id - The ID of the widget (e.g. '7502b557-5d49-4ab3-9995-168718b81be5') * @param configuration.profile - The profile configuration object * @param links - Optional application menu links * * @returns The GlobalHeaderClient object will be returned to allow for custom implementations that are not supported out of the box, see: https://test.widgets.burgerprofiel.dev-vlaanderen.be/docs/global-header/ for more information. */ injectGlobalHeaderComponent({ selector, configuration, links, }: NgxAcmComponentInjectionConfiguration<NgxAcmHeaderComponentConfiguration>): Observable<GlobalHeaderClient>; /** * Initializes the VO Global Footer widget and sets optional navigation links. * * @param selector - The selector of the element where the footer widget should be mounted. * @param configuration - The configuration object * @param configuration.url - The URL of the widget (e.g. 'https://<environment>.widgets.burgerprofiel.vlaanderen.be/') * @param configuration.id - The ID of the widget (e.g. '7502b557-5d49-4ab3-9995-168718b81be5') * @param links - Optional navigation links * * @returns The GlobalFooterClient object will be returned to allow for custom implementations that are not supported out of the box, see: https://test.widgets.burgerprofiel.dev-vlaanderen.be/docs/global-footer/ for more information. */ injectGlobalFooterComponent({ selector, configuration, links, }: NgxAcmComponentInjectionConfiguration): Observable<GlobalFooterClient>; /** * Creates a script tag for the ACMComponent and appends it to the browser * * @private * @param browserDocument - An instance of the browser document * @param configuration - The configuration of the ACM component * @param selector - The selector of the component * @param component - The name of the component we wish to append */ private injectComponent; static ɵfac: i0.ɵɵFactoryDeclaration<NgxAcmComponentInjectionService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NgxAcmComponentInjectionService>; } export { NgxAcmComponentInjectionService }; export type { NgxAcmComponentConfiguration, NgxAcmComponentInjectionConfiguration, NgxAcmHeaderComponentConfiguration };