@acoustic-content-sdk/component-utils 中文文档教程

发布于 4年前 浏览 13 更新于 3年前

npm

框架独立的实用功能集合,用于接下来为网站实施服务和组件。

Table of Contents

@acoustic-content-sdk/component-utils

component-utils package

框架独立的实用功能集合,用于接下来为网站实施服务和组件。

Classes

Class Description
AbstractComponentResolverService Base class for component type resolvers
AbstractComponentsService
AbstractDeliverySearchResolverService
AbstractLayoutMappingResolver
AbstractLayoutResolverService
AbstractProtectedContentService Service to tell whether or not to serve protected content
AbstractRenderingContextResolverService Implementation of a service that resolves the outbound parts of a rendering context
AbstractWchPageService

Functions

Function Description
assertSameOrigin(aLeft, aRight, aLogSvc) Validates that the origin of both windows is the same, otherwise throws an exception
createLayoutComponentDecorator(aComponentConsumer, aLayoutMappingConsumer) Layout decorator and metadata.
createLayoutMappingDecorator(aLayoutMappingConsumer) Constructs the laout mapping decorator. Will callback the given function with the decorated object
getEditHostWindow(aCurrentWindow) Returns the window that controls the application. This is either the parent window or the opener window.

Interfaces

Interface Description
AbstractRegisteredComponent
AbstractRegisteredLayoutMapping

Variables

Variable Description
DEFAULT_LAYOUT_ID name of the default layout
PAGE_NOT_FOUND_LAYOUT_ID
selectId
selectIdFromRenderingContext
selectMetadata
VERSION Version and build number of the package

Type Aliases

Type Alias Description
SendRequest

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

Constructor Modifiers Description
(constructor)(aComponentsService, aLayoutResolverService, aLayoutMappingService, aComponentTypeRefResolvers, aLogSvc) Constructs a new instance of the AbstractComponentResolverService class

Properties

