import * as i0 from '@angular/core'; import { InjectionToken, OnDestroy, Injector, Optional, OnInit, Provider, EnvironmentProviders, ValueProvider } from '@angular/core'; import * as rxjs from 'rxjs'; import { Observable, ReplaySubject, BehaviorSubject, Subscription } from 'rxjs'; import { TranslateLoader, TranslationObject, MissingTranslationHandler, MissingTranslationHandlerParams } from '@ngx-translate/core'; import { Topic } from '@onecx/accelerator'; import { AppStateService, UserService } from '@onecx/angular-integration-interface'; import { types, ModuleFederation } from '@module-federation/runtime-core'; import { RemoteComponent } from '@onecx/integration-interface'; declare const TRANSLATION_PATH: InjectionToken<(string | Observable | Promise)[]>; declare class OnecxTranslateLoader implements TranslateLoader { private readonly translationCacheService; private readonly injector; private readonly translationPaths; private readonly translateLoader$; getTranslation(lang: string): Observable; private toObservable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class TranslationCacheTopic extends Topic { constructor(); } declare global { interface Window { onecxTranslations: Record; } } declare class TranslationCacheService implements OnDestroy { private _translationTopic$; get translationTopic$(): TranslationCacheTopic; set translationTopic$(source: TranslationCacheTopic); constructor(); ngOnDestroy(): void; /** * Retrieves a translation file from the cache or fetches it if not available. * * This method checks if the translation file is already cached in `window['onecxTranslations']`. * If it is, it returns the cached version. If not, it calls the provided `cacheMissFunction` * to fetch the translation file and caches it for future use. * * If the requested translation file is null, it waits for the translation topic to be published by a different application. * * In case of failed load, it logs an error, deletes the entry from the cache, and publishes the URL to notify other subscribers about the failure. * @param url * @param cacheMissFunction * @returns */ getTranslationFile(url: string, cacheMissFunction: () => Observable): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class CachingTranslateLoader implements TranslateLoader { private readonly translationCache; private readonly injector; private readonly prefix?; private readonly suffix?; private readonly translateLoader; constructor(translationCache: TranslationCacheService, injector: Injector, prefix?: string | undefined, suffix?: string | undefined); getTranslation(lang: string): Observable; } declare function hasPermissionCheckerFactory(parentInjector: Injector, hasPermissionChecker: HasPermissionChecker | null): HasPermissionChecker; interface HasPermissionChecker { hasPermission(permissionKey: string | string[]): Promise; getPermissions?(): Observable; } /** * This checker always returns true, basically disabling the permission system on the UI side */ declare class AlwaysGrantPermissionChecker implements HasPermissionChecker { hasPermission(_permissionKey: string | string[]): Promise; } declare const HAS_PERMISSION_CHECKER: InjectionToken; declare function providePermissionChecker(): { provide: InjectionToken; useFactory: typeof hasPermissionCheckerFactory; deps: (typeof Injector | Optional[])[]; }[]; declare function provideAlwaysGrantPermissionChecker(): { provide: InjectionToken; useClass: typeof AlwaysGrantPermissionChecker; }[]; declare class TranslateCombinedLoader implements TranslateLoader { private readonly _loaders; constructor(...loaders: TranslateLoader[]); getTranslation(lang: string): Observable; } /** * @deprecated Please use provideTranslationPathFromMeta(import.meta.url, 'assets/i18n/') instead of * { provide: TRANSLATION_PATH, useFactory: ... => translationPathFactory('assets/i18n/')..., ... } to provide the translation path. * Please make sure the webpack configuration for importMeta contains: https://webpack.js.org/configuration/module/#moduleparserjavascriptimportmeta. */ declare function translationPathFactory(path: string): (appStateService: AppStateService) => Observable; /** * AUTO-GENERATED FILE - Do not manually edit * * This file is regenerated during every build via the generate-locales script. * To update locales, run: npm install (or yarn install) * * Generated with 742 available locales from @angular/common/locales */ declare const localeLoaders: Record Promise>; declare function isObject(item: any): any; declare function mergeDeep(target: any, source: any): any; type RemoteComponentConfig = { appId: string; productName: string; permissions: string[]; baseUrl: string; }; /** * @deprecated Please use provideTranslationPathFromMeta(import.meta.url, 'assets/i18n/') instead of * { provide: TRANSLATION_PATH, useFactory: ... => remoteComponentTranslationPathFactory('assets/i18n/')..., ... } to provide the translation path. Please make sure the webpack configuration for importMeta contains: https://webpack.js.org/configuration/module/#moduleparserjavascriptimportmeta. */ declare function remoteComponentTranslationPathFactory(path: string): (remoteComponentConfig: ReplaySubject) => Observable; declare const shellScopeId = "shell-ui"; /** * @constant {string} dataStyleIdKey * @description Marks start of scope section for scopeId (e.g. data-style-id="onecx-workspace|onecx-workspace-ui") * Present for MFE and RC components as well as dynamic content */ declare const dataStyleIdKey = "styleId"; /** * @constant {string} dataStyleIsolationKey * @description Marks end of scope section * Present for MFE and RC components as well as dynamic content */ declare const dataStyleIsolationKey = "styleIsolation"; /** * @constant {string} dataNoPortalLayoutStylesKey * @description Should always be in pair with styleId * Marks that scope section does not request portal layout styles * Present for MFE and RC components as well as dynamic content since libs v6 */ declare const dataNoPortalLayoutStylesKey = "noPortalLayoutStyles"; /** * @constant {string} dataMfeElementKey * @description Marks element as the mfe content * Marks that scope section does not request portal layout styles * Present for MFE and its dynamic content */ declare const dataMfeElementKey = "mfeElement"; /** * @constant {string} dataIntermediateStyleIdKey * @description Metadata used when appending dynamic content to ensure style scoping outside the application * (e.g. data-intermediate-style-id="onecx-workspace|onecx-workspace-ui") */ declare const dataIntermediateStyleIdKey = "intermediateStyleId"; /** * @constant {string} dataIntermediateMfeElementKey * @description Metadata used when appending dynamic content to ensure style scoping outside the application */ declare const dataIntermediateMfeElementKey = "intermediateMfeElement"; /** * @constant {string} dataIntermediateStyleIsolationKey * @description Metadata used when appending dynamic content to ensure style scoping outside the application */ declare const dataIntermediateStyleIsolationKey = "intermediateStyleIsolation"; /** * @constant {string} dataIntermediateNoPortalLayoutStylesKey * @description Metadata used when appending dynamic content to ensure style scoping outside the application */ declare const dataIntermediateNoPortalLayoutStylesKey = "intermediateNoPortalLayoutStyles"; /** * @constant {string} dataVariableOverrideIdKey * @description Marks the style element as one containing overrides for scope sections with scopeId */ declare const dataVariableOverrideIdKey = "VariableOverrideId"; /** * @constant {string} dataPortalLayoutStylesKey * @description Marks the style element as one containing portal layout styles styles */ declare const dataPortalLayoutStylesKey = "portalLayoutStylesStyles"; /** * @constant {string} dataDynamicPortalLayoutStylesKey * @description Marks the style element as one containing portal layout styles styles for the dynamic content */ declare const dataDynamicPortalLayoutStylesKey = "dynamicContentPortalLayoutStyles"; /** * @constant {string} dataStyleIdAttribute * @description HTML attribute for styleId. See {@link dataStyleIdKey} for more details. */ declare const dataStyleIdAttribute = "data-style-id"; /** * @constant {string} dataMfeElementAttribute * @description HTML attribute for mfe element. See {@link dataMfeElementKey} for more details. */ declare const dataMfeElementAttribute = "data-mfe-element"; /** * @constant {string} dataStyleIsolationAttribute * @description HTML attribute for styleIsolation. See {@link dataStyleIsolationKey} for more details. */ declare const dataStyleIsolationAttribute = "data-style-isolation"; /** * @constant {string} dataNoPortalLayoutStylesAttribute * @description HTML attribute for noPortalLayoutStyles. See {@link dataNoPortalLayoutStylesKey} for more details. */ declare const dataNoPortalLayoutStylesAttribute = "data-no-portal-layout-styles"; /** * @constant {string} dataIntermediateStyleIdAttribute * @description HTML attribute for intermediateStyleId. See {@link dataIntermediateStyleIdKey} for more details. */ declare const dataIntermediateStyleIdAttribute = "data-intermediate-style-id"; /** * @constant {string} dataIntermediateMfeElementAttribute * @description HTML attribute for intermediateMfeElement. See {@link dataIntermediateMfeElementKey} for more details. */ declare const dataIntermediateMfeElementAttribute = "data-intermediate-mfe-element"; /** * @constant {string} dataIntermediateStyleIsolationAttribute * @description HTML attribute for intermediateStyleIsolation. See {@link dataIntermediateStyleIsolationKey} for more details. */ declare const dataIntermediateStyleIsolationAttribute = "data-intermediate-style-isolation"; /** * @constant {string} dataIntermediateNoPortalLayoutStylesAttribute * @description HTML attribute for intermediateNoPortalLayoutStyles. See {@link dataIntermediateNoPortalLayoutStylesKey} for more details. */ declare const dataIntermediateNoPortalLayoutStylesAttribute = "data-intermediate-no-portal-layout-styles"; /** * @constant {string} dataVariableOverrideIdAttribute * @description HTML attribute for variableOverrideId. See {@link dataVariableOverrideIdKey} for more details. */ declare const dataVariableOverrideIdAttribute = "data-variable-override-id"; /** * @constant {string} dataPortalLayoutStylesAttribute * @description HTML attribute for portalLayoutStyles. See {@link dataPortalLayoutStylesKey} for more details. */ declare const dataPortalLayoutStylesAttribute = "data-portal-layout-styles"; /** * @constant {string} dataDynamicPortalLayoutStylesAttribute * @description HTML attribute for dynamicPortalLayoutStyles. See {@link dataDynamicPortalLayoutStylesKey} for more details. */ declare const dataDynamicPortalLayoutStylesAttribute = "data-dynamic-content-portal-layout-styles"; declare const portalLayoutStylesSheetId = "[data-style-id]:not([data-no-portal-layout-styles])"; declare const dynamicPortalLayoutStylesSheetId = "body>:not([data-no-portal-layout-styles])"; /** * Gets the scope identifier based on the application context */ declare function getScopeIdentifier(appStateService: AppStateService, skipStyleScoping?: boolean | null, remoteComponentConfig?: ReplaySubject | null): Promise; declare function scopePrimengCss(css: string, scopeId: string): string; declare function replacePrimengPrefix(css: string, scopeId: string): string; declare function scopeIdentifierToVariablePrefix(scopeId: string): string; declare function scopeIdFromProductNameAndAppId(productName: string, appId: string): string; declare function isCssScopeRuleSupported(): boolean; declare class PortalApiConfiguration { private configurationClassOfGenerator; private apiPrefix; private configuration; appStateService: AppStateService; protected basePath$: BehaviorSubject; get basePath(): string; set basePath(_: string); get credentials(): { [key: string]: string | (() => string | undefined); }; set credentials(value: { [key: string]: string | (() => string | undefined); }); get encodeParam(): (param: unknown) => string; set encocdeParam(value: (param: unknown) => string); constructor(configurationClassOfGenerator: unknown, apiPrefix: string); selectHeaderContentType(contentTypes: string[]): string | undefined; selectHeaderAccept(accepts: string[]): string | undefined; isJsonMime(mime: string): boolean; lookupCredential(key: string): string | undefined; private activator; } declare class TranslationConnectionService implements OnDestroy { languageSub: Subscription; translationSub: Subscription; constructor(); ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function provideTranslationConnectionService(): (typeof TranslationConnectionService | { provide: i0.InjectionToken void)[]>; multi: boolean; useFactory(): () => TranslationConnectionService; })[]; declare class MultiLanguageMissingTranslationHandler implements MissingTranslationHandler { private readonly parser; private readonly userService; handle(params: MissingTranslationHandlerParams): Observable; /** * Tries to resolve the requested key for one language using the ngx-translate loader. * * @param lang The language code that should be checked. * @param params The ngx-translate missing-translation context containing the key and service. * @returns An observable that emits the resolved translation string for the language. */ findTranslationForLang(lang: string, params: MissingTranslationHandlerParams): Observable; /** * Ensures that a loaded translation table contains a usable value for the requested key. * * @param translations The translation table returned from the ngx-translate loader. * @param params The ngx-translate missing-translation context containing the requested key. * @param lang The language code currently being resolved. * @returns The resolved translation string. */ private requireTranslation; /** * Converts raw translation values into forms accepted by ngx-translate interpolation. * * `TranslateParser.interpolate(...)` accepts strings and functions. This helper also * stringifies primitive scalar values so fallback tables can still return readable text. * * The value stays typed as `unknown` because translation tables and * `TranslateParser.getValue()` may return any runtime shape: strings, functions, * numbers, booleans, objects, arrays, `null`, or `undefined`. * Only the supported scalar/function cases are converted for interpolation. * * @param rawValue The raw value read from the translation table. * @returns A value accepted by `TranslateParser.interpolate`, or `undefined` when unsupported. */ private toInterpolatableValue; /** * Tries configured locales in order and emits the first matching translation. * * @param locales The ordered list of candidate locales to check. * @param params The ngx-translate missing-translation context for the requested key. * @returns An observable that emits the first resolved translation or fails when none is found. */ private loadTranslations; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class DynamicLocaleId { private readonly userService; constructor(userService: UserService); valueOf(): string; get length(): number; } type Remote = types.Remote; declare enum Technologies { Angular = "Angular", WebComponent = "WebComponent", WebComponentScript = "WebComponentScript", WebComponentModule = "WebComponentModule" } type BffGeneratedRoute = { remoteEntryUrl: string; productName: string; appId: string; technology?: Technologies; baseUrl: string; shareScope?: string; remoteName?: string; }; type RemoteEntry = BffGeneratedRoute | RemoteComponent; declare function createRemoteConfig(entry: string, name: string, type?: 'module' | 'script', shareScope?: string): Remote; declare function toLoadRemoteEntryOptions(r: RemoteEntry): Promise; declare function getShellMfInstance(): ModuleFederation | null; declare function registerAndLoadRemote(instance: ModuleFederation, remoteConfig: Remote, exposedModule: string): Promise; declare const REMOTE_COMPONENT_CONFIG: InjectionToken>; declare const SKIP_STYLE_SCOPING: InjectionToken; /** * Service to check and list user permissions using an injected custom permission checker or the UserService. */ declare class PermissionService { private userService; private hasPermissionChecker; /** * All observables are cached to avoid infinite re-rendering loops when using the permission service in templates. */ private cachedPermissions; private undefinedObservable; private falseObservable; private cachedUserPermissions; private availableHasPermissionChecker; constructor(); /** * Checks if the current user has the specified permission(s). * @param permissionKey A permission key or an array of permission keys to check. * @returns An observable that emits true if the user has the permission(s), false otherwise. */ hasPermission(permissionKey: string | string[]): Observable; private lookupPermission; /** * Lists the permissions of the current user. * @returns An observable that emits an array of permission keys or undefined if the UserService is not available. */ getPermissions(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class PortalPageComponent implements OnInit { private readonly logger; private appState; private permissionService; private trueObservable; permission: i0.InputSignal; helpArticleId: i0.InputSignal; pageName: i0.InputSignal; applicationId: i0.InputSignal; hasAccess$: rxjs.Observable; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type ContentType = 'microfrontend' | 'remoteComponent'; interface AngularUtilsProviderConfig { contentType: ContentType; } declare function provideAngularUtils(): (Provider | EnvironmentProviders)[]; declare function provideTranslationPaths(): Provider[]; declare function providePermissionService(): Provider[]; /** * Returns a provider for TRANSLATION_PATH based on import.meta.url and a given path. * Removes the file name from import.meta.url and appends the path (default 'assets/i18n/'). * Please make sure the webpack configuration for importMeta contains: https://webpack.js.org/configuration/module/#moduleparserjavascriptimportmeta. */ declare function provideTranslationPathFromMeta(url: string | undefined, path?: string): Provider; declare function provideMultiLanguageIdentifier(name: string): ValueProvider; declare function provideMultiLanguageIdentifier(name: string, version: string): ValueProvider; declare function provideMultiLanguageIdentifier(name: string, version: string, type: 'app' | 'lib'): ValueProvider; export { AlwaysGrantPermissionChecker, CachingTranslateLoader, DynamicLocaleId, HAS_PERMISSION_CHECKER, MultiLanguageMissingTranslationHandler, OnecxTranslateLoader, PermissionService, PortalApiConfiguration, PortalPageComponent, REMOTE_COMPONENT_CONFIG, SKIP_STYLE_SCOPING, TRANSLATION_PATH, Technologies, TranslateCombinedLoader, TranslationCacheService, TranslationConnectionService, createRemoteConfig, dataDynamicPortalLayoutStylesAttribute, dataDynamicPortalLayoutStylesKey, dataIntermediateMfeElementAttribute, dataIntermediateMfeElementKey, dataIntermediateNoPortalLayoutStylesAttribute, dataIntermediateNoPortalLayoutStylesKey, dataIntermediateStyleIdAttribute, dataIntermediateStyleIdKey, dataIntermediateStyleIsolationAttribute, dataIntermediateStyleIsolationKey, dataMfeElementAttribute, dataMfeElementKey, dataNoPortalLayoutStylesAttribute, dataNoPortalLayoutStylesKey, dataPortalLayoutStylesAttribute, dataPortalLayoutStylesKey, dataStyleIdAttribute, dataStyleIdKey, dataStyleIsolationAttribute, dataStyleIsolationKey, dataVariableOverrideIdAttribute, dataVariableOverrideIdKey, dynamicPortalLayoutStylesSheetId, getScopeIdentifier, getShellMfInstance, hasPermissionCheckerFactory, isCssScopeRuleSupported, isObject, localeLoaders, mergeDeep, portalLayoutStylesSheetId, provideAlwaysGrantPermissionChecker, provideAngularUtils, provideMultiLanguageIdentifier, providePermissionChecker, providePermissionService, provideTranslationConnectionService, provideTranslationPathFromMeta, provideTranslationPaths, registerAndLoadRemote, remoteComponentTranslationPathFactory, replacePrimengPrefix, scopeIdFromProductNameAndAppId, scopeIdentifierToVariablePrefix, scopePrimengCss, shellScopeId, toLoadRemoteEntryOptions, translationPathFactory }; export type { AngularUtilsProviderConfig, ContentType, HasPermissionChecker, RemoteComponentConfig };