
Framework independent collection of utility functions to implement services and components for sites next.
Table of Contents
Home > @acoustic-content-sdk/component-utils
component-utils package
Framework independent collection of utility functions to implement services and components for sites next.
Classes
Functions
Interfaces
Variables
Type Aliases
Home > @acoustic-content-sdk/component-utils > AbstractComponentResolverService
AbstractComponentResolverService class
Base class for component type resolvers
Signature:
export declare class AbstractComponentResolverService<TYPE> implements AbstractComponentResolver<TYPE>
Constructors
Properties
| resolveComponent | | (aRenderingContext: RenderingContextV2, aLayoutMode?: string) => Observable<TYPE> | |
Home > @acoustic-content-sdk/component-utils > AbstractComponentsService
AbstractComponentsService class
Signature:
export declare class AbstractComponentsService<TYPE> implements AbstractComponentsRegistry<TYPE>
Constructors
| (constructor)(aDefaultComponent, aPredicate, aLogSvc) | | Initializes our constructor. We make sure to keep all private instance variables as part of the closure and override the methods on the instance level. Since this is a singleton service, that approach does not cause a performance problem. |
Properties
| getTypeByLayout | | (aLayout: Layout, aLayoutMode?: string) => Observable<TYPE> | Returns the type object based on the layout configuration |
| getTypeBySelector | | (aSelector: string, aLayoutMode?: string) => Observable<TYPE> | Returns the type object based on the layout selector |
| registerType | | (aController: string | string[], aType: TYPE, aLayoutModes?: string | string[]) => void | define the methods |
Home > @acoustic-content-sdk/component-utils > AbstractDeliverySearchResolverService
AbstractDeliverySearchResolverService class
Signature:
export declare class AbstractDeliverySearchResolverService implements DeliverySearchResolver
Constructors
Properties
Home > @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver
AbstractLayoutMappingResolver class
Signature:
export declare class AbstractLayoutMappingResolver implements LayoutMappingResolver
Constructors
| (constructor)() | | Constructs a new instance of the AbstractLayoutMappingResolver class |
Properties
| getSelector | | (aLayoutMode: string, aRenderingContext: RenderingContextV2) => string | undefined | Returns the layout selector based on the rendering context |
| registerMapping | | (aId: string | string[], aSelector: string | string[], aLayoutMode?: string | string[]) => void | Registers a layout mapping |
Home > @acoustic-content-sdk/component-utils > AbstractLayoutResolverService
AbstractLayoutResolverService class
Signature:
export declare class AbstractLayoutResolverService implements LayoutResolver
Constructors
Properties
| resolveLayout | | (aLayoutMode: string, aRenderingContext: RenderingContextV2) => Observable<Layout> | |
Home > @acoustic-content-sdk/component-utils > AbstractProtectedContentService
AbstractProtectedContentService class
Service to tell whether or not to serve protected content
Signature:
export declare class AbstractProtectedContentService implements ProtectedContent
Constructors
Properties
Home > @acoustic-content-sdk/component-utils > AbstractRenderingContextResolverService
AbstractRenderingContextResolverService class
Implementation of a service that resolves the outbound parts of a rendering context
Signature:
export declare class AbstractRenderingContextResolverService implements RenderingContextResolver
Constructors
Properties
| resolveRenderingContext | | (aItem: RenderingContextInput, aProvider: RenderingContextProviderV2) => Observable<RenderingContextV2> | |
Home > @acoustic-content-sdk/component-utils > AbstractWchPageService
AbstractWchPageService class
Signature:
export declare class AbstractWchPageService implements WchPageService
Constructors
Properties
| getRenderingContextByPath | | (aPath: string) => Observable<RenderingContextV2 | null | undefined> | Resolves the rendering context given the path |
Home > @acoustic-content-sdk/component-utils > assertSameOrigin
assertSameOrigin() function
Validates that the origin of both windows is the same, otherwise throws an exception
Signature:
export declare function assertSameOrigin(aLeft: WindowType, aRight: WindowType, aLogSvc?: LoggerService): void;
Parameters
| aLeft | WindowType | left window to check |
| aRight | WindowType | right window to check |
| aLogSvc | LoggerService | optionally the logger service |
Returns:
void
Home > @acoustic-content-sdk/component-utils > createLayoutComponentDecorator
createLayoutComponentDecorator() function
Layout decorator and metadata.
Signature:
export declare function createLayoutComponentDecorator<TYPE, DIRECTIVE extends AbstractLayoutComponentDirective>(aComponentConsumer: BiConsumer<TYPE, AbstractRegisteredComponent<TYPE, DIRECTIVE>>, aLayoutMappingConsumer: BiConsumer<TYPE, AbstractRegisteredLayoutMapping<TYPE>>): <T extends TYPE>(aDirective?: DIRECTIVE) => (cls: T) => void;
Parameters
| aComponentConsumer | BiConsumer<TYPE, AbstractRegisteredComponent<TYPE, DIRECTIVE>> | |
| aLayoutMappingConsumer | BiConsumer<TYPE, AbstractRegisteredLayoutMapping<TYPE>> | |
Returns:
<T extends TYPE>(aDirective?: DIRECTIVE) => (cls: T) => void
Home > @acoustic-content-sdk/component-utils > createLayoutMappingDecorator
createLayoutMappingDecorator() function
Constructs the laout mapping decorator. Will callback the given function with the decorated object
Signature:
export declare function createLayoutMappingDecorator<TYPE>(aLayoutMappingConsumer: BiConsumer<TYPE, AbstractRegisteredLayoutMapping<TYPE>>): <T extends TYPE>(aID: string | string[] | LayoutMappingDirective, aSelector?: string | string[] | TYPE, aLayoutMode?: string | string[]) => (cls: T) => void;
Parameters
| aLayoutMappingConsumer | BiConsumer<TYPE, AbstractRegisteredLayoutMapping<TYPE>> | |
Returns:
<T extends TYPE>(aID: string | string[] | LayoutMappingDirective, aSelector?: string | string[] | TYPE, aLayoutMode?: string | string[]) => (cls: T) => void
Home > @acoustic-content-sdk/component-utils > getEditHostWindow
getEditHostWindow() function
Returns the window that controls the application. This is either the parent window or the opener window.
Signature:
export declare function getEditHostWindow(aCurrentWindow: WindowType): WindowType;
Parameters
| aCurrentWindow | WindowType | the current window |
Returns:
WindowType
the controlling window
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredComponent
AbstractRegisteredComponent interface
Signature:
export interface AbstractRegisteredComponent<TYPE, DIRECTIVE extends AbstractLayoutComponentDirective>
Properties
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping
AbstractRegisteredLayoutMapping interface
Signature:
export interface AbstractRegisteredLayoutMapping<TYPE>
Properties
| id | string | string[] | Type IDs or content IDs to map this to |
| kind | CONTENT_ITEM_KIND | CONTENT_ITEM_KIND[] | Type IDs to map this to |
| layoutMode | string | string[] | An optional layout mode used with this layout mapping. |
| selector | string | string[] | TYPE | Defines the mapping between the layout controller to the layout implementation. If this property is missing, the selector of the component will be used instead. |
Home > @acoustic-content-sdk/component-utils > DEFAULT_LAYOUT_ID
DEFAULT_LAYOUT_ID variable
name of the default layout
Signature:
DEFAULT_LAYOUT_ID = "wch-default-layout"
Home > @acoustic-content-sdk/component-utils > PAGE_NOT_FOUND_LAYOUT_ID
PAGE_NOT_FOUND_LAYOUT_ID variable
Signature:
PAGE_NOT_FOUND_LAYOUT_ID = "wch-404"
Home > @acoustic-content-sdk/component-utils > selectId
selectId variable
Signature:
selectId: import("rxjs").UnaryFunction<any, any>
Home > @acoustic-content-sdk/component-utils > selectIdFromRenderingContext
selectIdFromRenderingContext variable
Signature:
selectIdFromRenderingContext: import("rxjs").UnaryFunction<any, string>
Home > @acoustic-content-sdk/component-utils > selectMetadata
selectMetadata variable
Signature:
selectMetadata: import("rxjs").UnaryFunction<DeliveryReferenceElement | DeliveryContentItem | DeliveryGroupElement | RenderingContextV2, import("@acoustic-content-sdk/api").DeliveryGroupElementMetadata | import("@acoustic-content-sdk/api").DeliveryReferenceElementMetadata | import("@acoustic-content-sdk/api").DeliveryContentMetadata>
Home > @acoustic-content-sdk/component-utils > VERSION
VERSION variable
Version and build number of the package
Signature:
VERSION: {
version: {
major: string;
minor: string;
patch: string;
branch: string;
};
build: Date;
}
Home > @acoustic-content-sdk/component-utils > SendRequest
SendRequest type
Signature:
export declare type SendRequest = <T>(aUrl: string, aCredentials: boolean) => Observable<T>;
Home > @acoustic-content-sdk/component-utils > AbstractComponentResolverService > (constructor)
AbstractComponentResolverService.(constructor)
Constructs a new instance of the AbstractComponentResolverService class
Signature:
protected constructor(aComponentsService: AbstractComponentsService<TYPE>, aLayoutResolverService: LayoutResolver, aLayoutMappingService: LayoutMappingResolver, aComponentTypeRefResolvers?: AbstractComponentTypeRefResolver<TYPE>[], aLogSvc?: LoggerService);
Parameters
| aComponentsService | AbstractComponentsService<TYPE> | |
| aLayoutResolverService | LayoutResolver | |
| aLayoutMappingService | LayoutMappingResolver | |
| aComponentTypeRefResolvers | AbstractComponentTypeRefResolver<TYPE>[] | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractComponentResolverService > resolveComponent
AbstractComponentResolverService.resolveComponent property
Signature:
resolveComponent: (aRenderingContext: RenderingContextV2, aLayoutMode?: string) => Observable<TYPE>;
Home > @acoustic-content-sdk/component-utils > AbstractComponentsService > (constructor)
AbstractComponentsService.(constructor)
Initializes our constructor. We make sure to keep all private instance variables as part of the closure and override the methods on the instance level. Since this is a singleton service, that approach does not cause a performance problem.
Signature:
protected constructor(aDefaultComponent: TYPE, aPredicate: EqualsPredicate<TYPE>, aLogSvc?: LoggerService);
Parameters
| aDefaultComponent | TYPE | |
| aPredicate | EqualsPredicate<TYPE> | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractComponentsService > getTypeByLayout
AbstractComponentsService.getTypeByLayout property
Returns the type object based on the layout configuration
Signature:
getTypeByLayout: (aLayout: Layout, aLayoutMode?: string) => Observable<TYPE>;
Home > @acoustic-content-sdk/component-utils > AbstractComponentsService > getTypeBySelector
AbstractComponentsService.getTypeBySelector property
Returns the type object based on the layout selector
Signature:
getTypeBySelector: (aSelector: string, aLayoutMode?: string) => Observable<TYPE>;
Home > @acoustic-content-sdk/component-utils > AbstractComponentsService > registerType
AbstractComponentsService.registerType property
define the methods
Signature:
registerType: (aController: string | string[], aType: TYPE, aLayoutModes?: string | string[]) => void;
Home > @acoustic-content-sdk/component-utils > AbstractDeliverySearchResolverService > (constructor)
AbstractDeliverySearchResolverService.(constructor)
Constructs a new instance of the AbstractDeliverySearchResolverService class
Signature:
protected constructor(aFetchText: FetchText, aProtected: ProtectedContent, aSeedResolver?: SeedResolver, aLogSvc?: LoggerService);
Parameters
| aFetchText | FetchText | |
| aProtected | ProtectedContent | |
| aSeedResolver | SeedResolver | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractDeliverySearchResolverService > getDeliverySearchResults
AbstractDeliverySearchResolverService.getDeliverySearchResults property
Signature:
getDeliverySearchResults: <T>(aQuery: QueryInput, aClassification: string) => Observable<SearchResults<T>>;
Home > @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver > (constructor)
AbstractLayoutMappingResolver.(constructor)
Constructs a new instance of the AbstractLayoutMappingResolver class
Signature:
protected constructor();
Home > @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver > getSelector
AbstractLayoutMappingResolver.getSelector property
Returns the layout selector based on the rendering context
Signature:
getSelector: (aLayoutMode: string, aRenderingContext: RenderingContextV2) => string | undefined;
Home > @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver > registerMapping
AbstractLayoutMappingResolver.registerMapping property
Registers a layout mapping
Signature:
registerMapping: (aId: string | string[], aSelector: string | string[], aLayoutMode?: string | string[]) => void;
Home > @acoustic-content-sdk/component-utils > AbstractProtectedContentService > (constructor)
AbstractProtectedContentService.(constructor)
Constructs a new instance of the AbstractProtectedContentService class
Signature:
protected constructor(aUrlConfig$: Observable<UrlConfig>, aAuthStatus: AuthStatus, aLogSvc?: LoggerService);
Parameters
| aUrlConfig$ | Observable<UrlConfig> | |
| aAuthStatus | AuthStatus | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractProtectedContentService > protected$
AbstractProtectedContentService.protected$ property
Signature:
protected$: Observable<boolean>;
Home > @acoustic-content-sdk/component-utils > AbstractLayoutResolverService > (constructor)
AbstractLayoutResolverService.(constructor)
Constructs a new instance of the AbstractLayoutResolverService class
Signature:
protected constructor(aDeliveryTypeResolver: DeliveryTypeResolver, aDeliveryLayoutMappingResolver: DeliveryLayoutMappingResolver, aDeliveryLayoutResolver: DeliveryLayoutResolver, aLogSvc?: LoggerService);
Parameters
| aDeliveryTypeResolver | DeliveryTypeResolver | |
| aDeliveryLayoutMappingResolver | DeliveryLayoutMappingResolver | |
| aDeliveryLayoutResolver | DeliveryLayoutResolver | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractLayoutResolverService > resolveLayout
AbstractLayoutResolverService.resolveLayout property
Signature:
resolveLayout: (aLayoutMode: string, aRenderingContext: RenderingContextV2) => Observable<Layout>;
Home > @acoustic-content-sdk/component-utils > AbstractWchPageService > (constructor)
AbstractWchPageService.(constructor)
Constructs a new instance of the AbstractWchPageService class
Signature:
protected constructor(aDeliveryPageResolver: DeliveryPageResolver, aUrlConfig$: Observable<UrlConfig>, aLogSvc?: LoggerService);
Parameters
| aDeliveryPageResolver | DeliveryPageResolver | |
| aUrlConfig$ | Observable<UrlConfig> | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractWchPageService > getRenderingContextByPath
AbstractWchPageService.getRenderingContextByPath property
Resolves the rendering context given the path
Signature:
getRenderingContextByPath: (aPath: string) => Observable<RenderingContextV2 | null | undefined>;
Home > @acoustic-content-sdk/component-utils > AbstractRenderingContextResolverService > (constructor)
AbstractRenderingContextResolverService.(constructor)
Constructs a new instance of the AbstractRenderingContextResolverService class
Signature:
protected constructor(aDeliveryContentResolver: DeliveryContentResolver, aLogSvc?: LoggerService);
Parameters
| aDeliveryContentResolver | DeliveryContentResolver | |
| aLogSvc | LoggerService | |
Home > @acoustic-content-sdk/component-utils > AbstractRenderingContextResolverService > resolveRenderingContext
AbstractRenderingContextResolverService.resolveRenderingContext property
Signature:
resolveRenderingContext: (aItem: RenderingContextInput, aProvider: RenderingContextProviderV2) => Observable<RenderingContextV2>;
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping > id
AbstractRegisteredLayoutMapping.id property
Type IDs or content IDs to map this to
Signature:
id?: string | string[];
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping > kind
AbstractRegisteredLayoutMapping.kind property
Type IDs to map this to
Signature:
kind?: CONTENT_ITEM_KIND | CONTENT_ITEM_KIND[];
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping > layoutMode
AbstractRegisteredLayoutMapping.layoutMode property
An optional layout mode used with this layout mapping.
Signature:
layoutMode?: string | string[];
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping > selector
AbstractRegisteredLayoutMapping.selector property
Defines the mapping between the layout controller to the layout implementation. If this property is missing, the selector of the component will be used instead.
Signature:
selector: string | string[] | TYPE;
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredComponent > directive
AbstractRegisteredComponent.directive property
Signature:
directive: DIRECTIVE;
Home > @acoustic-content-sdk/component-utils > AbstractRegisteredComponent > type
AbstractRegisteredComponent.type property
Signature:
type: TYPE;