Property Modifiers Type Description
resolveComponent (aRenderingContext: RenderingContextV2, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt;

首页 > @acoustic-content-sdk/component-utils > AbstractComponentsService

AbstractComponentsService class

Signature:

export declare class AbstractComponentsService<TYPE> implements AbstractComponentsRegistry<TYPE> 

Constructors

Constructor Modifiers Description
(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

Property Modifiers Type Description
getTypeByLayout (aLayout: Layout, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt; Returns the type object based on the layout configuration
getTypeBySelector (aSelector: string, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt; Returns the type object based on the layout selector
registerType (aController: string &#124; string[], aType: TYPE, aLayoutModes?: string &#124; string[]) =&gt; void define the methods

Home > ; @acoustic-content-sdk/component-utils > AbstractDeliverySearchResolverService

AbstractDeliverySearchResolverService class

Signature:

export declare class AbstractDeliverySearchResolverService implements DeliverySearchResolver 

Constructors

Constructor Modifiers Description
(constructor)(aFetchText, aProtected, aSeedResolver, aLogSvc) Constructs a new instance of the AbstractDeliverySearchResolverService class

Properties

Property Modifiers Type Description
getDeliverySearchResults &lt;T&gt;(aQuery: QueryInput, aClassification: string) =&gt; Observable&lt;SearchResults&lt;T&gt;&gt;

Home > ; @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver

AbstractLayoutMappingResolver class

Signature:

export declare class AbstractLayoutMappingResolver implements LayoutMappingResolver 

Constructors

Constructor Modifiers Description
(constructor)() Constructs a new instance of the AbstractLayoutMappingResolver class

Properties

Property Modifiers Type Description
getSelector (aLayoutMode: string, aRenderingContext: RenderingContextV2) =&gt; string &#124; undefined Returns the layout selector based on the rendering context
registerMapping (aId: string &#124; string[], aSelector: string &#124; string[], aLayoutMode?: string &#124; string[]) =&gt; void Registers a layout mapping

Home > ; @acoustic-content-sdk/component-utils > AbstractLayoutResolverService

AbstractLayoutResolverService class

Signature:

export declare class AbstractLayoutResolverService implements LayoutResolver 

Constructors

Constructor Modifiers Description
(constructor)(aDeliveryTypeResolver, aDeliveryLayoutMappingResolver, aDeliveryLayoutResolver, aLogSvc) Constructs a new instance of the AbstractLayoutResolverService class

Properties

Property Modifiers Type Description
resolveLayout (aLayoutMode: string, aRenderingContext: RenderingContextV2) =&gt; Observable&lt;Layout&gt;

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

Constructor Modifiers Description
(constructor)(aUrlConfig$, aAuthStatus, aLogSvc) Constructs a new instance of the AbstractProtectedContentService class

Properties

Property Modifiers Type Description
protected$ Observable&lt;boolean&gt;

主页 > @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

Constructor Modifiers Description
(constructor)(aDeliveryContentResolver, aLogSvc) Constructs a new instance of the AbstractRenderingContextResolverService class

Properties

Property Modifiers Type Description
resolveRenderingContext (aItem: RenderingContextInput, aProvider: RenderingContextProviderV2) =&gt; Observable&lt;RenderingContextV2&gt;

主页 > @acoustic-content-sdk/component-utils > AbstractWchPageService

AbstractWchPageService class

Signature:

export declare class AbstractWchPageService implements WchPageService 

Constructors

Constructor Modifiers Description
(constructor)(aDeliveryPageResolver, aUrlConfig$, aLogSvc) Constructs a new instance of the AbstractWchPageService class

Properties

Property Modifiers Type Description
getRenderingContextByPath (aPath: string) =&gt; Observable&lt;RenderingContextV2 &#124; null &#124; undefined&gt; Resolves the rendering context given the path

Home > ; @acoustic-content-sdk/component-utils > assertSameOrigin

assertSameOrigin() function

验证两个窗口的来源是否相同,否则抛出异常

签名:

export declare function assertSameOrigin(aLeft: WindowType, aRight: WindowType, aLogSvc?: LoggerService): void;

Parameters

Parameter Type Description
aLeft WindowType left window to check
aRight WindowType right window to check
aLogSvc LoggerService optionally the logger service

返回:

void

主页 @acoustic-content-sdk/component-utils > createLayoutComponentDecorator

createLayoutComponentDecorator() function

布局装饰器和元数据。

签名:

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

Parameter Type Description
aComponentConsumer BiConsumer&lt;TYPE, AbstractRegisteredComponent&lt;TYPE, DIRECTIVE&gt;&gt;
aLayoutMappingConsumer BiConsumer&lt;TYPE, AbstractRegisteredLayoutMapping&lt;TYPE&gt;&gt;

返回:

(aDirective?: DIRECTIVE) => (cls: T) => void

Home > @acoustic-content-sdk/component-utils > createLayoutMappingDecorator

createLayoutMappingDecorator() function

构造布局映射装饰器。 将使用装饰对象回调给定函数

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

Parameter Type Description
aLayoutMappingConsumer BiConsumer&lt;TYPE, AbstractRegisteredLayoutMapping&lt;TYPE&gt;&gt;

Returns:

(aID: string | string[] | LayoutMappingDirective, aSelector?: string | string[] | TYPE, aLayoutMode?: string | string[]) => (cls: T) => void

@acoustic-content-sdk/component-utils > getEditHostWindow

getEditHostWindow() function

返回控制应用程序的窗口。 这是父窗口或开启者窗口。

Signature:

export declare function getEditHostWindow(aCurrentWindow: WindowType): WindowType;

Parameters

Parameter Type Description
aCurrentWindow WindowType the current window

Returns:

WindowType

the controlling window

首页 > @acoustic-content-sdk/component-utils > AbstractRegisteredComponent

AbstractRegisteredComponent interface

Signature:

export interface AbstractRegisteredComponent<TYPE, DIRECTIVE extends AbstractLayoutComponentDirective> 

Properties

Property Type Description
directive DIRECTIVE
type TYPE

Home > ; @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping

AbstractRegisteredLayoutMapping interface

Signature:

export interface AbstractRegisteredLayoutMapping<TYPE> 

Properties

Property Type Description
id string &#124; string[] Type IDs or content IDs to map this to
kind CONTENT_ITEM_KIND &#124; CONTENT_ITEM_KIND[] Type IDs to map this to
layoutMode string &#124; string[] An optional layout mode used with this layout mapping.
selector string &#124; string[] &#124; 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;
}

首页 > @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

Parameter Type Description
aComponentsService AbstractComponentsService&lt;TYPE&gt;
aLayoutResolverService LayoutResolver
aLayoutMappingService LayoutMappingResolver
aComponentTypeRefResolvers AbstractComponentTypeRefResolver&lt;TYPE&gt;[]
aLogSvc LoggerService

主页 > @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)

初始化我们的构造函数。 我们确保将所有私有实例变量保留为闭包的一部分,并在实例级别覆盖方法。 由于这是一个单例服务,该方法不会导致性能问题。

Signature:

protected constructor(aDefaultComponent: TYPE, aPredicate: EqualsPredicate<TYPE>, aLogSvc?: LoggerService);

Parameters

Parameter Type Description
aDefaultComponent TYPE
aPredicate EqualsPredicate&lt;TYPE&gt;
aLogSvc LoggerService

Home > @acoustic-content-sdk/component-utils > 抽象组件服务 > getTypeByLayout

AbstractComponentsService.getTypeByLayout property

Returns the type object based on the layout configuration

Signature:

getTypeByLayout: (aLayout: Layout, aLayoutMode?: string) => Observable<TYPE>;

主页 > @acoustic-content-sdk/component-utils > 抽象组件服务 > getTypeBySelector

AbstractComponentsService.getTypeBySelector property

Returns the type object based on the layout selector

Signature:

getTypeBySelector: (aSelector: string, aLayoutMode?: string) => Observable<TYPE>;

主页 > @acoustic-content-sdk/component-utils > 抽象组件服务 > 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

Parameter Type Description
aFetchText FetchText
aProtected ProtectedContent
aSeedResolver SeedResolver
aLogSvc LoggerService

主页 > @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();

主页 > @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;

主页 > @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< /a> > @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

Parameter Type Description
aUrlConfig$ Observable&lt;UrlConfig&gt;
aAuthStatus AuthStatus
aLogSvc LoggerService

主页 > @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

Parameter Type Description
aDeliveryTypeResolver DeliveryTypeResolver
aDeliveryLayoutMappingResolver DeliveryLayoutMappingResolver
aDeliveryLayoutResolver DeliveryLayoutResolver
aLogSvc LoggerService

主页 > @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

Parameter Type Description
aDeliveryPageResolver DeliveryPageResolver
aUrlConfig$ Observable&lt;UrlConfig&gt;
aLogSvc LoggerService

主页 > @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>;

首页 > @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

Parameter Type Description
aDeliveryContentResolver DeliveryContentResolver
aLogSvc LoggerService

主页 > @acoustic-content-sdk/component-utils > AbstractRenderingContextResolverService > resolveRenderingContext

AbstractRenderingContextResolverService.resolveRenderingContext property

Signature:

resolveRenderingContext: (aItem: RenderingContextInput, aProvider: RenderingContextProviderV2) => Observable<RenderingContextV2>;

Home > ; @acoustic-content-sdk/component-utils > 抽象注册布局映射 > id

AbstractRegisteredLayoutMapping.id property

Type IDs or content IDs to map this to

Signature:

id?: string | string[];

主页 > @acoustic-content-sdk/component-utils > 抽象注册布局映射 > kind

AbstractRegisteredLayoutMapping.kind property

Type IDs to map this to

Signature:

kind?: CONTENT_ITEM_KIND | CONTENT_ITEM_KIND[];

首页 > @acoustic-content-sdk/component-utils > 抽象注册布局映射 > layoutMode

AbstractRegisteredLayoutMapping.layoutMode property

用于此布局映射的可选布局模式。

Signature:

layoutMode?: string | string[];

Home > @acoustic-content-sdk/component-utils > 抽象注册布局映射 > 选择器

AbstractRegisteredLayoutMapping.selector property

定义布局控制器到布局实现之间的映射。 如果缺少此属性,将使用组件的选择器代替。

Signature:

selector: string | string[] | TYPE;

Home > @acoustic-content-sdk/component-utils > 抽象注册组件 > directive

AbstractRegisteredComponent.directive property

Signature:

directive: DIRECTIVE;

Home > ; @acoustic-content-sdk/component-utils > 抽象注册组件 > 键入

AbstractRegisteredComponent.type property

签名:

type: TYPE;

npm

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

Class Description
AbstractComponentResolverService Base class for component type resolvers
AbstractComponentsService
AbstractDeliverySearchResolverService
AbstractLayoutMappingResolver
AbstractLayoutResolverService
AbstractProtectedContentService Service to tell whether or not to serve protected content
AbstractRenderingContextResolverService Implementation of a service that resolves the outbound parts of a rendering context
AbstractWchPageService

Functions

Function Description
assertSameOrigin(aLeft, aRight, aLogSvc) Validates that the origin of both windows is the same, otherwise throws an exception
createLayoutComponentDecorator(aComponentConsumer, aLayoutMappingConsumer) Layout decorator and metadata.
createLayoutMappingDecorator(aLayoutMappingConsumer) Constructs the laout mapping decorator. Will callback the given function with the decorated object
getEditHostWindow(aCurrentWindow) Returns the window that controls the application. This is either the parent window or the opener window.

Interfaces

Interface Description
AbstractRegisteredComponent
AbstractRegisteredLayoutMapping

Variables

Variable Description
DEFAULT_LAYOUT_ID name of the default layout
PAGE_NOT_FOUND_LAYOUT_ID
selectId
selectIdFromRenderingContext
selectMetadata
VERSION Version and build number of the package

Type Aliases

Type Alias Description
SendRequest

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

Constructor Modifiers Description
(constructor)(aComponentsService, aLayoutResolverService, aLayoutMappingService, aComponentTypeRefResolvers, aLogSvc) Constructs a new instance of the AbstractComponentResolverService class

Properties

Property Modifiers Type Description
resolveComponent (aRenderingContext: RenderingContextV2, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt;

Home > @acoustic-content-sdk/component-utils > AbstractComponentsService

AbstractComponentsService class

Signature:

export declare class AbstractComponentsService<TYPE> implements AbstractComponentsRegistry<TYPE> 

Constructors

Constructor Modifiers Description
(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

Property Modifiers Type Description
getTypeByLayout (aLayout: Layout, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt; Returns the type object based on the layout configuration
getTypeBySelector (aSelector: string, aLayoutMode?: string) =&gt; Observable&lt;TYPE&gt; Returns the type object based on the layout selector
registerType (aController: string &#124; string[], aType: TYPE, aLayoutModes?: string &#124; string[]) =&gt; void define the methods

Home > @acoustic-content-sdk/component-utils > AbstractDeliverySearchResolverService

AbstractDeliverySearchResolverService class

Signature:

export declare class AbstractDeliverySearchResolverService implements DeliverySearchResolver 

Constructors

Constructor Modifiers Description
(constructor)(aFetchText, aProtected, aSeedResolver, aLogSvc) Constructs a new instance of the AbstractDeliverySearchResolverService class

Properties

Property Modifiers Type Description
getDeliverySearchResults &lt;T&gt;(aQuery: QueryInput, aClassification: string) =&gt; Observable&lt;SearchResults&lt;T&gt;&gt;

Home > @acoustic-content-sdk/component-utils > AbstractLayoutMappingResolver

AbstractLayoutMappingResolver class

Signature:

export declare class AbstractLayoutMappingResolver implements LayoutMappingResolver 

Constructors

Constructor Modifiers Description
(constructor)() Constructs a new instance of the AbstractLayoutMappingResolver class

Properties

Property Modifiers Type Description
getSelector (aLayoutMode: string, aRenderingContext: RenderingContextV2) =&gt; string &#124; undefined Returns the layout selector based on the rendering context
registerMapping (aId: string &#124; string[], aSelector: string &#124; string[], aLayoutMode?: string &#124; string[]) =&gt; void Registers a layout mapping

Home > @acoustic-content-sdk/component-utils > AbstractLayoutResolverService

AbstractLayoutResolverService class

Signature:

export declare class AbstractLayoutResolverService implements LayoutResolver 

Constructors

Constructor Modifiers Description
(constructor)(aDeliveryTypeResolver, aDeliveryLayoutMappingResolver, aDeliveryLayoutResolver, aLogSvc) Constructs a new instance of the AbstractLayoutResolverService class

Properties

Property Modifiers Type Description
resolveLayout (aLayoutMode: string, aRenderingContext: RenderingContextV2) =&gt; Observable&lt;Layout&gt;

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

Constructor Modifiers Description
(constructor)(aUrlConfig$, aAuthStatus, aLogSvc) Constructs a new instance of the AbstractProtectedContentService class

Properties

Property Modifiers Type Description
protected$ Observable&lt;boolean&gt;

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

Constructor Modifiers Description
(constructor)(aDeliveryContentResolver, aLogSvc) Constructs a new instance of the AbstractRenderingContextResolverService class

Properties

Property Modifiers Type Description
resolveRenderingContext (aItem: RenderingContextInput, aProvider: RenderingContextProviderV2) =&gt; Observable&lt;RenderingContextV2&gt;

Home > @acoustic-content-sdk/component-utils > AbstractWchPageService

AbstractWchPageService class

Signature:

export declare class AbstractWchPageService implements WchPageService 

Constructors

Constructor Modifiers Description
(constructor)(aDeliveryPageResolver, aUrlConfig$, aLogSvc) Constructs a new instance of the AbstractWchPageService class

Properties

Property Modifiers Type Description
getRenderingContextByPath (aPath: string) =&gt; Observable&lt;RenderingContextV2 &#124; null &#124; undefined&gt; 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

Parameter Type Description
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

Parameter Type Description
aComponentConsumer BiConsumer&lt;TYPE, AbstractRegisteredComponent&lt;TYPE, DIRECTIVE&gt;&gt;
aLayoutMappingConsumer BiConsumer&lt;TYPE, AbstractRegisteredLayoutMapping&lt;TYPE&gt;&gt;

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

Parameter Type Description
aLayoutMappingConsumer BiConsumer&lt;TYPE, AbstractRegisteredLayoutMapping&lt;TYPE&gt;&gt;

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

Parameter Type Description
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

Property Type Description
directive DIRECTIVE
type TYPE

Home > @acoustic-content-sdk/component-utils > AbstractRegisteredLayoutMapping

AbstractRegisteredLayoutMapping interface

Signature:

export interface AbstractRegisteredLayoutMapping<TYPE> 

Properties

Property Type Description
id string &#124; string[] Type IDs or content IDs to map this to
kind CONTENT_ITEM_KIND &#124; CONTENT_ITEM_KIND[] Type IDs to map this to
layoutMode string &#124; string[] An optional layout mode used with this layout mapping.
selector string &#124; string[] &#124; 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

Parameter Type Description
aComponentsService AbstractComponentsService&lt;TYPE&gt;
aLayoutResolverService LayoutResolver
aLayoutMappingService LayoutMappingResolver
aComponentTypeRefResolvers AbstractComponentTypeRefResolver&lt;TYPE&gt;[]
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

Parameter Type Description
aDefaultComponent TYPE
aPredicate EqualsPredicate&lt;TYPE&gt;
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

Parameter Type Description
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

Parameter Type Description
aUrlConfig$ Observable&lt;UrlConfig&gt;
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

Parameter Type Description
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

Parameter Type Description
aDeliveryPageResolver DeliveryPageResolver
aUrlConfig$ Observable&lt;UrlConfig&gt;
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

Parameter Type Description
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;
更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文