/** * Collection of APIs and constants for the Angular SDK * * @packageDocumentation */ import { AbstractComponentResolver } from '@acoustic-content-sdk/component-api'; import { AbstractComponentsRegistry } from '@acoustic-content-sdk/component-api'; import { AbstractComponentTypeRefResolver } from '@acoustic-content-sdk/component-api'; import { ActivatedRoute } from '@angular/router'; import { ActivePageV2 } from '@acoustic-content-sdk/api'; import { AuthStatus } from '@acoustic-content-sdk/api'; import { ComponentFactoryResolver } from '@angular/core'; import { DeliveryContentResolver } from '@acoustic-content-sdk/component-api'; import { DeliveryLayoutMappingResolver } from '@acoustic-content-sdk/component-api'; import { DeliveryLayoutResolver } from '@acoustic-content-sdk/component-api'; import { DeliveryPageResolver } from '@acoustic-content-sdk/component-api'; import { DeliverySearchResolver } from '@acoustic-content-sdk/component-api'; import { DeliverySiteResolver } from '@acoustic-content-sdk/component-api'; import { DeliveryTypeResolver } from '@acoustic-content-sdk/component-api'; import { DynamicLoggerFactory } from '@acoustic-content-sdk/api'; import { HandlebarsResolver } from '@acoustic-content-sdk/component-api'; import { HubInfoUrlProvider } from '@acoustic-content-sdk/api'; import { InjectionToken } from '@angular/core'; import { Layout } from '@acoustic-content-sdk/api'; import { LayoutResolver } from '@acoustic-content-sdk/component-api'; import { LoggerFactory } from '@acoustic-content-sdk/api'; import { LoggerService } from '@acoustic-content-sdk/api'; import { Observable } from 'rxjs'; import { PreRenderingResolver } from '@acoustic-content-sdk/component-api'; import { ProtectedContent } from '@acoustic-content-sdk/component-api'; import { RenderingContextProviderV2 } from '@acoustic-content-sdk/api'; import { RenderingContextResolver } from '@acoustic-content-sdk/component-api'; import { RenderingContextV2 } from '@acoustic-content-sdk/api'; import { SeedResolver } from '@acoustic-content-sdk/component-api'; import { Type } from '@angular/core'; import { UrlConfig } from '@acoustic-content-sdk/api'; import { UrlSegment } from '@angular/router'; import { WchPageService } from '@acoustic-content-sdk/component-api'; import { WindowType } from '@acoustic-content-sdk/component-api'; /** * Service interface that allows to resolve a rendering context * given the page. */ export declare interface AcNgPageService extends WchPageService { /** * Resolves the rendering context given the url segments * * @param aSegments - the segments * * @returns the observable of the rendering context or undefined if it could not be found */ getRenderingContextByUrlSegments(aSegments: UrlSegment[]): Observable; /** * Resolves the rendering context given the router * * @param aRoute - the activated route * * @returns the observable of the rendering context or undefined if it could not be found */ getRenderingContextByActivatedRoute(aRoute: ActivatedRoute): Observable; } export declare const ACOUSTIC_RC_INTERCEPTOR_TOKEN = "8453750A-4519-4184-840B-D490E909D23E"; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_ACTIVE_PAGE: InjectionToken; /** * URL to access the API layer * * Naming of this field according to the field in the rendering context * * @example 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1' * @example 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite' */ export declare const ACOUSTIC_TOKEN_API_URL: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_AUTH_STATUS: InjectionToken; /** * URL that represents the base URL of the path based routing of the application. This prefix will be * preserved when generating and recognizing URLs. If this property is not configured, then it will be decoded * from the window location. * * @example 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1' * @example 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite' * @example 'https://my.external.example.com/' */ export declare const ACOUSTIC_TOKEN_BASE_URL: InjectionToken; /** * Injection token for the component registry */ export declare const ACOUSTIC_TOKEN_COMPONENT_REGISTRY: InjectionToken; /** * A multi-provider token used for dependency injection of the {@link ComponentTypeRefResolver}s. * * @example * ```typescript * providers: [ * { * provide: ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS, * useClass: MyResolver, * multi: true * } * ] * ``` * */ export declare const ACOUSTIC_TOKEN_COMPONENT_TYPE_REF_RESOLVERS: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_CONTENT_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_CONTENT_SEED: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_LAYOUT_MAPPING_SEED: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_LAYOUT_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_LAYOUT_SEED: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_PAGE_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_PAGE_SEED: InjectionToken; /** * Injection token for the navigation service */ export declare const ACOUSTIC_TOKEN_DELIVERY_SEARCH_RESOLVER: InjectionToken; /** * Injection token for the navigation service */ export declare const ACOUSTIC_TOKEN_DELIVERY_SITE_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_TYPE_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_DELIVERY_TYPE_SEED: InjectionToken; export declare const ACOUSTIC_TOKEN_DYNAMIC_LOGGER_FACTORY: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_HANDLEBARS_RESOLVER: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_LAYOUT_RESOLVER: InjectionToken; export declare const ACOUSTIC_TOKEN_LOGGER_FACTORY: InjectionToken; export declare const ACOUSTIC_TOKEN_LOGGER_SERVICE: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_PAGE_SERVICE: InjectionToken; /** * Injection token for the pre rendering service */ export declare const ACOUSTIC_TOKEN_PRE_RENDERING_RESOLVER: InjectionToken; /** * Injection token for the protected content status */ export declare const ACOUSTIC_TOKEN_PROTECTED_CONTENT: InjectionToken; /** * Injection token for the rendering context provider */ export declare const ACOUSTIC_TOKEN_RENDERING_CONTEXT_PROVIDER: InjectionToken; /** * Injection token for the RenderingContextResolver */ export declare const ACOUSTIC_TOKEN_RENDERING_CONTEXT_RESOLVER: InjectionToken; /** * URL to access the delivery * * Naming of this field according to the field in the rendering context * * @example 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1' * @example 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite' */ export declare const ACOUSTIC_TOKEN_RESOURCE_URL: InjectionToken; /** * Injection token for the page service */ export declare const ACOUSTIC_TOKEN_SEED_RESOLVER: InjectionToken; /** * Injection token for the url config */ export declare const ACOUSTIC_TOKEN_URL_CONFIG: InjectionToken>; /** Create a new injection token for injecting the window into a component. */ export declare const ACOUSTIC_TOKEN_WINDOW: InjectionToken; /** * Service to register components and get information about * registered components. */ export declare interface ComponentRegistry extends AbstractComponentsRegistry> { /** * Registers the type given a full spec */ registerType(aController: string | string[], aType: ComponentTypeRef, aLayoutModes?: string | string[]): void; /** * Registers the type and assumes that a decorator has specified the controller */ registerType(aType: ComponentTypeRef): void; /** * Registers the type and assumes that a decorator has specified the controller */ registerType(aType: Type): void; } export declare interface ComponentResolver extends AbstractComponentResolver> { resolveComponent(aRenderingContext: RenderingContextV2, aLayoutMode?: string): Observable>; } /** * Captures all information required to instantiate a component based on its type */ export declare interface ComponentTypeRef { /** * The actual angular type for the component */ type: Type; /** * Optionally a component factory resolver */ resolver?: ComponentFactoryResolver; } /** * Service that resolves a component type ref given a layout. */ export declare interface ComponentTypeRefResolver extends AbstractComponentTypeRefResolver> { /** * Returns the type object based on the layout configuration * * @param aLayout - the layout object * @param aLayoutMode - an optional layout mode, defaults to the default mode * @returns the type */ getTypeByLayout: (aLayout: Layout, aLayoutMode?: string) => Observable>; /** * Optionally a weight for the resolver */ weight?: number; } /** * Type that extracts the type of an injection token */ export declare type ExtractInjectionTokenType> = T extends InjectionToken ? F : never; export declare enum PROVIDER_WEIGHT { MIN, LOW = 1000, MEDIUM = 2000, HEIGH = 3000, MAX } /** Version and build number of the package */ export declare const VERSION: { version: { major: string; minor: string; patch: string; branch: string; }; build: Date; }; export { }