![npm](https://img.shields.io/npm/v/@acoustic-content-sdk/utils.svg?style=flat-square)
API Documentation
Home > @acoustic-content-sdk/utils
utils package
This library contains a set of utility functions to help implementing applications of libraries against [Watson Content Hub](https://www.ibm.com/products/watson-content-hub).
Some functions are very general purpose helper functions. We use them instead of 'lodash' to reduce size and improve speed.
Classes
Enumerations
Functions
Function | Description |
---|
_getResourceUrlFromApiURL(aApiURL) | Computes the resource URL given the API URL |
absoluteURL(aUrl, aDoc, aWindow) | Makes sure the URL is absolute, resolved against the base URL |
binarySearch(arr, x, cmp) | Performs a binary search on the array |
cacheLast(aEqualFunction, scheduler) | Operator that will replay the last value of a sequence to potentially many subscribers. The following assertions hold true:- there will be no identical subsequent values - there will be at most one subscription to the original sequence - if there are no more subscriptions to the resulting observable (refcount falls to zero), the operator unsubscribes from the source - if the original sequence has produced at least one value, this value will be the startingThis operator differs from shareReplay(1) in the following way (in addition to ensuring a unique sequence): - if the source observable is hot, then shareReplay(1) will never unsubscribe even if its subscriptions fall to zero. cacheLast will unsubscribe - if the source observable is cold but still producing values when subscriptions fall to zero, then shareReplay(1) will not unsubscribe and will not cancel the sequence. cacheLast will unsubscribe and cancel the sequence.This operator differs from shareReplay({bufferSize: 1, refCount: true}) in the following way (in addition to ensuring a unique sequence): - if subscriptions fall to zero, then with shareReplay the first value that subsequent subscriptions will get is the first value of a new subscription to the source sequence. With cacheLast the first value will be the last value of the previous subscription. |
chunkArray(aArray, aSize) | Splits the array into even chunks |
clientStorageFromWindow(aScope, aWindow) | Returns our storage object from the window |
cloneDeep(aValue) | Performs a deep clone for the value, supports just plain objects and arrays |
cloneUrlConfig(aUrlConfig) | Constructs a clone |
createDeliveryContentItem(aItem) | Converts a v1 delivery item structure into a simplified structure |
createDeliveryContentItemWithMetadata(aItem) | Merges metadata into each level |
createError(aMessage, aCause) | |
createGetter(aGetter) | Constructs a getter description |
createGetterOnObservable(aObservable, aInitial) | Constructs a getter description |
createLoggerService(aLoggerFactory) | Constructs a logger service on the basis of a logger factory. The service makes sure not to create the same logger multiple times |
createMarkupRendererV2(aDeliveryContent, aAuthoringType, aLayoutMapping, aLayout, aMarkupTemplate, aExtendedContext$, aLoggerService, aScheduler) | Constructs a new renderer that applies a handlebars transform to produce rendered markup. The markup will be kept current whenever any of the underlying data changes. |
createMessageHandler(aCorsWhitelist, aMsgHandlers, aLogger) | Constructs an event listener that listens for messages |
createNavigateByPathHandler(aNavigate, aLogger) | Executes a navigation event |
createRefreshHandler(aRefresh, aLogger) | Executes a refresh event |
createSetModeHandler(aPublicApiHandler, aLogger) | Executes a navigation event |
createSetterOnSubject(aSubject) | Constructs a setter description |
createSubscribeActiveRouteHandler(onActiveRenderingContext, aLogger) | Subscribes to the active route |
createSubscribeModeHandler(onUsePublic, aLogger) | Subscribes to the active route |
createSubscribeRouteHandler(aGetRenderingContextByPath, aLogger) | Subscribes to a given route |
createUnsubscribeHandler(aLogger) | Subscribes to a given route |
dbgAddSource(aSource, aObject) | Adds source information |
dbgCounter() | |
filterArray(aArray, aPredicate) | Filters an array |
flattenArray(aArray) | |
forEach(aArray, aConsumer) | Just run a callback for each element in an array |
forIn(aObject, aConsumer) | Run a callback for each key value pair |
fromObservableOrT(aValue) | Converts the generic type into an observable of the desired type |
generateItem(aGenerator) | Creates an observable that exposes the result of the function call if the result is defined. Otherwise this is an empty sequence. |
getAuthoringConfigElements(aType) | Returns the authoring config elements |
getAuthoringContentElements(aType) | Returns the authoring content elements |
getBaseUrlFromDocument(aDoc, aWindow) | Extracts the base URL from the current document |
getBaseUrlFromWindow(aWindow, aDocument) | Returns a base URL from the window |
getItemStatus(aRenderingContext) | Decodes the item status from the rendering context. This can e.g. be used to display status icons |
getLinksByRel(aDocument, aWindow) | Returns all links in the document, ordered by rel |
getOrigin(aDoc, aWindow) | Returns the orign from the doc |
hashString(oldHash, s) | |
httpCreateTimer(aOptions) | Creates a timer that fires at a randomly chosen interval as soon as subscribed to it |
httpGetJsonResource(aURL, aHttpService, aWithCredentials, aTrigger, aOptions, aLogger) | |
httpGetStringResource(aURL, aHttpService, aWithCredentials, aTrigger, aOptions, aLogger) | Represents an HTTP request, potentially made via the cache |
isArrayLikeOf(aValue, aPredicate) | Tests if all elements of the array are of a particular type |
isArrayOf(aValue, aPredicate) | Tests if all elements of the array are of a particular type |
isAuthoringConfigElement(aElement) | Checks if an element is a config element |
isAuthoringContentElement(aElement) | Checks if an element is a content element |
isAuthoringGroup(value) | |
isAuthoringGroupElement(aValue) | Tests if a field is a content type |
isAuthoringImage(value) | |
isAuthoringReference(value) | |
isAuthoringReferenceValue(value) | |
isAuthoringText(value) | |
isAuthoringVideo(value) | |
isCategory(aValue, bOptional) | |
isCategoryElement(aValue, bOptional) | Tests if an element is a category element |
isDate(aValue) | Tests if a value is a date |
isDateElement(aValue) | Tests if an element is a date element |
isDeliveryReferenceElement(aValue) | Tests if a value is a delivery reference element |
isElement(aValue, bOptional) | Tests if the value is a value element |
isElementType(aValue) | Tests if the value is a valid element type |
isEqual(aLeft, aRight) | |
isErrorResponse(aResponse) | Tests if a response is an error response |
isFile(aValue, bOptional) | Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isFileElement(aValue) | Tests if an element is a file element |
isFormattedTextElement(aValue) | Tests if an element is a text element |
isGroupElement(aValue, bOptional) | Tests if an element is a Group element |
isImage(aValue, bOptional) | Tests if an element is an image. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isImageElement(aValue) | Tests if an element is an image element |
isLink(aValue, bOptional) | Tests if we have a link element. We consider the element to exist if it has at least one of its fields set. |
isLinkElement(aValue) | Tests if an element is a link element |
isLocalizedText(aText) | Tests if a value is a localized context |
isLocation(aValue, bOptional) | |
isLocationElement(aValue, bOptional) | Tests if an element is a location element |
isMetadata(aValue) | Tests if the object is valid metadata |
isMultiDateElement(aValue, bOptional) | Tests if an element is a text element |
isMultiFileElement(aValue, bOptional) | Tests if an element is a file element |
isMultiFormattedTextElement(aValue, bOptional) | Tests if an element is a text element |
isMultiGroupElement(aValue, bOptional) | Tests if an element is a Group element |
isMultiImageElement(aValue, bOptional) | Tests if an element is an image element |
isMultiLinkElement(aValue, bOptional) | Tests if an element is an image element |
isMultiNumberElement(aValue, bOptional) | Tests if an element is a number element |
isMultiOptionSelectionElement(aValue, bOptional) | Tests if an element is an option selection element |
isMultiProductElement(aValue, bOptional) | Tests if an element is a text element |
isMultiReferenceElement(aValue, bOptional) | Tests if an element is a reference element |
isMultiTextElement(aValue, bOptional) | Tests if an element is a text element |
isMultiToggleElement(aValue, bOptional) | Tests if an element is a toggle element |
isMultiVideoElement(aValue, bOptional) | Tests if an element is an image element |
isNumberElement(aValue) | Tests if an element is a number element |
isObjectOf(aValue, aPredicate) | Tests if all fields of an object are of a particular type |
isOptional(aValue, aPredicate) | |
isOptionalArrayOf(aValue, aPredicate) | |
isOptionSelectionElement(aValue) | Tests if an element is an option selection element |
isPlainObject(aObject) | Tests for a plain object |
isProductElement(aValue) | |
isReferenceElement(aValue) | Tests if an element is a reference element |
isRenderingContextProvider(aValue) | Tests is an object is a rendering context provider |
isRenderingContextV2(aValue) | Tests if the object is a valid rendering context |
isSingleDateElement(aValue, bOptional) | Tests if an element is a date element |
isSingleFileElement(aValue, bOptional) | Tests if an element is a file element |
isSingleFormattedTextElement(aValue, bOptional) | Tests if an element is a text element |
isSingleGroupElement(aValue, bOptional) | Tests if an element is a Group element |
isSingleImageElement(aValue, bOptional) | Tests if an element is an image element |
isSingleLinkElement(aValue, bOptional) | Tests if an element is an image element |
isSingleNumberElement(aValue, bOptional) | Tests if an element is a number element |
isSingleOptionSelectionElement(aValue, bOptional) | Tests if an element is an option selection element |
isSingleProductElement(aValue, bOptional) | Tests if an element is a text element |
isSingleReferenceElement(aValue, bOptional) | Tests if an element is a reference element |
isSingleTextElement(aValue, bOptional) | Tests if an element is a text element |
isSingleToggleElement(aValue, bOptional) | Tests if an element is a toggle element |
isSingleVideoElement(aValue, bOptional) | Tests if an element is an image element |
isTextElement(aValue) | Tests if an element is a text element |
isToggleElement(aValue, bOptional) | Tests if an element is a toggle element |
isURL(aValue) | |
isUrlConfig(aValue) | Tests if a value is a valid url config object |
isValueOf(aType, aValue, bOptional) | Tests if the value is a value element |
isVideo(aValue, bOptional) | Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isVideoElement(aValue) | Tests if an element is a video element |
kebabCase(str) | |
logModule(aVersion, aModule, aLogSvc) | Logs version information for a module |
longHash() | Returns an initial value for the hash code |
luceneEscapeKeyValue(aKey, aTerm) | Generates a search selector and escapes the value. If the value is missing the method generates an expression that searches for missing values. |
luceneEscapeKeyValueAnd(aKey, aTerms) | Generates a selector and joins with 'AND' |
luceneEscapeKeyValueOr(aKey, aTerms) | Generates a selector and joins with 'OR' |
luceneEscapeTerm(aTerm) | Escapes a term according to lucence syntax |
mapArray(aArray, aMapper) | Maps every value in an array |
mergeObjects(aLeft, aRight) | Merge objects together and consider undefined or empty objects as not overridable |
nary(aArity, aFunction) | Implements a wrapper function that limits the arguments to the given size |
pageArrayEquals(aLeft, aRight) | Tests if two page arrays are equal |
pageCloneSitePage(aSitePage) | Performs a shallow clone of a site page |
pageCreatePartialSiteContextForSitePage(aPage, aSite) | Returns the partial rendering context for a site page |
pageCreateSiteContextFromSearchResult(aPage, aSearchResult, aSite) | Decomposes a search result into a site context structure |
pageEquals(aLeft, aRight) | Tests if two pages are equal |
pageGetEncodedPath(aPath) | Make sure we use a consistent encoding |
parseQueryString(aQuery) | Parses the query string into key/value pairs |
pathForSearch(aPath) | |
perfMeasure(aName) | |
pluckPath(aPath, aDefault) | Returns a function that plucks the given path from an object |
queryToCanonicalString(aValue) | Converts various inputs into a query string. |
queryToString(aValue) | Converts various inputs into a query string. |
reduceArray(aArray, aReducer, aInitial) | Tests every value in an array |
reduceForIn(aObject, aFunction, aInitial) | Run a callback for each key value pair |
reduceToObject(aArray, aKeyExtractor, aTransformer) | Groups an array into an object given a key extractor |
rxBackpressure(aDelegate) | Implementation of a backpressure operator. The operator will combine source items into chunks and produces a result observable per chunk. It will buffer source items as long as the observable of the last chunk has not finished, yet. |
rxCachedFunction(aDelegate, aAccessor) | Implements a function that caches the result of another function |
rxLayoutIdFromRenderingContext(aLayoutMode, aRenderingContext, aTypeAccessor, aLayoutMappingAccessor, aLogSvc, aScheduler) | Decodes the layout id from a type or provider |
rxUrlFromProvider(aProvider) | Converts the provider into a URL |
rxWchFromAuthoringTypeByAccessor(aAccessor, aTypeId, aSelector, aTypeAccessor, aScheduler) | Decodes information from the authoring element identified by the accessor expression. The method will first locate the correct authoring element based on the accessor and then applies a selector to extract the desired value from the element. |
rxWithSubscriptionCount(aCallback) | Returns an operator that invokes a callback with the subscription count |
safeCmp(aComparator) | Generates a safe comparator that also works if the arguments are nil |
sendJsonRequest(aUrl, aOptions, aTrigger, aHttpService, aLogger) | Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
sendRequest(aUrl, aOptions, aTrigger, aRequest, aLogger) | Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
sendTextRequest(aUrl, aOptions, aTrigger, aHttpService, aLogger) | Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
siteContextEquals(aLeft, aRight) | Tests if two site contexts are equal |
thisThenThat(aFirst, aNext) | Combines two observables such that the events on the first one are used until the second one starts to produce an event. From then on only the events on the second one will be used and the first one canceled. |
toInteger(aValue, aDefault) | Converts the value to an integer |
urlConfigEquals(aLeft, aRight) | Tests if two UrlConfig objects are equal |
urlEquals(aLeft, aRight) | Tests if two URL objects are equal |
urlFromProvider(aProvider) | Converts the provider into a URL |
urlSlashes(aUrl) | Makes sure that a path starts and ends with slash |
urlToString(aURL) | Shortcut to convert a URL to a string |
wchAddDebug(aPath, aRenderingContext) | |
wchAddTypings(aRenderingContext) | Adds typings next to the elements |
wchAdjustRenderingContextSearchQuery(aQuery) | Analyzes the search query and makes sure that it contains the required fields. |
wchAdjustSitePagesSearchQuery(aQuery, aSiteId) | Analyzes the search query and makes sure that it contains the required fields. |
wchAuthoringElementFromAccessor(aAccessor, aType) | Decodes the authoring element from the accessor expression |
wchBoxFetchLevels(aLevels, aDefault) | Returns the number of fetch levels |
wchBoxLayoutMode(aMode) | Maps unknown or empty modes |
wchCreateUrlConfig(aBaseUrl, aApiUrl, aResourceUrl, aDocument) | Constructs a interface based on some optional config values. |
wchCycleHandling(aCycle) | |
wchDecodeAccessor(aPrototype, aAccessor) | Tranlates the accessor to an expression |
wchDecodeExpression(aExpression) | Decodes the expression back to an expression into elements. The expression might point either to the optimized element or to the elements structure itself. |
wchDeliveryContentByAccessor(aItem, aAccessor) | Returns the element identified by the accessor string from a content item in delivery format |
wchElementFromRenderingContext(aContext, aAccessor) | Decodes an element from the accessor |
wchForEachRenderingContext(aRenderingContext, aCallback) | Iterates over all rendering contexts referenced by this context |
wchForEachType(aType, aCallback) | Resolves all typeRef |
wchGetApiUrlFromResourceURL(aResourceURL) | Computes the API URL given the resource URL |
wchGetApiUrlInContext(aApiUrl, aBaseURL, aPreviewCheck) | Constructs a API URL based on a context check callback |
wchGetBaseURL(aDocument, aWindow) | Decodes the base URL. The base URL is the URL that all routing URLs will start with and will be resolved as relative. The URL ends with a slash character. See . |
wchGetHubInfoFromBaseURL(aBaseURL) | Decodes the hub info from the base URL. This assumes that the application is served from a location in WCH. |
wchGetHubInfoFromLinks(aDocument, aWindow) | Decodes the hub info from links in the document |
wchGetHubInfoUrlProvider(aApiUrl, aPreviewCheck) | Exposes a provider based on a API URL and a preview callback |
wchGetLayout(aLayoutMode, aContext) | Returns the layout object for a particular mode for the rendering context |
wchGetPageSearchURL(aPath, aSiteId) | Returns the URI for a page search URL |
wchGetParentPageURL(aParentId, aSiteId) | Returns the URI for a parent page search |
wchGetSearchURL(aQueryString) | Builds the search query string |
wchGetSiteContextURL(aParentId, aPageId, aSiteId) | Returns the URI for a page search URL |
wchInsertPlaceholders(aRenderingContext, aResolver) | |
wchIsPreviewMode(aBaseURL) | Determines if the server is running in preview mode |
wchPlaceholderFromAccessor(aAccessor, aType) | Decodes the placeholder from an accessor expression |
wchPlaceholderResolver(aTag, aSearch) | Returns a resolver for placeholders based on WCH search |
wchPrepareRenderingContextInterceptors(aRenderingContextInterceptors) | Prepare a list of interceptors |
wchResolveRenderingContext(aRenderingContext, aStrategy, aRenderingContextById, aLogger) | Resolves the rendering context according to the configured strategy |
wchResolveType(aType) | Resolves all typeRef |
wchSelectAccessor(aAccessor) | parses a path expression |
wchTypeFromAccessor(aAccessor, aType) | Decodes the element type from an accessor expression |
Interfaces
Variables
Type Aliases
Home > @acoustic-content-sdk/utils > ClientStorageService
ClientStorageService class
Signature:
export declare class ClientStorageService implements ClientStorage
Constructors
Properties
Property | Modifiers | Type | Description |
---|
get | | (aKey: string) => JSONValue | |
put | | (aKey: string, aValue: JSONValue) => void | |
Home > @acoustic-content-sdk/utils > SiteInformation
SiteInformation class
Signature:
export declare class SiteInformation
Constructors
Constructor | Modifiers | Description |
---|
(constructor)() | | Constructs a new instance of the SiteInformation class |
Properties
Property | Modifiers | Type | Description |
---|
observer | | Observer<Site> | |
site | | Observable<Site> | Attaches the modifications on the current site |
Methods
Method | Modifiers | Description |
---|
getIdByPath(path) | | Returns an observable that communicates the content IDs of items for a particular path. If the mapping changes, the change will be propagated. If the mapping is unknown (because the site has not been loaded, yet) the mapping will be communicated as undefined. If the mapping is known to not exist it will be communicated as null. |
getSiteContextById(aID) | | Returns the site context for an ID |
Home > @acoustic-content-sdk/utils > StaticResources
StaticResources class
Accessor for static resources, placed next to the application
Signature:
export declare class StaticResources
Constructors
Methods
Method | Modifiers | Description |
---|
get(aKey) | | Retrieves the bootstrap data from the cache |
Home > @acoustic-content-sdk/utils > ItemStatus
ItemStatus enum
Signature:
export declare enum ItemStatus
Enumeration Members
Member | Value | Description |
---|
APPROVED_DRAFT | 1 | |
DRAFT | 0 | |
PENDING_DRAFT | 2 | |
PUBLISHED | 3 | |
Home > @acoustic-content-sdk/utils > RxLogger
RxLogger enum
Checks what to log
Signature:
export declare enum RxLogger
Enumeration Members
Member | Value | Description |
---|
ALL | 7 | |
DONE | 2 | |
ERROR | 4 | |
NEXT | 1 | |
Home > @acoustic-content-sdk/utils > _getResourceUrlFromApiURL
_getResourceUrlFromApiURL() function
Computes the resource URL given the API URL
Signature:
declare function _getResourceUrlFromApiURL(aApiURL: URL): URL;
Parameters
Parameter | Type | Description |
---|
aApiURL | URL | the API URL |
Returns:
URL
the resource URL
Home > @acoustic-content-sdk/utils > absoluteURL
absoluteURL() function
Makes sure the URL is absolute, resolved against the base URL
Signature:
declare function _absoluteURL(aUrl: string, aDoc?: Document, aWindow?: Window): string;
Parameters
Parameter | Type | Description |
---|
aUrl | string | the URL |
aDoc | Document | the document |
aWindow | Window | the window |
Returns:
string
the resolved URL
Home > @acoustic-content-sdk/utils > binarySearch
binarySearch() function
Performs a binary search on the array
Signature:
export declare function binarySearch<T, K = T>(arr: ArrayLike<T>, x: K, cmp: BiFunction<T, K, number>): number;
Parameters
Parameter | Type | Description |
---|
arr | ArrayLike<T> | the array |
x | K | value to find |
cmp | BiFunction<T, K, number> | comparator for the values |
Returns:
number
the located match or the insertion point (-idx-1)
Home > @acoustic-content-sdk/utils > cacheLast
cacheLast() function
Operator that will replay the last value of a sequence to potentially many subscribers. The following assertions hold true:
- there will be no identical subsequent values - there will be at most one subscription to the original sequence - if there are no more subscriptions to the resulting observable (refcount falls to zero), the operator unsubscribes from the source - if the original sequence has produced at least one value, this value will be the starting
This operator differs from shareReplay(1)
in the following way (in addition to ensuring a unique sequence): - if the source observable is hot, then shareReplay(1)
will never unsubscribe even if its subscriptions fall to zero. cacheLast
will unsubscribe - if the source observable is cold but still producing values when subscriptions fall to zero, then shareReplay(1)
will not unsubscribe and will not cancel the sequence. cacheLast
will unsubscribe and cancel the sequence.
This operator differs from shareReplay({bufferSize: 1, refCount: true})
in the following way (in addition to ensuring a unique sequence): - if subscriptions fall to zero, then with shareReplay
the first value that subsequent subscriptions will get is the first value of a new subscription to the source sequence. With cacheLast
the first value will be the last value of the previous subscription.
Signature:
export declare function cacheLast<T>(aEqualFunction?: EqualsPredicate<T>, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
Parameters
Parameter | Type | Description |
---|
aEqualFunction | EqualsPredicate<T> | compares the subsequent value |
scheduler | SchedulerLike | optional scheduler |
Returns:
MonoTypeOperatorFunction<T>
the cached operator
Home > @acoustic-content-sdk/utils > chunkArray
chunkArray() function
Splits the array into even chunks
Signature:
export declare function chunkArray<T>(aArray: ArrayLike<T> | null | undefined, aSize: number): T[][];
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | null | undefined | the array |
aSize | number | |
Returns:
T[][]
the result array
Home > @acoustic-content-sdk/utils > clientStorageFromWindow
clientStorageFromWindow() function
Returns our storage object from the window
Signature:
export declare function clientStorageFromWindow(aScope: string, aWindow?: Window): ClientStorage;
Parameters
Parameter | Type | Description |
---|
aScope | string | the scope |
aWindow | Window | the optional window |
Returns:
ClientStorage
the storage object
Home > @acoustic-content-sdk/utils > cloneDeep
cloneDeep() function
Performs a deep clone for the value, supports just plain objects and arrays
Signature:
declare function _cloneDeep(aValue: any): any;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to clone |
Returns:
any
the cloned object
Home > @acoustic-content-sdk/utils > cloneUrlConfig
cloneUrlConfig() function
Constructs a clone
Signature:
export declare function cloneUrlConfig(aUrlConfig: UrlConfig): UrlConfig;
Parameters
Parameter | Type | Description |
---|
aUrlConfig | UrlConfig | the URL config |
Returns:
UrlConfig
the clone
Home > @acoustic-content-sdk/utils > createDeliveryContentItem
createDeliveryContentItem() function
Converts a v1 delivery item structure into a simplified structure
Signature:
export declare function createDeliveryContentItem(aItem: ContentItemWithLayout): DeliveryContentItem;
Parameters
Parameter | Type | Description |
---|
aItem | ContentItemWithLayout | the item to convert |
Returns:
DeliveryContentItem
the same item in the simplified structure
Home > @acoustic-content-sdk/utils > createDeliveryContentItemWithMetadata
createDeliveryContentItemWithMetadata() function
Merges metadata into each level
Signature:
export declare function createDeliveryContentItemWithMetadata(aItem: DeliveryContentItem): DeliveryContentItem;
Parameters
Parameter | Type | Description |
---|
aItem | DeliveryContentItem | the item |
Returns:
DeliveryContentItem
the augmented item
Home > @acoustic-content-sdk/utils > createError
createError() function
Signature:
export declare function createError(aMessage: string, aCause?: Error): Error;
Parameters
Parameter | Type | Description |
---|
aMessage | string | |
aCause | Error | |
Returns:
Error
Home > @acoustic-content-sdk/utils > createGetter
createGetter() function
Constructs a getter description
Signature:
declare function _createGetter<T>(aGetter: Generator<T>): PropertyDescriptor;
Parameters
Parameter | Type | Description |
---|
aGetter | Generator<T> | the getter |
Returns:
PropertyDescriptor
the description of the getter
Home > @acoustic-content-sdk/utils > createGetterOnObservable
createGetterOnObservable() function
Constructs a getter description
Signature:
declare function _createGetter<T>(aObservable: Observable<T>, aInitial?: T): PropertyDescriptor;
Parameters
Parameter | Type | Description |
---|
aObservable | Observable<T> | the observable that handles the getter events |
aInitial | T | a potential initial value |
Returns:
PropertyDescriptor
the description of the getter
Home > @acoustic-content-sdk/utils > createLoggerService
createLoggerService() function
Constructs a logger service on the basis of a logger factory. The service makes sure not to create the same logger multiple times
Signature:
export declare function createLoggerService(aLoggerFactory: LoggerFactory): LoggerService;
Parameters
Parameter | Type | Description |
---|
aLoggerFactory | LoggerFactory | the factory |
Returns:
LoggerService
the service
Home > @acoustic-content-sdk/utils > createMarkupRendererV2
createMarkupRendererV2() function
Constructs a new renderer that applies a handlebars transform to produce rendered markup. The markup will be kept current whenever any of the underlying data changes.
Signature:
export declare function createMarkupRendererV2(aDeliveryContent: UnaryFunction<string, Observable<DeliveryContentItem>>, aAuthoringType: UnaryFunction<string, Observable<AuthoringType>>, aLayoutMapping: UnaryFunction<string, Observable<AuthoringLayoutMapping>>, aLayout: UnaryFunction<string, Observable<Layout>>, aMarkupTemplate: UnaryFunction<string, Observable<MarkupTemplate>>, aExtendedContext$: Observable<ExtendedContextV2>, aLoggerService: LoggerService, aScheduler?: SchedulerLike): (aId: string, aLayoutMode?: string) => Observable<string>;
Parameters
Parameter | Type | Description |
---|
aDeliveryContent | UnaryFunction<string, Observable<DeliveryContentItem>> | callback function to load a content item by id |
aAuthoringType | UnaryFunction<string, Observable<AuthoringType>> | callback function to load the type by id |
aLayoutMapping | UnaryFunction<string, Observable<AuthoringLayoutMapping>> | callback function to load the layout mapping given a type id |
aLayout | UnaryFunction<string, Observable<Layout>> | callback function to load the layout by id |
aMarkupTemplate | UnaryFunction<string, Observable<MarkupTemplate>> | callback function to load the markup template from the delivery content item |
aExtendedContext$ | Observable<ExtendedContextV2> | the extended context |
aLoggerService | LoggerService | optional logger service |
aScheduler | SchedulerLike | optional scheduler |
Returns:
(aId: string, aLayoutMode?: string) => Observable<string>
a function that maps from content item ID to an obervable of the rendered markup
Home > @acoustic-content-sdk/utils > createMessageHandler
createMessageHandler() function
Constructs an event listener that listens for messages
Signature:
declare function _createMessageHandler(aCorsWhitelist: Generator<PromiseLike<string[]>>, aMsgHandlers: Generator<SdkMessageHandler[]>, aLogger?: Logger): (aEvent: MessageEvent) => void;
Parameters
Parameter | Type | Description |
---|
aCorsWhitelist | Generator<PromiseLike<string[]>> | generator that produces a CORS whitelist |
aMsgHandlers | Generator<SdkMessageHandler[]> | generator that enumerates the set of registered message handlers |
aLogger | Logger | |
Returns:
(aEvent: MessageEvent) => void
the listener that can be attached to the window object
Home > @acoustic-content-sdk/utils > createNavigateByPathHandler
createNavigateByPathHandler() function
Executes a navigation event
Signature:
export declare function createNavigateByPathHandler(aNavigate: (aPath: string) => PromiseLike<boolean>, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
aNavigate | (aPath: string) => PromiseLike<boolean> | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createRefreshHandler
createRefreshHandler() function
Executes a refresh event
Signature:
export declare function createRefreshHandler(aRefresh: () => any, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
aRefresh | () => any | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createSetModeHandler
createSetModeHandler() function
Executes a navigation event
Signature:
export declare function createSetModeHandler(aPublicApiHandler: Consumer<boolean>, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
aPublicApiHandler | Consumer<boolean> | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createSetterOnSubject
createSetterOnSubject() function
Constructs a setter description
Signature:
declare function _createSetter<T>(aSubject: Subject<T>): PropertyDescriptor;
Parameters
Parameter | Type | Description |
---|
aSubject | Subject<T> | the subject that handles the setter events |
Returns:
PropertyDescriptor
the description of the setter
Home > @acoustic-content-sdk/utils > createSubscribeActiveRouteHandler
createSubscribeActiveRouteHandler() function
Subscribes to the active route
Signature:
export declare function createSubscribeActiveRouteHandler(onActiveRenderingContext: Observable<RenderingContextV2>, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
onActiveRenderingContext | Observable<RenderingContextV2> | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createSubscribeModeHandler
createSubscribeModeHandler() function
Subscribes to the active route
Signature:
export declare function createSubscribeModeHandler(onUsePublic: Observable<boolean>, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
onUsePublic | Observable<boolean> | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createSubscribeRouteHandler
createSubscribeRouteHandler() function
Subscribes to a given route
Signature:
export declare function createSubscribeRouteHandler(aGetRenderingContextByPath: (aPath: string) => Observable<RenderingContextV2>, aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
aGetRenderingContextByPath | (aPath: string) => Observable<RenderingContextV2> | |
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > createUnsubscribeHandler
createUnsubscribeHandler() function
Subscribes to a given route
Signature:
export declare function createUnsubscribeHandler(aLogger?: Logger): SdkMessageHandlerCallback;
Parameters
Parameter | Type | Description |
---|
aLogger | Logger | |
Returns:
SdkMessageHandlerCallback
Home > @acoustic-content-sdk/utils > dbgAddSource
dbgAddSource() function
Adds source information
Signature:
declare function _addSourceDebug<T>(aSource: string, aObject: T | null | undefined): T;
Parameters
Parameter | Type | Description |
---|
aSource | string | source info |
aObject | T | null | undefined | the object |
Returns:
T
the original object
Home > @acoustic-content-sdk/utils > dbgCounter
dbgCounter() function
Signature:
declare function _getCounter(): number;
Returns:
number
Home > @acoustic-content-sdk/utils > filterArray
filterArray() function
Filters an array
Signature:
export declare function filterArray<T>(aArray: ArrayLike<T>, aPredicate: Predicate<T>): T[];
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | the array |
aPredicate | Predicate<T> | the predicate function |
Returns:
T[]
the result array
Home > @acoustic-content-sdk/utils > flattenArray
flattenArray() function
Signature:
export declare function flattenArray<T>(aArray: T[][]): T[];
Parameters
Parameter | Type | Description |
---|
aArray | T[][] | |
Returns:
T[]
Home > @acoustic-content-sdk/utils > forEach
forEach() function
Just run a callback for each element in an array
Signature:
export declare function forEach<T>(aArray: ArrayLike<T> | null | undefined, aConsumer: Consumer<T>): void;
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | null | undefined | the array |
aConsumer | Consumer<T> | consumer callback |
Returns:
void
Home > @acoustic-content-sdk/utils > forIn
forIn() function
Run a callback for each key value pair
Signature:
export declare function forIn<T>(aObject: Record<string, T> | null | undefined, aConsumer: BiConsumer<T, string>): void;
Parameters
Parameter | Type | Description |
---|
aObject | Record<string, T> | null | undefined | the object |
aConsumer | BiConsumer<T, string> | consumer callback |
Returns:
void
Home > @acoustic-content-sdk/utils > fromObservableOrT
fromObservableOrT() function
Converts the generic type into an observable of the desired type
Signature:
export declare function fromObservableOrT<T>(aValue: ObservableOrT<T>): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aValue | ObservableOrT<T> | the generic type |
Returns:
Observable<T>
observable of the desired type
Home > @acoustic-content-sdk/utils > generateItem
generateItem() function
Creates an observable that exposes the result of the function call if the result is defined. Otherwise this is an empty sequence.
Signature:
declare function _generateItem<T>(aGenerator: Generator<T>): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aGenerator | Generator<T> | the generator function |
Returns:
Observable<T>
observable of the result
Home > @acoustic-content-sdk/utils > getAuthoringConfigElements
getAuthoringConfigElements() function
Returns the authoring config elements
Signature:
export declare function getAuthoringConfigElements(aType: AuthoringType): AuthoringElement[];
Parameters
Parameter | Type | Description |
---|
aType | AuthoringType | the type |
Returns:
AuthoringElement[]
those elements on the type that are config elements
Home > @acoustic-content-sdk/utils > getAuthoringContentElements
getAuthoringContentElements() function
Returns the authoring content elements
Signature:
export declare function getAuthoringContentElements(aType: AuthoringType): AuthoringElement[];
Parameters
Parameter | Type | Description |
---|
aType | AuthoringType | the types |
Returns:
AuthoringElement[]
those elements on the type that are content elements
Home > @acoustic-content-sdk/utils > getBaseUrlFromDocument
getBaseUrlFromDocument() function
Extracts the base URL from the current document
Signature:
declare function _getBaseUrlFromDocument(aDoc?: Document, aWindow?: Window): URL | undefined;
Parameters
Parameter | Type | Description |
---|
aDoc | Document | the document |
aWindow | Window | |
Returns:
URL | undefined
the URL
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
Home > @acoustic-content-sdk/utils > getBaseUrlFromWindow
getBaseUrlFromWindow() function
Returns a base URL from the window
Signature:
declare function _getBaseUrlFromWindow(aWindow?: Window, aDocument?: Document): URL | undefined;
Parameters
Parameter | Type | Description |
---|
aWindow | Window | the optional window object |
aDocument | Document | the document object |
Returns:
URL | undefined
the base URL
Home > @acoustic-content-sdk/utils > getItemStatus
getItemStatus() function
Decodes the item status from the rendering context. This can e.g. be used to display status icons
Signature:
export declare function getItemStatus(aRenderingContext: RenderingContext): ItemStatus;
Parameters
Parameter | Type | Description |
---|
aRenderingContext | RenderingContext | the rendering context |
Returns:
ItemStatus
the item status
Home > @acoustic-content-sdk/utils > getLinksByRel
getLinksByRel() function
Returns all links in the document, ordered by rel
Signature:
declare function _getLinksByRel(aDocument?: Document, aWindow?: Window): Record<string, string>;
Parameters
Parameter | Type | Description |
---|
aDocument | Document | |
aWindow | Window | |
Returns:
Record<string, string>
Home > @acoustic-content-sdk/utils > getOrigin
getOrigin() function
Returns the orign from the doc
Signature:
export declare function getOrigin(aDoc?: Document, aWindow?: Window): string;
Parameters
Parameter | Type | Description |
---|
aDoc | Document | document |
aWindow | Window | window |
Returns:
string
the origin
Home > @acoustic-content-sdk/utils > hashString
hashString() function
Signature:
declare function _hashString(oldHash: number, s: string): number;
Parameters
Parameter | Type | Description |
---|
oldHash | number | |
s | string | |
Returns:
number
Home > @acoustic-content-sdk/utils > httpCreateTimer
httpCreateTimer() function
Creates a timer that fires at a randomly chosen interval as soon as subscribed to it
Signature:
declare function _createTimer(aOptions?: HttpResourceOptions): Observable<any>;
Parameters
Parameter | Type | Description |
---|
aOptions | HttpResourceOptions | the resource configuration options |
Returns:
Observable<any>
the observable
Home > @acoustic-content-sdk/utils > httpGetJsonResource
httpGetJsonResource() function
Signature:
declare function _getJsonResource(aURL: string, aHttpService: HttpService, aWithCredentials: boolean, aTrigger: Observable<any>, aOptions?: HttpResourceOptions, aLogger?: Logger): Observable<JSONValue>;
Parameters
Parameter | Type | Description |
---|
aURL | string | |
aHttpService | HttpService | |
aWithCredentials | boolean | |
aTrigger | Observable<any> | |
aOptions | HttpResourceOptions | |
aLogger | Logger | |
Returns:
Observable<JSONValue>
Home > @acoustic-content-sdk/utils > httpGetStringResource
httpGetStringResource() function
Represents an HTTP request, potentially made via the cache
Signature:
declare function _getStringResource(aURL: string, aHttpService: HttpService, aWithCredentials: boolean, aTrigger: Observable<any>, aOptions: HttpResourceOptions, aLogger?: Logger): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aURL | string | |
aHttpService | HttpService | |
aWithCredentials | boolean | |
aTrigger | Observable<any> | |
aOptions | HttpResourceOptions | |
aLogger | Logger | |
Returns:
Observable<string>
Home > @acoustic-content-sdk/utils > isArrayLikeOf
isArrayLikeOf() function
Tests if all elements of the array are of a particular type
Signature:
declare function _isArrayLikeOf<T>(aValue: any, aPredicate: IsPredicate<T>): aValue is ArrayLike<T>;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
aPredicate | IsPredicate<T> | the predicate to test each element with |
Returns:
aValue is ArrayLike<T>
true if the value is an array and all elements are of the specific type
Home > @acoustic-content-sdk/utils > isArrayOf
isArrayOf() function
Tests if all elements of the array are of a particular type
Signature:
declare function _isArrayOf<T>(aValue: any, aPredicate: IsPredicate<T>): aValue is T[];
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
aPredicate | IsPredicate<T> | the predicate to test each element with |
Returns:
aValue is T[]
true if the value is an array and all elements are of the specific type
Home > @acoustic-content-sdk/utils > isAuthoringConfigElement
isAuthoringConfigElement() function
Checks if an element is a config element
Signature:
export declare function isAuthoringConfigElement(aElement: AuthoringElement): boolean;
Parameters
Parameter | Type | Description |
---|
aElement | AuthoringElement | the element to check |
Returns:
boolean
true if the element has the configuration
Home > @acoustic-content-sdk/utils > isAuthoringContentElement
isAuthoringContentElement() function
Checks if an element is a content element
Signature:
export declare function isAuthoringContentElement(aElement: AuthoringElement): boolean;
Parameters
Parameter | Type | Description |
---|
aElement | AuthoringElement | the element to check |
Returns:
boolean
true if the element has the configuration
Home > @acoustic-content-sdk/utils > isAuthoringGroup
isAuthoringGroup() function
Signature:
export declare function isAuthoringGroup<T>(value: any): value is AuthoringGroup<T>;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringGroup<T>
Home > @acoustic-content-sdk/utils > isAuthoringGroupElement
isAuthoringGroupElement() function
Tests if a field is a content type
Signature:
export declare function isAuthoringGroupElement(aValue: any): aValue is AuthoringGroupElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to check |
Returns:
aValue is AuthoringGroupElement
true if this value is an authoring type
Home > @acoustic-content-sdk/utils > isAuthoringImage
isAuthoringImage() function
Signature:
export declare function isAuthoringImage(value: any): value is AuthoringImage;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringImage
Home > @acoustic-content-sdk/utils > isAuthoringReference
isAuthoringReference() function
Signature:
export declare function isAuthoringReference(value: any): value is AuthoringReference;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringReference
Home > @acoustic-content-sdk/utils > isAuthoringReferenceValue
isAuthoringReferenceValue() function
Signature:
export declare function isAuthoringReferenceValue(value: any): value is AuthoringReferenceValue;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringReferenceValue
Home > @acoustic-content-sdk/utils > isAuthoringText
isAuthoringText() function
Signature:
export declare function isAuthoringText(value: any): value is AuthoringText;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringText
Home > @acoustic-content-sdk/utils > isAuthoringVideo
isAuthoringVideo() function
Signature:
export declare function isAuthoringVideo(value: any): value is AuthoringVideo;
Parameters
Parameter | Type | Description |
---|
value | any | |
Returns:
value is AuthoringVideo
Home > @acoustic-content-sdk/utils > isCategory
isCategory() function
Signature:
declare function _isCategory(aValue: any, bOptional?: boolean): aValue is Category;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
bOptional | boolean | |
Returns:
aValue is Category
Home > @acoustic-content-sdk/utils > isCategoryElement
isCategoryElement() function
Tests if an element is a category element
Signature:
declare function _isCategoryElement(aValue: any, bOptional?: boolean): aValue is CategoryElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is CategoryElement
the type assertion
Home > @acoustic-content-sdk/utils > isDate
isDate() function
Tests if a value is a date
Signature:
declare function _isDate(aValue: any): aValue is Date;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value |
Returns:
aValue is Date
true if the value is date, else false
Home > @acoustic-content-sdk/utils > isDateElement
isDateElement() function
Tests if an element is a date element
Signature:
declare function _isDateElement(aValue: any): aValue is DateElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is DateElement
the type assertion
Home > @acoustic-content-sdk/utils > isDeliveryReferenceElement
isDeliveryReferenceElement() function
Tests if a value is a delivery reference element
Signature:
export declare function isDeliveryReferenceElement(aValue: any): aValue is DeliveryReferenceElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | value to test |
Returns:
aValue is DeliveryReferenceElement
true if the value is a reference element
Home > @acoustic-content-sdk/utils > isElement
isElement() function
Tests if the value is a value element
Signature:
declare function _isElement(aValue: any, bOptional?: boolean): aValue is Element;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value |
bOptional | boolean | |
Returns:
aValue is Element
true if the value is a valid element
Home > @acoustic-content-sdk/utils > isElementType
isElementType() function
Tests if the value is a valid element type
Signature:
declare function _isElementType(aValue: any): aValue is ELEMENT_TYPE;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value |
Returns:
aValue is ELEMENT_TYPE
true if the element is a valid type
Home > @acoustic-content-sdk/utils > isEqual
isEqual() function
Signature:
export declare function isEqual<T>(aLeft: T, aRight: T): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | T | |
aRight | T | |
Returns:
boolean
Home > @acoustic-content-sdk/utils > isErrorResponse
isErrorResponse() function
Tests if a response is an error response
Signature:
export declare function isErrorResponse(aResponse: any): aResponse is ErrorResponse;
Parameters
Parameter | Type | Description |
---|
aResponse | any | the response object |
Returns:
aResponse is ErrorResponse
true if the response is an error response, else false
Home > @acoustic-content-sdk/utils > isFile
isFile() function
Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL.
Signature:
declare function _isFile(aValue: any, bOptional?: boolean): aValue is File;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to check |
bOptional | boolean | flag to test if the video is optional |
Returns:
aValue is File
true if we have an video, else false
Home > @acoustic-content-sdk/utils > isFileElement
isFileElement() function
Tests if an element is a file element
Signature:
declare function _isFileElement(aValue: any): aValue is FileElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is FileElement
the type assertion
Home > @acoustic-content-sdk/utils > isFormattedTextElement
isFormattedTextElement() function
Tests if an element is a text element
Signature:
declare function _isFormattedTextElement(aValue: any): aValue is FormattedTextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is FormattedTextElement
the type assertion
Home > @acoustic-content-sdk/utils > isGroupElement
isGroupElement() function
Tests if an element is a Group element
Signature:
declare function _isGroupElement(aValue: any, bOptional?: boolean): aValue is GroupElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is GroupElement
the type assertion
Home > @acoustic-content-sdk/utils > isImage
isImage() function
Tests if an element is an image. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL.
Signature:
declare function _isImage(aValue: any, bOptional?: boolean): aValue is Image;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to check |
bOptional | boolean | flag to test if the image is optional |
Returns:
aValue is Image
true if we have an image, else false
Home > @acoustic-content-sdk/utils > isImageElement
isImageElement() function
Tests if an element is an image element
Signature:
declare function _isImageElement(aValue: any): aValue is ImageElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is ImageElement
the type assertion
Home > @acoustic-content-sdk/utils > isLink
isLink() function
Tests if we have a link element. We consider the element to exist if it has at least one of its fields set.
Signature:
declare function _isLink(aValue: any, bOptional?: boolean): aValue is Link;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value |
bOptional | boolean | flag to test if the asset is optional |
Returns:
aValue is Link
true if the element is a link
Home > @acoustic-content-sdk/utils > isLinkElement
isLinkElement() function
Tests if an element is a link element
Signature:
declare function _isLinkElement(aValue: any): aValue is LinkElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is LinkElement
the type assertion
Home > @acoustic-content-sdk/utils > isLocalizedText
isLocalizedText() function
Tests if a value is a localized context
Signature:
export declare function isLocalizedText(aText: any): aText is LocalizedText;
Parameters
Parameter | Type | Description |
---|
aText | any | text to check |
Returns:
aText is LocalizedText
true if the text is a localized context, else false
Home > @acoustic-content-sdk/utils > isLocation
isLocation() function
Signature:
declare function _isLocation(aValue: any, bOptional?: boolean): aValue is Location;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
bOptional | boolean | |
Returns:
aValue is Location
Home > @acoustic-content-sdk/utils > isLocationElement
isLocationElement() function
Tests if an element is a location element
Signature:
declare function _isLocationElement(aValue: any, bOptional?: boolean): aValue is LocationElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is LocationElement
the type assertion
Home > @acoustic-content-sdk/utils > isMetadata
isMetadata() function
Tests if the object is valid metadata
Signature:
export declare function isMetadata(aValue: any): aValue is DeliveryContentMetadata;
Parameters
Parameter | Type | Description |
---|
aValue | any | value to check |
Returns:
aValue is DeliveryContentMetadata
true if the value is metadata
Home > @acoustic-content-sdk/utils > isMultiDateElement
isMultiDateElement() function
Tests if an element is a text element
Signature:
declare function _isMultiDateElement(aValue: any, bOptional?: boolean): aValue is MultiDateElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiDateElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiFileElement
isMultiFileElement() function
Tests if an element is a file element
Signature:
declare function _isMultiFileElement(aValue: any, bOptional?: boolean): aValue is MultiFileElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiFileElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiFormattedTextElement
isMultiFormattedTextElement() function
Tests if an element is a text element
Signature:
declare function _isMultiFormattedTextElement(aValue: any, bOptional?: boolean): aValue is MultiFormattedTextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiFormattedTextElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiGroupElement
isMultiGroupElement() function
Tests if an element is a Group element
Signature:
declare function _isMultiGroupElement(aValue: any, bOptional?: boolean): aValue is MultiGroupElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiGroupElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiImageElement
isMultiImageElement() function
Tests if an element is an image element
Signature:
declare function _isMultiImageElement(aValue: any, bOptional?: boolean): aValue is MultiImageElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiImageElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiLinkElement
isMultiLinkElement() function
Tests if an element is an image element
Signature:
declare function _isMultiLinkElement(aValue: any, bOptional?: boolean): aValue is MultiLinkElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiLinkElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiNumberElement
isMultiNumberElement() function
Tests if an element is a number element
Signature:
declare function _isMultiNumberElement(aValue: any, bOptional?: boolean): aValue is MultiNumberElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiNumberElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiOptionSelectionElement
isMultiOptionSelectionElement() function
Tests if an element is an option selection element
Signature:
declare function _isMultiOptionSelectionElement(aValue: any, bOptional?: boolean): aValue is MultiOptionSelectionElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiOptionSelectionElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiProductElement
isMultiProductElement() function
Tests if an element is a text element
Signature:
declare function _isMultiProductElement(aValue: any, bOptional?: boolean): aValue is MultiProductElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiProductElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiReferenceElement
isMultiReferenceElement() function
Tests if an element is a reference element
Signature:
declare function _isMultiReferenceElement(aValue: any, bOptional?: boolean): aValue is MultiReferenceElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiReferenceElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiTextElement
isMultiTextElement() function
Tests if an element is a text element
Signature:
declare function _isMultiTextElement(aValue: any, bOptional?: boolean): aValue is MultiTextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiTextElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiToggleElement
isMultiToggleElement() function
Tests if an element is a toggle element
Signature:
declare function _isMultiToggleElement(aValue: any, bOptional?: boolean): aValue is MultiToggleElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiToggleElement
the type assertion
Home > @acoustic-content-sdk/utils > isMultiVideoElement
isMultiVideoElement() function
Tests if an element is an image element
Signature:
declare function _isMultiVideoElement(aValue: any, bOptional?: boolean): aValue is MultiVideoElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is MultiVideoElement
the type assertion
Home > @acoustic-content-sdk/utils > isNumberElement
isNumberElement() function
Tests if an element is a number element
Signature:
declare function _isNumberElement(aValue: any): aValue is NumberElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is NumberElement
the type assertion
Home > @acoustic-content-sdk/utils > isObjectOf
isObjectOf() function
Tests if all fields of an object are of a particular type
Signature:
declare function _isObjectOf<T>(aValue: any, aPredicate: IsPredicate<T>): aValue is {
[key: string]: T;
};
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
aPredicate | IsPredicate<T> | the predicate to test each element with |
Returns:
aValue is { [key: string]: T; }
true if the value is an array and all elements are of the specific type
Home > @acoustic-content-sdk/utils > isOptional
isOptional() function
Signature:
export declare function isOptional<T>(aValue: any, aPredicate: IsPredicate<T>): aValue is T;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
aPredicate | IsPredicate<T> | |
Returns:
aValue is T
Home > @acoustic-content-sdk/utils > isOptionalArrayOf
isOptionalArrayOf() function
Signature:
export declare function isOptionalArrayOf<T>(aValue: any, aPredicate: IsPredicate<T>): aValue is T[];
Parameters
Parameter | Type | Description |
---|
aValue | any | |
aPredicate | IsPredicate<T> | |
Returns:
aValue is T[]
Home > @acoustic-content-sdk/utils > isOptionSelectionElement
isOptionSelectionElement() function
Tests if an element is an option selection element
Signature:
declare function _isOptionSelectionElement(aValue: any): aValue is OptionSelectionElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is OptionSelectionElement
the type assertion
Home > @acoustic-content-sdk/utils > isPlainObject
isPlainObject() function
Tests for a plain object
Signature:
declare function _isPlainObject(aObject: any): aObject is object;
Parameters
Parameter | Type | Description |
---|
aObject | any | the object to test |
Returns:
aObject is object
Home > @acoustic-content-sdk/utils > isProductElement
isProductElement() function
Signature:
declare function _isProductElement(aValue: any): aValue is ProductElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
Returns:
aValue is ProductElement
Home > @acoustic-content-sdk/utils > isReferenceElement
isReferenceElement() function
Tests if an element is a reference element
Signature:
declare function _isReferenceElement(aValue: any): aValue is ReferenceElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is ReferenceElement
the type assertion
Home > @acoustic-content-sdk/utils > isRenderingContextProvider
isRenderingContextProvider() function
Tests is an object is a rendering context provider
Signature:
export declare function isRenderingContextProvider(aValue: any): aValue is RenderingContextProvider;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
Returns:
aValue is RenderingContextProvider
true if the object is rendering context, else false
Home > @acoustic-content-sdk/utils > isRenderingContextV2
isRenderingContextV2() function
Tests if the object is a valid rendering context
Signature:
export declare function isRenderingContextV2(aValue: any): aValue is RenderingContextV2;
Parameters
Parameter | Type | Description |
---|
aValue | any | value to check |
Returns:
aValue is RenderingContextV2
true if the value is a rendering context
Home > @acoustic-content-sdk/utils > isSingleDateElement
isSingleDateElement() function
Tests if an element is a date element
Signature:
declare function _isSingleDateElement(aValue: any, bOptional?: boolean): aValue is SingleDateElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleDateElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleFileElement
isSingleFileElement() function
Tests if an element is a file element
Signature:
declare function _isSingleFileElement(aValue: any, bOptional?: boolean): aValue is SingleFileElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleFileElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleFormattedTextElement
isSingleFormattedTextElement() function
Tests if an element is a text element
Signature:
declare function _isSingleFormattedTextElement(aValue: any, bOptional?: boolean): aValue is SingleFormattedTextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleFormattedTextElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleGroupElement
isSingleGroupElement() function
Tests if an element is a Group element
Signature:
declare function _isSingleGroupElement(aValue: any, bOptional?: boolean): aValue is SingleGroupElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleGroupElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleImageElement
isSingleImageElement() function
Tests if an element is an image element
Signature:
declare function _isSingleImageElement(aValue: any, bOptional?: boolean): aValue is SingleImageElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleImageElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleLinkElement
isSingleLinkElement() function
Tests if an element is an image element
Signature:
declare function _isSingleLinkElement(aValue: any, bOptional?: boolean): aValue is SingleLinkElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleLinkElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleNumberElement
isSingleNumberElement() function
Tests if an element is a number element
Signature:
declare function _isSingleNumberElement(aValue: any, bOptional?: boolean): aValue is SingleNumberElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleNumberElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleOptionSelectionElement
isSingleOptionSelectionElement() function
Tests if an element is an option selection element
Signature:
declare function _isSingleOptionSelectionElement(aValue: any, bOptional?: boolean): aValue is SingleOptionSelectionElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleOptionSelectionElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleProductElement
isSingleProductElement() function
Tests if an element is a text element
Signature:
declare function _isSingleProductElement(aValue: any, bOptional?: boolean): aValue is SingleProductElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleProductElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleReferenceElement
isSingleReferenceElement() function
Tests if an element is a reference element
Signature:
declare function _isSingleReferenceElement(aValue: any, bOptional?: boolean): aValue is SingleReferenceElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleReferenceElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleTextElement
isSingleTextElement() function
Tests if an element is a text element
Signature:
declare function _isSingleTextElement(aValue: any, bOptional?: boolean): aValue is SingleTextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleTextElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleToggleElement
isSingleToggleElement() function
Tests if an element is a toggle element
Signature:
declare function _isSingleToggleElement(aValue: any, bOptional?: boolean): aValue is SingleToggleElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleToggleElement
the type assertion
Home > @acoustic-content-sdk/utils > isSingleVideoElement
isSingleVideoElement() function
Tests if an element is an image element
Signature:
declare function _isSingleVideoElement(aValue: any, bOptional?: boolean): aValue is SingleVideoElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is SingleVideoElement
the type assertion
Home > @acoustic-content-sdk/utils > isTextElement
isTextElement() function
Tests if an element is a text element
Signature:
declare function _isTextElement(aValue: any): aValue is TextElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is TextElement
the type assertion
Home > @acoustic-content-sdk/utils > isToggleElement
isToggleElement() function
Tests if an element is a toggle element
Signature:
declare function _isToggleElement(aValue: any, bOptional?: boolean): aValue is ToggleElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
bOptional | boolean | |
Returns:
aValue is ToggleElement
the type assertion
Home > @acoustic-content-sdk/utils > isURL
isURL() function
Signature:
export declare function isURL(aValue: any): aValue is URL;
Parameters
Parameter | Type | Description |
---|
aValue | any | |
Returns:
aValue is URL
Home > @acoustic-content-sdk/utils > isUrlConfig
isUrlConfig() function
Tests if a value is a valid url config object
Signature:
export declare function isUrlConfig(aValue: any): aValue is UrlConfig;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to check |
Returns:
aValue is UrlConfig
true if the value is a url config
Home > @acoustic-content-sdk/utils > isValueOf
isValueOf() function
Tests if the value is a value element
Signature:
declare function _isValueOf(aType: string, aValue: any, bOptional?: boolean): boolean;
Parameters
Parameter | Type | Description |
---|
aType | string | |
aValue | any | the value |
bOptional | boolean | |
Returns:
boolean
true if the value is a valid element
Home > @acoustic-content-sdk/utils > isVideo
isVideo() function
Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL.
Signature:
declare function _isVideo(aValue: any, bOptional?: boolean): aValue is Video;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to check |
bOptional | boolean | flag to test if the video is optional |
Returns:
aValue is Video
true if we have an video, else false
Home > @acoustic-content-sdk/utils > isVideoElement
isVideoElement() function
Tests if an element is a video element
Signature:
declare function _isVideoElement(aValue: any): aValue is VideoElement;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value to test |
Returns:
aValue is VideoElement
the type assertion
Home > @acoustic-content-sdk/utils > kebabCase
kebabCase() function
Signature:
export declare function kebabCase(str: string): string;
Parameters
Parameter | Type | Description |
---|
str | string | |
Returns:
string
Home > @acoustic-content-sdk/utils > logModule
logModule() function
Logs version information for a module
Signature:
export declare function logModule(aVersion: WchSdkVersion, aModule: string, aLogSvc?: LoggerService): void;
Parameters
Parameter | Type | Description |
---|
aVersion | WchSdkVersion | the version |
aModule | string | the module |
aLogSvc | LoggerService | the logger service |
Returns:
void
Home > @acoustic-content-sdk/utils > longHash
longHash() function
Returns an initial value for the hash code
Signature:
declare function _longHash(): number;
Returns:
number
the initial value
Home > @acoustic-content-sdk/utils > luceneEscapeKeyValue
luceneEscapeKeyValue() function
Generates a search selector and escapes the value. If the value is missing the method generates an expression that searches for missing values.
Signature:
declare function _escapeKeyValue(aKey: string, aTerm: string | null | undefined): string;
Parameters
Parameter | Type | Description |
---|
aKey | string | the search key |
aTerm | string | null | undefined | the unescaped value |
Returns:
string
the result of the escaping
Home > @acoustic-content-sdk/utils > luceneEscapeKeyValueAnd
luceneEscapeKeyValueAnd() function
Generates a selector and joins with 'AND'
Signature:
declare function _escapeKeyValueAnd(aKey: string, ...aTerms: string[]): string;
Parameters
Parameter | Type | Description |
---|
aKey | string | the search key |
aTerms | string[] | the unescaped value |
Returns:
string
the result of the escaping
Home > @acoustic-content-sdk/utils > luceneEscapeKeyValueOr
luceneEscapeKeyValueOr() function
Generates a selector and joins with 'OR'
Signature:
declare function _escapeKeyValueOr(aKey: string, ...aTerms: string[]): string;
Parameters
Parameter | Type | Description |
---|
aKey | string | the search key |
aTerms | string[] | the unescaped value |
Returns:
string
the result of the escaping
Home > @acoustic-content-sdk/utils > luceneEscapeTerm
luceneEscapeTerm() function
Escapes a term according to lucence syntax
Signature:
declare function _escapeTerm(aTerm: string): string;
Parameters
Parameter | Type | Description |
---|
aTerm | string | |
Returns:
string
Home > @acoustic-content-sdk/utils > mapArray
mapArray() function
Maps every value in an array
Signature:
export declare function mapArray<T, R>(aArray: ArrayLike<T> | null | undefined, aMapper: UnaryFunction<T, R>): R[];
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | null | undefined | the array |
aMapper | UnaryFunction<T, R> | the mapper function |
Returns:
R[]
the result array
Home > @acoustic-content-sdk/utils > mergeObjects
mergeObjects() function
Merge objects together and consider undefined or empty objects as not overridable
Signature:
declare function _mergeObjects<T>(aLeft: T, aRight: T): T;
Parameters
Parameter | Type | Description |
---|
aLeft | T | the left object |
aRight | T | the right object |
Returns:
T
the resulting object
Home > @acoustic-content-sdk/utils > nary
nary() function
Implements a wrapper function that limits the arguments to the given size
Signature:
declare function _nary(aArity: number, aFunction: (...aValues: any[]) => any): (...aValues: any[]) => any;
Parameters
Parameter | Type | Description |
---|
aArity | number | the arity, i.e. the maximum number of supported arguments |
aFunction | (...aValues: any[]) => any | the function |
Returns:
(...aValues: any[]) => any
the limited function
Home > @acoustic-content-sdk/utils > pageArrayEquals
pageArrayEquals() function
Tests if two page arrays are equal
Signature:
declare function _pageArrayEquals(aLeft: DeliveryContentItem[], aRight: DeliveryContentItem[]): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | DeliveryContentItem[] | left page |
aRight | DeliveryContentItem[] | right page |
Returns:
boolean
true if the pages are equal, else false
Home > @acoustic-content-sdk/utils > pageCloneSitePage
pageCloneSitePage() function
Performs a shallow clone of a site page
Signature:
declare function _cloneSitePage(aSitePage: SitePage): SitePage;
Parameters
Parameter | Type | Description |
---|
aSitePage | SitePage | the site page |
Returns:
SitePage
the cloned page
Home > @acoustic-content-sdk/utils > pageCreatePartialSiteContextForSitePage
pageCreatePartialSiteContextForSitePage() function
Returns the partial rendering context for a site page
Signature:
declare function _createPartialSiteContextForSitePage(aPage: SitePage, aSite: Site): SiteContext;
Parameters
Parameter | Type | Description |
---|
aPage | SitePage | the site page |
aSite | Site | the site |
Returns:
SiteContext
the context
Home > @acoustic-content-sdk/utils > pageCreateSiteContextFromSearchResult
pageCreateSiteContextFromSearchResult() function
Decomposes a search result into a site context structure
Signature:
declare function _createSiteContextFromSearchResult(aPage: SitePage, aSearchResult: SitePage[], aSite: Site): SiteContext;
Parameters
Parameter | Type | Description |
---|
aPage | SitePage | the page in question |
aSearchResult | SitePage[] | the search result |
aSite | Site | the site object |
Returns:
SiteContext
the site context
Home > @acoustic-content-sdk/utils > pageEquals
pageEquals() function
Tests if two pages are equal
Signature:
declare function _pageEquals(aLeft: DeliveryContentItem, aRight: DeliveryContentItem): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | DeliveryContentItem | left page |
aRight | DeliveryContentItem | right page |
Returns:
boolean
true if the pages are equal, else false
Home > @acoustic-content-sdk/utils > pageGetEncodedPath
pageGetEncodedPath() function
Make sure we use a consistent encoding
Signature:
declare function _getEncodedPath(aPath: string): string;
Parameters
Parameter | Type | Description |
---|
aPath | string | the original, encoded path |
Returns:
string
the encoded path, using our canonical encoding
Home > @acoustic-content-sdk/utils > parseQueryString
parseQueryString() function
Parses the query string into key/value pairs
Signature:
declare function _parseQuery(aQuery: string): ParsedQuery;
Parameters
Parameter | Type | Description |
---|
aQuery | string | the query string |
Returns:
ParsedQuery
the query result object
Home > @acoustic-content-sdk/utils > pathForSearch
pathForSearch() function
Signature:
declare function _getPathForSearch(aPath: string): string;
Parameters
Parameter | Type | Description |
---|
aPath | string | |
Returns:
string
Home > @acoustic-content-sdk/utils > perfMeasure
perfMeasure() function
Signature:
declare function _measure(aName: string): () => void;
Parameters
Parameter | Type | Description |
---|
aName | string | |
Returns:
() => void
Home > @acoustic-content-sdk/utils > pluckPath
pluckPath() function
Returns a function that plucks the given path from an object
Signature:
export declare function pluckPath<T>(aPath: string[], aDefault?: T): UnaryFunction<any, T>;
Parameters
Parameter | Type | Description |
---|
aPath | string[] | the path to pluck |
aDefault | T | |
Returns:
UnaryFunction<any, T>
the pluck function
Home > @acoustic-content-sdk/utils > queryToCanonicalString
queryToCanonicalString() function
Converts various inputs into a query string.
Signature:
declare function _buildSortedQueryString(aValue: any): string | null | undefined;
Parameters
Parameter | Type | Description |
---|
aValue | any | the input |
Returns:
string | null | undefined
the result of the serialization
Home > @acoustic-content-sdk/utils > queryToString
queryToString() function
Converts various inputs into a query string.
Signature:
declare function _buildQueryString(aValue: any): string | null | undefined;
Parameters
Parameter | Type | Description |
---|
aValue | any | the input |
Returns:
string | null | undefined
the result of the serialization
Home > @acoustic-content-sdk/utils > reduceArray
reduceArray() function
Tests every value in an array
Signature:
export declare function reduceArray<T, R>(aArray: ArrayLike<T> | null | undefined, aReducer: BiFunction<R, T, R>, aInitial: R): R;
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | null | undefined | the array |
aReducer | BiFunction<R, T, R> | the reducer function |
aInitial | R | |
Returns:
R
the result
Home > @acoustic-content-sdk/utils > reduceForIn
reduceForIn() function
Run a callback for each key value pair
Signature:
declare function _reduceForIn<T, R>(aObject: Record<string, T> | object | null | undefined, aFunction: (aRes: R, aValue: T, aKey: string) => R, aInitial: R): R;
Parameters
Parameter | Type | Description |
---|
aObject | Record<string, T> | object | null | undefined | the object |
aFunction | (aRes: R, aValue: T, aKey: string) => R | |
aInitial | R | |
Returns:
R
Home > @acoustic-content-sdk/utils > reduceToObject
reduceToObject() function
Groups an array into an object given a key extractor
Signature:
export declare function reduceToObject<T, V = T>(aArray: ArrayLike<T> | null | undefined, aKeyExtractor: UnaryFunction<T, string>, aTransformer?: UnaryFunction<T, V>): Record<string, V>;
Parameters
Parameter | Type | Description |
---|
aArray | ArrayLike<T> | null | undefined | the array |
aKeyExtractor | UnaryFunction<T, string> | the key extractor |
aTransformer | UnaryFunction<T, V> | the transformer for the values, defaults to the identity operation |
Returns:
Record<string, V>
the mapping
Home > @acoustic-content-sdk/utils > rxBackpressure
rxBackpressure() function
Implementation of a backpressure operator. The operator will combine source items into chunks and produces a result observable per chunk. It will buffer source items as long as the observable of the last chunk has not finished, yet.
Signature:
export declare function rxBackpressure<T, R>(aDelegate: UnaryFunction<T[], Observable<R>>): OperatorFunction<T, R>;
Parameters
Parameter | Type | Description |
---|
aDelegate | UnaryFunction<T[], Observable<R>> | delegate function to produce the result based on a chunk |
Returns:
OperatorFunction<T, R>
an operator function that transforms a source sequence into a target sequence
Home > @acoustic-content-sdk/utils > rxCachedFunction
rxCachedFunction() function
Implements a function that caches the result of another function
Signature:
export declare function rxCachedFunction<T>(aDelegate: UnaryFunction<string, Observable<T>>, aAccessor?: CacheAccessor<Observable<T>>): UnaryFunction<string, Observable<T>>;
Parameters
Parameter | Type | Description |
---|
aDelegate | UnaryFunction<string, Observable<T>> | the delegate function to cache |
aAccessor | CacheAccessor<Observable<T>> | |
Returns:
UnaryFunction<string, Observable<T>>
a cached wrapper
Home > @acoustic-content-sdk/utils > rxLayoutIdFromRenderingContext
rxLayoutIdFromRenderingContext() function
Decodes the layout id from a type or provider
Signature:
export declare function rxLayoutIdFromRenderingContext(aLayoutMode: string, aRenderingContext: Maybe<RenderingContextV2>, aTypeAccessor: UnaryFunction<string, Observable<AuthoringType>>, aLayoutMappingAccessor: UnaryFunction<string, Observable<AuthoringLayoutMapping>>, aLogSvc?: LoggerService, aScheduler?: SchedulerLike): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aLayoutMode | string | the layout mode |
aRenderingContext | Maybe<RenderingContextV2> | the rendering context |
aTypeAccessor | UnaryFunction<string, Observable<AuthoringType>> | resolver for the content types |
aLayoutMappingAccessor | UnaryFunction<string, Observable<AuthoringLayoutMapping>> | resolver for the layout mappings by type ID |
aLogSvc | LoggerService | |
aScheduler | SchedulerLike | |
Returns:
Observable<string>
the decoded layout id
Home > @acoustic-content-sdk/utils > rxUrlFromProvider
rxUrlFromProvider() function
Converts the provider into a URL
Signature:
export declare function rxUrlFromProvider(aProvider: HubInfoUrlProvider): Observable<URL>;
Parameters
Parameter | Type | Description |
---|
aProvider | HubInfoUrlProvider | the provider |
Returns:
Observable<URL>
the URL if available
Home > @acoustic-content-sdk/utils > rxWchFromAuthoringTypeByAccessor
rxWchFromAuthoringTypeByAccessor() function
Decodes information from the authoring element identified by the accessor expression. The method will first locate the correct authoring element based on the accessor and then applies a selector to extract the desired value from the element.
Signature:
export declare function rxWchFromAuthoringTypeByAccessor<T>(aAccessor: string, aTypeId: string, aSelector: UnaryFunction<AuthoringElement, T>, aTypeAccessor: UnaryFunction<string, Observable<AuthoringType>>, aScheduler?: SchedulerLike): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aAccessor | string | the accessor expression |
aTypeId | string | |
aSelector | UnaryFunction<AuthoringElement, T> | the selector expression |
aTypeAccessor | UnaryFunction<string, Observable<AuthoringType>> | |
aScheduler | SchedulerLike | |
Returns:
Observable<T>
the placeholder for the type or null or undefined
Home > @acoustic-content-sdk/utils > rxWithSubscriptionCount
rxWithSubscriptionCount() function
Returns an operator that invokes a callback with the subscription count
Signature:
export declare function rxWithSubscriptionCount<T>(aCallback: Consumer<number>): MonoTypeOperatorFunction<T>;
Parameters
Parameter | Type | Description |
---|
aCallback | Consumer<number> | the callback |
Returns:
MonoTypeOperatorFunction<T>
the operator
Home > @acoustic-content-sdk/utils > safeCmp
safeCmp() function
Generates a safe comparator that also works if the arguments are nil
Signature:
export declare function safeCmp<T>(aComparator: Comparator<T>): Comparator<T>;
Parameters
Parameter | Type | Description |
---|
aComparator | Comparator<T> | the original comparator |
Returns:
Comparator<T>
a safe version of the comparator
Home > @acoustic-content-sdk/utils > sendJsonRequest
sendJsonRequest() function
Sends a request to the given options object and allows to trigger a refresh via the given trigger.
Signature:
declare function _sendJsonRequest<T>(aUrl: string, aOptions: HttpOptions, aTrigger: Observable<any>, aHttpService: HttpService, aLogger?: Logger): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aUrl | string | |
aOptions | HttpOptions | the options |
aTrigger | Observable<any> | the trigger |
aHttpService | HttpService | |
aLogger | Logger | |
Returns:
Observable<T>
the response stream
Home > @acoustic-content-sdk/utils > sendRequest
sendRequest() function
Sends a request to the given options object and allows to trigger a refresh via the given trigger.
Signature:
declare function _sendRequest<T>(aUrl: string, aOptions: HttpOptions, aTrigger: Observable<any>, aRequest: Request<T>, aLogger: Logger): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aUrl | string | |
aOptions | HttpOptions | the options |
aTrigger | Observable<any> | the trigger |
aRequest | Request<T> | |
aLogger | Logger | |
Returns:
Observable<T>
the response stream
Home > @acoustic-content-sdk/utils > sendTextRequest
sendTextRequest() function
Sends a request to the given options object and allows to trigger a refresh via the given trigger.
Signature:
declare function _sendTextRequest(aUrl: string, aOptions: HttpOptions, aTrigger: Observable<any>, aHttpService: HttpService, aLogger?: Logger): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aUrl | string | |
aOptions | HttpOptions | the options |
aTrigger | Observable<any> | the trigger |
aHttpService | HttpService | |
aLogger | Logger | |
Returns:
Observable<string>
the response stream
Home > @acoustic-content-sdk/utils > siteContextEquals
siteContextEquals() function
Tests if two site contexts are equal
Signature:
declare function _siteContextEquals(aLeft: SiteContext, aRight: SiteContext): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | SiteContext | left context |
aRight | SiteContext | right context |
Returns:
boolean
true if the contexts are equal, else false
Home > @acoustic-content-sdk/utils > thisThenThat
thisThenThat() function
Combines two observables such that the events on the first one are used until the second one starts to produce an event. From then on only the events on the second one will be used and the first one canceled.
Signature:
export declare function thisThenThat<T>(aFirst: Observable<T>, aNext: Observable<T>): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aFirst | Observable<T> | the first observable |
aNext | Observable<T> | the next one |
Returns:
Observable<T>
the combined observable
Home > @acoustic-content-sdk/utils > toInteger
toInteger() function
Converts the value to an integer
Signature:
declare function _toInteger(aValue: any, aDefault: number): number;
Parameters
Parameter | Type | Description |
---|
aValue | any | the value |
aDefault | number | the default value in case of an error |
Returns:
number
Home > @acoustic-content-sdk/utils > urlConfigEquals
urlConfigEquals() function
Tests if two UrlConfig objects are equal
Signature:
export declare function urlConfigEquals(aLeft: UrlConfig, aRight: UrlConfig): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | UrlConfig | left object |
aRight | UrlConfig | right object |
Returns:
boolean
true if the objects are equal
Home > @acoustic-content-sdk/utils > urlEquals
urlEquals() function
Tests if two URL objects are equal
Signature:
export declare function urlEquals(aLeft: URL, aRight: URL): boolean;
Parameters
Parameter | Type | Description |
---|
aLeft | URL | left object |
aRight | URL | right object |
Returns:
boolean
true if the objects are equal, else false
Home > @acoustic-content-sdk/utils > urlFromProvider
urlFromProvider() function
Converts the provider into a URL
Signature:
export declare function urlFromProvider(aProvider: StaticHubInfoUrlProvider): URL;
Parameters
Parameter | Type | Description |
---|
aProvider | StaticHubInfoUrlProvider | the provider |
Returns:
URL
the URL if available
Home > @acoustic-content-sdk/utils > urlSlashes
urlSlashes() function
Makes sure that a path starts and ends with slash
Signature:
declare function _ensureStartingAndTrailingSlash(aUrl?: string): string;
Parameters
Parameter | Type | Description |
---|
aUrl | string | the url |
Returns:
string
the fixed URL
Home > @acoustic-content-sdk/utils > urlToString
urlToString() function
Shortcut to convert a URL to a string
Signature:
declare function _urlToString(aURL: URL | string): string;
Parameters
Parameter | Type | Description |
---|
aURL | URL | string | the URL |
Returns:
string
the resulting string
Home > @acoustic-content-sdk/utils > wchAddDebug
wchAddDebug() function
Signature:
declare function _addDebug(aPath: string, aRenderingContext: RenderingContext): RenderingContext;
Parameters
Parameter | Type | Description |
---|
aPath | string | |
aRenderingContext | RenderingContext | |
Returns:
RenderingContext
Home > @acoustic-content-sdk/utils > wchAddTypings
wchAddTypings() function
Adds typings next to the elements
Signature:
export declare function wchAddTypings(aRenderingContext: RenderingContext): RenderingContext;
Parameters
Parameter | Type | Description |
---|
aRenderingContext | RenderingContext | the rendering context to modify |
Returns:
RenderingContext
the context
Home > @acoustic-content-sdk/utils > wchAdjustRenderingContextSearchQuery
wchAdjustRenderingContextSearchQuery() function
Analyzes the search query and makes sure that it contains the required fields.
Signature:
declare function _adjustRenderingContextSearchQuery(aQuery: string): string;
Parameters
Parameter | Type | Description |
---|
aQuery | string | the search query |
Returns:
string
the modified query
Home > @acoustic-content-sdk/utils > wchAdjustSitePagesSearchQuery
wchAdjustSitePagesSearchQuery() function
Analyzes the search query and makes sure that it contains the required fields.
Signature:
declare function _adjustSitePagesSearchQuery(aQuery: string, aSiteId: string): string;
Parameters
Parameter | Type | Description |
---|
aQuery | string | the search query |
aSiteId | string | |
Returns:
string
the modified query
Home > @acoustic-content-sdk/utils > wchAuthoringElementFromAccessor
wchAuthoringElementFromAccessor() function
Decodes the authoring element from the accessor expression
Signature:
export declare function wchAuthoringElementFromAccessor(aAccessor: string, aType: AuthoringType): Maybe<AuthoringElement>;
Parameters
Parameter | Type | Description |
---|
aAccessor | string | the accessor expression |
aType | AuthoringType | the actual type |
Returns:
Maybe<AuthoringElement>
the placeholder for the type or undefined
Home > @acoustic-content-sdk/utils > wchBoxFetchLevels
wchBoxFetchLevels() function
Returns the number of fetch levels
Signature:
declare function _boxFetchLevels(aLevels: number | null | undefined, aDefault?: number): number;
Parameters
Parameter | Type | Description |
---|
aLevels | number | null | undefined | the levels |
aDefault | number | |
Returns:
number
the number, a value < 0 means to fetch all levels
Home > @acoustic-content-sdk/utils > wchBoxLayoutMode
wchBoxLayoutMode() function
Maps unknown or empty modes
Signature:
declare function _boxLayoutMode(aMode: string | null | undefined): string;
Parameters
Parameter | Type | Description |
---|
aMode | string | null | undefined | the mode |
Returns:
string
the mode if not empty, else DEFAULT_LAYOUT_MODE
Home > @acoustic-content-sdk/utils > wchCreateUrlConfig
wchCreateUrlConfig() function
Constructs a interface based on some optional config values.
Signature:
export declare function wchCreateUrlConfig(aBaseUrl?: HubInfoUrlProvider, aApiUrl?: HubInfoUrlProvider, aResourceUrl?: HubInfoUrlProvider, aDocument?: Document): Observable<UrlConfig>;
Parameters
Parameter | Type | Description |
---|
aBaseUrl | HubInfoUrlProvider | The base URL used to access WCH APIs. |
aApiUrl | HubInfoUrlProvider | The base URL used to access WCH APIs. |
aResourceUrl | HubInfoUrlProvider | The base URL used to access WCH delivery resources. |
aDocument | Document | The current document |
Returns:
Observable<UrlConfig>
the derived URL config
Home > @acoustic-content-sdk/utils > wchCycleHandling
wchCycleHandling() function
Signature:
declare function _getCycleHandling(aCycle?: CYCLE_HANDLING | string): CYCLE_HANDLING;
Parameters
Parameter | Type | Description |
---|
aCycle | CYCLE_HANDLING | string | |
Returns:
CYCLE_HANDLING
Home > @acoustic-content-sdk/utils > wchDecodeAccessor
wchDecodeAccessor() function
Tranlates the accessor to an expression
Signature:
declare function _getExpressionFromAccessor(aPrototype: any, aAccessor: string): string | undefined;
Parameters
Parameter | Type | Description |
---|
aPrototype | any | the object |
aAccessor | string | the accessor string, possibly indexed |
Returns:
string | undefined
the accessor expression, relative to the rendering context
Home > @acoustic-content-sdk/utils > wchDecodeExpression
wchDecodeExpression() function
Decodes the expression back to an expression into elements. The expression might point either to the optimized element or to the elements structure itself.
Signature:
declare function _decodeExpression(aExpression: string): string;
Parameters
Parameter | Type | Description |
---|
aExpression | string | the original expression |
Returns:
string
the decoded expression
Home > @acoustic-content-sdk/utils > wchDeliveryContentByAccessor
wchDeliveryContentByAccessor() function
Returns the element identified by the accessor string from a content item in delivery format
Signature:
export declare function wchDeliveryContentByAccessor(aItem: DeliveryContentItem, aAccessor: string): DeliveryContentItem | DeliveryElement;
Parameters
Parameter | Type | Description |
---|
aItem | DeliveryContentItem | the root level item (its accessor should be ) |
aAccessor | string | accessor expression to the item (this references the authoring path!) |
Returns:
DeliveryContentItem | DeliveryElement
the referenced value
Home > @acoustic-content-sdk/utils > wchElementFromRenderingContext
wchElementFromRenderingContext() function
Decodes an element from the accessor
Signature:
export declare function wchElementFromRenderingContext(aContext: RenderingContext, aAccessor: string): AbstractElement;
Parameters
Parameter | Type | Description |
---|
aContext | RenderingContext | the rendering context |
aAccessor | string | the accessor expression |
Returns:
AbstractElement
the element or undefineds
Home > @acoustic-content-sdk/utils > wchForEachRenderingContext
wchForEachRenderingContext() function
Iterates over all rendering contexts referenced by this context
Signature:
declare function _forEachRenderingContext(aRenderingContext: RenderingContext, aCallback: RenderingContextCallback): void;
Parameters
Parameter | Type | Description |
---|
aRenderingContext | RenderingContext | the rendering context |
aCallback | RenderingContextCallback | the callback |
Returns:
void
Home > @acoustic-content-sdk/utils > wchForEachType
wchForEachType() function
Resolves all typeRef
Signature:
export declare function wchForEachType(aType: AuthoringType, aCallback: Consumer<AuthoringType>): void;
Parameters
Parameter | Type | Description |
---|
aType | AuthoringType | the authoring type |
aCallback | Consumer<AuthoringType> | |
Returns:
void
the resolved type (a copy)
Home > @acoustic-content-sdk/utils > wchGetApiUrlFromResourceURL
wchGetApiUrlFromResourceURL() function
Computes the API URL given the resource URL
Signature:
declare function _getApiUrlFromResourceURL(aResourceURL: URL): URL;
Parameters
Parameter | Type | Description |
---|
aResourceURL | URL | the resource URL |
Returns:
URL
the API URL
Home > @acoustic-content-sdk/utils > wchGetApiUrlInContext
wchGetApiUrlInContext() function
Constructs a API URL based on a context check callback
Signature:
declare function _getApiUrlInContext(aApiUrl: URL, aBaseURL: URL, aPreviewCheck: UnaryFunction<URL, boolean>): URL;
Parameters
Parameter | Type | Description |
---|
aApiUrl | URL | the configured API URL, can be the live or the preview URL |
aBaseURL | URL | the URL the system is loaded from, this is used to check for preview mode |
aPreviewCheck | UnaryFunction<URL, boolean> | customer provided callback to test the baseURL for preview mode |
Returns:
URL
the correct API URL
Home > @acoustic-content-sdk/utils > wchGetBaseURL
wchGetBaseURL() function
Decodes the base URL. The base URL is the URL that all routing URLs will start with and will be resolved as relative. The URL ends with a slash character. See .
Signature:
export declare function wchGetBaseURL(aDocument?: Document, aWindow?: Window): URL;
Parameters
Parameter | Type | Description |
---|
aDocument | Document | optionally the document |
aWindow | Window | optionally the window |
Returns:
URL
the URL
Home > @acoustic-content-sdk/utils > wchGetHubInfoFromBaseURL
wchGetHubInfoFromBaseURL() function
Decodes the hub info from the base URL. This assumes that the application is served from a location in WCH.
Signature:
declare function _getHubInfoFromBaseURL(aBaseURL: URL): HubInfo;
Parameters
Parameter | Type | Description |
---|
aBaseURL | URL | |
Returns:
HubInfo
Home > @acoustic-content-sdk/utils > wchGetHubInfoFromLinks
wchGetHubInfoFromLinks() function
Decodes the hub info from links in the document
Signature:
declare function _getHubInfoFromLinks(aDocument?: Document, aWindow?: Window): HubInfo;
Parameters
Parameter | Type | Description |
---|
aDocument | Document | the document |
aWindow | Window | the window object |
Returns:
HubInfo
Home > @acoustic-content-sdk/utils > wchGetHubInfoUrlProvider
wchGetHubInfoUrlProvider() function
Exposes a provider based on a API URL and a preview callback
Signature:
declare function _hubInfoUrlProvider(aApiUrl: HubInfoUrlProvider, aPreviewCheck?: UnaryFunction<URL, boolean>): HubInfoUrlProvider;
Parameters
Parameter | Type | Description |
---|
aApiUrl | HubInfoUrlProvider | the API URL |
aPreviewCheck | UnaryFunction<URL, boolean> | callback to test if the base URL is a preview URL. If empty, use the built in default check |
Returns:
HubInfoUrlProvider
the provider
Home > @acoustic-content-sdk/utils > wchGetLayout
wchGetLayout() function
Returns the layout object for a particular mode for the rendering context
Signature:
declare function _getLayout(aLayoutMode: string | undefined, aContext: RenderingContext | undefined): Layout | undefined;
Parameters
Parameter | Type | Description |
---|
aLayoutMode | string | undefined | the mode |
aContext | RenderingContext | undefined | the context |
Returns:
Layout | undefined
Home > @acoustic-content-sdk/utils > wchGetPageSearchURL
wchGetPageSearchURL() function
Returns the URI for a page search URL
Signature:
declare function _getPageSearchURL(aPath: string, aSiteId: string): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aPath | string | |
aSiteId | string | |
Returns:
Observable<string>
the path
Home > @acoustic-content-sdk/utils > wchGetParentPageURL
wchGetParentPageURL() function
Returns the URI for a parent page search
Signature:
declare function _getParentPageURL(aParentId: string, aSiteId: string): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aParentId | string | |
aSiteId | string | |
Returns:
Observable<string>
the path
Home > @acoustic-content-sdk/utils > wchGetSearchURL
wchGetSearchURL() function
Builds the search query string
Signature:
declare function _getSearchURL(aQueryString: string): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aQueryString | string | the query string |
Returns:
Observable<string>
the result
Home > @acoustic-content-sdk/utils > wchGetSiteContextURL
wchGetSiteContextURL() function
Returns the URI for a page search URL
Signature:
declare function _getSiteContextURL(aParentId: string | null | undefined, aPageId: string, aSiteId: string): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aParentId | string | null | undefined | |
aPageId | string | |
aSiteId | string | |
Returns:
Observable<string>
the path
Home > @acoustic-content-sdk/utils > wchInsertPlaceholders
wchInsertPlaceholders() function
Signature:
export declare function wchInsertPlaceholders(aRenderingContext: RenderingContext, aResolver: PlaceholderResolver): Observable<RenderingContext>;
Parameters
Parameter | Type | Description |
---|
aRenderingContext | RenderingContext | |
aResolver | PlaceholderResolver | |
Returns:
Observable<RenderingContext>
Home > @acoustic-content-sdk/utils > wchIsPreviewMode
wchIsPreviewMode() function
Determines if the server is running in preview mode
Signature:
declare function _isPreviewMode(aBaseURL: URL): boolean;
Parameters
Parameter | Type | Description |
---|
aBaseURL | URL | the base URL |
Returns:
boolean
true if the URL represents preview mode
Home > @acoustic-content-sdk/utils > wchPlaceholderFromAccessor
wchPlaceholderFromAccessor() function
Decodes the placeholder from an accessor expression
Signature:
export declare function wchPlaceholderFromAccessor(aAccessor: string, aType: AuthoringType): Maybe<AuthoringPlaceholder>;
Parameters
Parameter | Type | Description |
---|
aAccessor | string | the accessor expression |
aType | AuthoringType | the actual type |
Returns:
Maybe<AuthoringPlaceholder>
the placeholder for the type or undefined
Home > @acoustic-content-sdk/utils > wchPlaceholderResolver
wchPlaceholderResolver() function
Returns a resolver for placeholders based on WCH search
Signature:
export declare function wchPlaceholderResolver(aTag: string, aSearch: WchSdkSearch): PlaceholderResolver;
Parameters
Parameter | Type | Description |
---|
aTag | string | the tag used to identify placeholder types |
aSearch | WchSdkSearch | the search service |
Returns:
PlaceholderResolver
the result
Home > @acoustic-content-sdk/utils > wchPrepareRenderingContextInterceptors
wchPrepareRenderingContextInterceptors() function
Prepare a list of interceptors
Signature:
declare function _prepareRenderingContextInterceptors(aRenderingContextInterceptors: RenderingContextInterceptor[]): RenderingContextInterceptors;
Parameters
Parameter | Type | Description |
---|
aRenderingContextInterceptors | RenderingContextInterceptor[] | |
Returns:
RenderingContextInterceptors
Home > @acoustic-content-sdk/utils > wchResolveRenderingContext
wchResolveRenderingContext() function
Resolves the rendering context according to the configured strategy
Signature:
declare function _resolveRenderingContext(aRenderingContext: RenderingContext | null | undefined, aStrategy: CYCLE_HANDLING, aRenderingContextById: (id: string) => Observable<RenderingContext | null | undefined>, aLogger?: Logger): Observable<RenderingContext | null | undefined>;
Parameters
Parameter | Type | Description |
---|
aRenderingContext | RenderingContext | null | undefined | |
aStrategy | CYCLE_HANDLING | |
aRenderingContextById | (id: string) => Observable<RenderingContext | null | undefined> | |
aLogger | Logger | |
Returns:
Observable<RenderingContext | null | undefined>
Home > @acoustic-content-sdk/utils > wchResolveType
wchResolveType() function
Resolves all typeRef
Signature:
export declare function wchResolveType(aType: AuthoringType): AuthoringType;
Parameters
Parameter | Type | Description |
---|
aType | AuthoringType | the authoring type |
Returns:
AuthoringType
the resolved type (a copy)
Home > @acoustic-content-sdk/utils > wchSelectAccessor
wchSelectAccessor() function
parses a path expression
Signature:
declare function _selectAccessor(aAccessor: string): UnaryFunction<any, any>;
Parameters
Parameter | Type | Description |
---|
aAccessor | string | |
Returns:
UnaryFunction<any, any>
function that selects the expression string
Home > @acoustic-content-sdk/utils > wchTypeFromAccessor
wchTypeFromAccessor() function
Decodes the element type from an accessor expression
Signature:
export declare function wchTypeFromAccessor(aAccessor: string, aType: AuthoringType): Maybe<string>;
Parameters
Parameter | Type | Description |
---|
aAccessor | string | the accessor expression |
aType | AuthoringType | the actual type |
Returns:
Maybe<string>
the type of the placeholder
Home > @acoustic-content-sdk/utils > bind
bind variable
Our simple implementation
Signature:
_bind: Bind
Home > @acoustic-content-sdk/utils > bindKey
bindKey variable
The bind member magic
Signature:
_bindKey: BindKey
Home > @acoustic-content-sdk/utils > bindMember
bindMember variable
The bind member magic
Signature:
_bindMember: BindMember
Home > @acoustic-content-sdk/utils > ClientStorage
ClientStorage interface
Signature:
export interface ClientStorage
Methods
Home > @acoustic-content-sdk/utils > HttpOptions
HttpOptions interface
Signature:
export interface HttpOptions
Properties
Home > @acoustic-content-sdk/utils > HttpService
HttpService interface
Signature:
export interface HttpService
Methods
Home > @acoustic-content-sdk/utils > JSONArray
JSONArray interface
Signature:
export interface JSONArray extends Array<JSONValue>
Home > @acoustic-content-sdk/utils > JSONObject
JSONObject interface
Signature:
export interface JSONObject
Home > @acoustic-content-sdk/utils > ObserverConsumer
ObserverConsumer interface
Signature:
export interface ObserverConsumer<T> extends Observer<T>
Home > @acoustic-content-sdk/utils > Partial
Partial interface
Signature:
export interface Partial
Home > @acoustic-content-sdk/utils > RenderingContextInterceptors
RenderingContextInterceptors interface
Signature:
export interface RenderingContextInterceptors
Properties
Home > @acoustic-content-sdk/utils > RenderingContextMap
RenderingContextMap interface
Signature:
export interface RenderingContextMap
Home > @acoustic-content-sdk/utils > rxCompose
rxCompose variable
Warning: This API is now obsolete.
use pipe
instead
Signature:
rxCompose: RxCompose
Home > @acoustic-content-sdk/utils > rxPipe
rxPipe variable
Function that pipes the arguments to the stream passed as the first argument
Signature:
rxPipe: RxPipe
Home > @acoustic-content-sdk/utils > spreadArgs
spreadArgs variable
Wraps a function such that it accepts an array of parameters instead of individual parameters.
Signature:
spreadArgs: SpreadArgs
Home > @acoustic-content-sdk/utils > ZippedArgs
ZippedArgs interface
Signature:
export interface ZippedArgs
Home > @acoustic-content-sdk/utils > and
and variable
Performs the "and" function
Signature:
and: <T>(aLeft: Predicate<T>, aRight: Predicate<T>) => Predicate<T>
Home > @acoustic-content-sdk/utils > anyToString
anyToString variable
Signature:
_anyToString: (aValue: any) => string
Home > @acoustic-content-sdk/utils > arrayEquals
arrayEquals variable
Tests if two arrays are equal
Signature:
_arrayEquals: <T>(aLeft: T[], aRight: T[], aPredicate: EqualsPredicate<T>) => boolean
Home > @acoustic-content-sdk/utils > arrayPush
arrayPush variable
Pushes a value to an array
Signature:
_push: <T>(aValue: T, aArray: T[]) => T[]
Home > @acoustic-content-sdk/utils > assertArray
assertArray variable
Signature:
assertArray: <T>(aKey: string | number | symbol, aObject: any) => T[]
Home > @acoustic-content-sdk/utils > assertFromFunction
assertFromFunction variable
Signature:
_assertFromFunction: <T, K extends string | number | symbol = string | number | symbol>(aKey: K, aObject: any, aCallback: UnaryFunction<K, T>) => any
Home > @acoustic-content-sdk/utils > assertFromGenerator
assertFromGenerator variable
Signature:
assertFromGenerator: <T>(aKey: string | number | symbol, aObject: any, aGenerator: Generator<T>) => T
Home > @acoustic-content-sdk/utils > assertObject
assertObject variable
Signature:
assertObject: <T>(aKey: string | number | symbol, aObject: any) => T
Home > @acoustic-content-sdk/utils > assignObject
assignObject variable
Signature:
_assign: typeof Object.assign
Home > @acoustic-content-sdk/utils > authoringLayoutMappingToDeliveryLayoutMapping
authoringLayoutMappingToDeliveryLayoutMapping variable
Converts an authoring layout item to a delivery layout item
Signature:
authoringLayoutMappingToDeliveryLayoutMapping: UnaryFunction<AuthoringLayoutMapping, DeliveryLayoutMapping>
Home > @acoustic-content-sdk/utils > authoringLayoutToDeliveryLayout
authoringLayoutToDeliveryLayout variable
Converts an authoring layout item to a delivery layout item
Signature:
authoringLayoutToDeliveryLayout: UnaryFunction<AuthoringLayoutItem, DeliveryLayout>
Home > @acoustic-content-sdk/utils > authoringTypeToDeliveryType
authoringTypeToDeliveryType variable
Converts an authoring layout item to a delivery layout item
Signature:
authoringTypeToDeliveryType: UnaryFunction<AuthoringType, DeliveryType>
Home > @acoustic-content-sdk/utils > biCompose
biCompose variable
Represents the composition of two functions
Signature:
biCompose: <S1, S2, D1, D2, R>(aFirst: UnaryFunction<S1, D1>, aSecond: UnaryFunction<S2, D2>, aFct: BiFunction<D1, D2, R>) => BiFunction<S1, S2, R>
Home > @acoustic-content-sdk/utils > biComposeMono
biComposeMono variable
Represents the composition of two functions where they have the same argument
Signature:
biComposeMono: <S, D, R>(aTransform: UnaryFunction<S, D>, aFct: BiFunction<D, D, R>) => BiFunction<S, S, R>
Home > @acoustic-content-sdk/utils > binary
binary variable
Guarantees a binary function
Signature:
binary: <T1, T2, R>(aFunction: BiFunction<T1, T2, R>) => BiFunction<T1, T2, R>
Home > @acoustic-content-sdk/utils > boxLoggerService
boxLoggerService variable
Function to return the NOOP_LOGGER service in case the logger service passed in is nil
Signature:
boxLoggerService: import("rxjs").UnaryFunction<LoggerService, LoggerService>
Home > @acoustic-content-sdk/utils > byProperty
byProperty variable
Generates a predicate that compares a named property of an object with another predicate
Signature:
byProperty: <T, K extends keyof T>(aKey: K, aPredicate: Predicate<T[K]>) => Predicate<T>
Home > @acoustic-content-sdk/utils > cancelExecuteLater
cancelExecuteLater variable
Signature:
_cancelCallback: (aHandle: number) => void
Home > @acoustic-content-sdk/utils > cloneURL
cloneURL variable
Clones the URL object into a bean
Signature:
_cloneURL: UnaryFunction<URL, URL>
Home > @acoustic-content-sdk/utils > cmpByLocalizedContext
cmpByLocalizedContext variable
Returns a comparator that orders localizations according to the preferences of a localized context
Signature:
cmpByLocalizedContext: UnaryFunction<LocalizedContext, Comparator<LocalizedText>>
Home > @acoustic-content-sdk/utils > cmpNumbers
cmpNumbers variable
Exports a comparator for numbers
Signature:
cmpNumbers: Comparator<number>
Home > @acoustic-content-sdk/utils > cmpStrings
cmpStrings variable
Exports a comparator for numbers
Signature:
cmpStrings: Comparator<string>
Home > @acoustic-content-sdk/utils > compose
compose variable
Represents the composition of two functions
Signature:
compose: <T1, T2, R>(aLeft: UnaryFunction<T1, T2>, aRight: UnaryFunction<T2, R>) => UnaryFunction<T1, R>
Home > @acoustic-content-sdk/utils > composeAll
composeAll variable
Composes the sequence of functions
Signature:
composeAll: <T, R>(...aFunctions: Array<(...aAny: any[]) => any>) => UnaryFunction<T, R>
Home > @acoustic-content-sdk/utils > constGenerator
constGenerator variable
Signature:
constGenerator: <T>(aValue: T) => () => T
Home > @acoustic-content-sdk/utils > createCache
createCache variable
Constructs a new cache
Signature:
createCache: <V>(aTimeout?: number, aMaxValues?: number, aLogger?: Logger) => CacheAccessor<V>
Home > @acoustic-content-sdk/utils > createConsoleLogger
createConsoleLogger variable
Signature:
createConsoleLogger: UnaryFunction<string, Logger>
Home > @acoustic-content-sdk/utils > createConsumerOnSubject
createConsumerOnSubject variable
Binds to the next function of a subject
Signature:
createConsumerOnSubject: <T>(aSubject: Subject<T> | Observer<T>) => Consumer<T>
Home > @acoustic-content-sdk/utils > createEmptyLogger
createEmptyLogger variable
Signature:
createEmptyLogger: UnaryFunction<string, Logger>
Home > @acoustic-content-sdk/utils > createLruCache
createLruCache variable
Constructs a new cache
Signature:
createLruCache: <V>(aTimeout?: number, aMaxValues?: number, aLogger?: Logger) => CacheAccessor<V>
Home > @acoustic-content-sdk/utils > createObservableAdaptor
createObservableAdaptor variable
Constructs an adaptor around an existing observable. This helps for cross frame access to observables.
Signature:
createObservableAdaptor: <T>(aSrc: Subscribable<T>) => InteropObservable<T>
Home > @acoustic-content-sdk/utils > createObserverConsumer
createObserverConsumer variable
Signature:
createObserverConsumer: <T>(aSubject: Observer<T>) => ObserverConsumer<T>
Home > @acoustic-content-sdk/utils > createSingleSubject
createSingleSubject variable
Constructs a singe replay subject
Signature:
createSingleSubject: <T>() => ReplaySubject<T>
Home > @acoustic-content-sdk/utils > deepDistinctUntilChanged
deepDistinctUntilChanged variable
Warning: This API is now obsolete.
use opDeepDistinctUntilChanged instead
Signature:
deepDistinctUntilChanged: <T>() => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > deepEquals
deepEquals variable
Tests if two objects are identical
Signature:
_deepEquals: (aLeft: any, aRight: any) => boolean
Home > @acoustic-content-sdk/utils > DEFAULT_FETCH_LEVELS
DEFAULT_FETCH_LEVELS variable
Signature:
_DEFAULT_FETCH_LEVELS = -1
Home > @acoustic-content-sdk/utils > DEFAULT_HTTP_RESOURCE_OPTIONS
DEFAULT_HTTP_RESOURCE_OPTIONS variable
Signature:
DEFAULT_HTTP_RESOURCE_OPTIONS: HttpResourceOptions
Home > @acoustic-content-sdk/utils > DEFAULT_LAYOUT_MAPPING
DEFAULT_LAYOUT_MAPPING variable
Signature:
DEFAULT_LAYOUT_MAPPING: {
[layoutMode: string]: Layout;
}
Home > @acoustic-content-sdk/utils > DEFAULT_LAYOUT_MODE
DEFAULT_LAYOUT_MODE variable
Signature:
DEFAULT_LAYOUT_MODE = "default"
Home > @acoustic-content-sdk/utils > EMPTY_JSON_OBSERVABLE
EMPTY_JSON_OBSERVABLE variable
The empty observable instance, we can reuse the same
Signature:
EMPTY_JSON_OBSERVABLE: Observable<JSONValue>
Home > @acoustic-content-sdk/utils > EMPTY_RENDERING_CONTEXT
EMPTY_RENDERING_CONTEXT variable
Signature:
EMPTY_RENDERING_CONTEXT: RenderingContext
Home > @acoustic-content-sdk/utils > EMPTY_SITE_CONTEXT
EMPTY_SITE_CONTEXT variable
Signature:
_EMPTY_SITE_CONTEXT: SiteContext
Home > @acoustic-content-sdk/utils > EMPTY_STRING_OBSERVABLE
EMPTY_STRING_OBSERVABLE variable
The empty observable instance, we can reuse the same
Signature:
EMPTY_STRING_OBSERVABLE: Observable<string>
Home > @acoustic-content-sdk/utils > escapeHtml
escapeHtml variable
Applies HTML escaping to strings
Signature:
escapeHtml: <T = string>(aValue: T) => string | T
Home > @acoustic-content-sdk/utils > executeLater
executeLater variable
Signature:
_setCallback: (aFct: Function) => number
Home > @acoustic-content-sdk/utils > FALSE$
FALSE$ variable
Operator representing false
Signature:
FALSE$: Observable<boolean>
Home > @acoustic-content-sdk/utils > filterArrayOf
filterArrayOf variable
Returns an operator function that filters array of a particular type
Signature:
filterArrayOf: <T>(pred: IsPredicate<T>) => OperatorFunction<any, T[]>
Home > @acoustic-content-sdk/utils > filterBoolean
filterBoolean variable
Warning: This API is now obsolete.
use opFilterBoolean instead
Signature:
filterBoolean: Generator<MonoTypeOperatorFunction<boolean>>
Home > @acoustic-content-sdk/utils > filterNotNil
filterNotNil variable
Warning: This API is now obsolete.
use opFilterNotNil instead
Signature:
filterNotNil: <T>() => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > filterNumber
filterNumber variable
Warning: This API is now obsolete.
use opFilterNumber instead
Signature:
filterNumber: Generator<MonoTypeOperatorFunction<number>>
Home > @acoustic-content-sdk/utils > filterObject
filterObject variable
Warning: This API is now obsolete.
use opFilterObject instead
Signature:
filterObject: Generator<MonoTypeOperatorFunction<object>>
Home > @acoustic-content-sdk/utils > filterString
filterString variable
Warning: This API is now obsolete.
use opFilterString instead
Signature:
filterString: Generator<MonoTypeOperatorFunction<string>>
Home > @acoustic-content-sdk/utils > filterTypeOf
filterTypeOf variable
Only returns objects of a particular type
Signature:
filterTypeOf: <T>(aPredicate: IsPredicate<T>) => OperatorFunction<any, T>
Home > @acoustic-content-sdk/utils > firstElement
firstElement variable
Signature:
firstElement: <T>(aArray: T[]) => T
Home > @acoustic-content-sdk/utils > flipArgs
flipArgs variable
switch the order of arguments
Signature:
flipArgs: <T1, T2, R>(aFct: BiFunction<T1, T2, R>) => BiFunction<T2, T1, R>
Home > @acoustic-content-sdk/utils > fromGeneratorOrT
fromGeneratorOrT variable
Signature:
fromGeneratorOrT: <T>(aValue: GeneratorOrT<T>) => any
Home > @acoustic-content-sdk/utils > FUNCTION_TYPE
FUNCTION_TYPE variable
Signature:
_FUNCTION_TYPE: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
Home > @acoustic-content-sdk/utils > getCategoryLeaf
getCategoryLeaf variable
Extracts the last category element
Signature:
getCategoryLeaf: (aCategory: Category, aIndex?: number, aFallback?: string) => string
Home > @acoustic-content-sdk/utils > getPath
getPath variable
Extracts the value of the path for the property
Signature:
getPath: <T>(aValue: any, aPath: ArrayLike<string>, aDefault?: T) => T
Home > @acoustic-content-sdk/utils > getProperty
getProperty variable
Generates a function that returns a property
Signature:
getProperty: <T, K extends keyof T>(aValue: T, aKey: K, aDefault?: T[K]) => T[K]
Home > @acoustic-content-sdk/utils > hashRandomClassName
hashRandomClassName variable
Returns some random identifier
Signature:
hashRandomClassName: () => string
Home > @acoustic-content-sdk/utils > hashRandomIdentifier
hashRandomIdentifier variable
Returns some random identifier
Signature:
hashRandomIdentifier: () => string
Home > @acoustic-content-sdk/utils > hashRandomLinkName
hashRandomLinkName variable
Returns some random identifier
Signature:
hashRandomLinkName: () => string
Home > @acoustic-content-sdk/utils > hashToClassName
hashToClassName variable
Converts a hash number into a CSS class name
Signature:
hashToClassName: (aHash: number) => string
Home > @acoustic-content-sdk/utils > hashToIdentifier
hashToIdentifier variable
Converts a hash number into a javascript identifier
Signature:
hashToIdentifier: (aHash: number) => string
Home > @acoustic-content-sdk/utils > hashToLinkName
hashToLinkName variable
Converts a hash number into a javascript identifier
Signature:
hashToLinkName: (aHash: number) => string
Home > @acoustic-content-sdk/utils > idleFrameScheduler
idleFrameScheduler variable
Signature:
idleFrameScheduler: SchedulerLike
Home > @acoustic-content-sdk/utils > isAbsoluteURL
isAbsoluteURL variable
Tests if a URL is an absolute URL
Signature:
_isAbsoluteUrl: IsPredicate<string>
Home > @acoustic-content-sdk/utils > isArray
isArray variable
Tests if a value is an array
Signature:
_isArray: IsPredicate<any[]>
Home > @acoustic-content-sdk/utils > isArrayLike
isArrayLike variable
Tests if a value is like an array, i.e. it has the length property
Signature:
_isArrayLike: IsPredicate<ArrayLike<any>>
Home > @acoustic-content-sdk/utils > isBoolean
isBoolean variable
Tests if a value is a boolean value
Signature:
_isBoolean: IsPredicate<boolean>
Home > @acoustic-content-sdk/utils > isDeepEqualTo
isDeepEqualTo variable
Returns a function that tests if a value is equal to another value
Signature:
_isDeepEqualTo: <T>(aComparison: T) => Predicate<T>
Home > @acoustic-content-sdk/utils > isEmpty
isEmpty variable
Tests if an array is empty
Signature:
isEmpty: Predicate<any[]>
Home > @acoustic-content-sdk/utils > isEqualTo
isEqualTo variable
Returns a function that tests if a value is equal to another value
Signature:
isEqualTo: <T, R = T>(aComparison: T, aTransform?: UnaryFunction<R, T>) => Predicate<R>
Home > @acoustic-content-sdk/utils > isEqualVersion
isEqualVersion variable
Tests if two versions are equal
Signature:
isEqualVersion: EqualsPredicate<WchSdkVersion>
Home > @acoustic-content-sdk/utils > isFunction
isFunction variable
Tests if an object is a function
Signature:
_isFunction: IsPredicate<Function>
Home > @acoustic-content-sdk/utils > isNever
isNever variable
Never predicate, that never is true
Signature:
_isNever: IsPredicate<never>
Home > @acoustic-content-sdk/utils > isNil
isNil variable
Checks for nil
Signature:
_isNil: (aObject: any) => aObject is null | undefined
Home > @acoustic-content-sdk/utils > isNilOrEmpty
isNilOrEmpty variable
Tests if the array does not exist or if it is empty
Signature:
_isNilOrEmpty: <T>(aValue: any) => boolean
Home > @acoustic-content-sdk/utils > isNotEmpty
isNotEmpty variable
Tests if an array is not empty
Signature:
_isNotEmpty: <T>(arr: any) => arr is ArrayLike<T>
Home > @acoustic-content-sdk/utils > isNotNil
isNotNil variable
Checks for nil
Signature:
_isNotNil: <T>(aObject: T | null | undefined) => aObject is T
Home > @acoustic-content-sdk/utils > isNumber
isNumber variable
Tests if a value is a number value
Signature:
isNumber: IsPredicate<number>
Home > @acoustic-content-sdk/utils > isString
isString variable
Tests if an object is a string
Signature:
_isString: IsPredicate<string>
Home > @acoustic-content-sdk/utils > isStringArray
isStringArray variable
Tests if all elements of the array are of type string
Signature:
_isStringArray: IsPredicate<string[]>
Home > @acoustic-content-sdk/utils > isUndefined
isUndefined variable
Checks for undefined
Signature:
isUndefined: IsPredicate<undefined>
Home > @acoustic-content-sdk/utils > jsonParse
jsonParse variable
Signature:
_jsonParse: <T>(aValue: string) => T
Home > @acoustic-content-sdk/utils > jsonStringEscape
jsonStringEscape variable
Signature:
jsonStringEscape: (aValue: string) => string
Home > @acoustic-content-sdk/utils > jsonStringify
jsonStringify variable
Signature:
_jsonStringify: UnaryFunction<any, string>
Home > @acoustic-content-sdk/utils > KEY_CYCLE
KEY_CYCLE variable
Signature:
KEY_CYCLE = "$$CYCLE"
Home > @acoustic-content-sdk/utils > KEY_LAYOUT_MODE
KEY_LAYOUT_MODE variable
Signature:
KEY_LAYOUT_MODE = "layoutMode"
Home > @acoustic-content-sdk/utils > KEY_LEVELS
KEY_LEVELS variable
Signature:
KEY_LEVELS = "levels"
Home > @acoustic-content-sdk/utils > KEY_RENDERING_CONTEXT_MAP
KEY_RENDERING_CONTEXT_MAP variable
Signature:
KEY_RENDERING_CONTEXT_MAP: string | symbol
Home > @acoustic-content-sdk/utils > KEY_RENDERING_CONTEXT
KEY_RENDERING_CONTEXT variable
Signature:
KEY_RENDERING_CONTEXT = "renderingContext"
Home > @acoustic-content-sdk/utils > lastElement
lastElement variable
Signature:
lastElement: <T>(aArray: T[]) => T
Home > @acoustic-content-sdk/utils > LAYOUT_TYPE_ANGULAR
LAYOUT_TYPE_ANGULAR variable
Signature:
LAYOUT_TYPE_ANGULAR = "angular"
Home > @acoustic-content-sdk/utils > LAYOUT_TYPE_HANDLEBARS
LAYOUT_TYPE_HANDLEBARS variable
Signature:
LAYOUT_TYPE_HANDLEBARS = "handlebars"
Home > @acoustic-content-sdk/utils > lazyGenerator
lazyGenerator variable
Creates a lazy generator for the value
Signature:
lazyGenerator: <T>(aGenerator: Generator<T>) => Generator<T>
Home > @acoustic-content-sdk/utils > lazyProxy
lazyProxy variable
Returns an object that is lazily constructed when first accessed
Signature:
lazyProxy: <T>(aGenerator: Generator<T>) => T
Home > @acoustic-content-sdk/utils > localizedText
localizedText variable
expose a tuple as text
Signature:
localizedText: BiFunction<string, Locale, LocalizedText>
Home > @acoustic-content-sdk/utils > mapDefault
mapDefault variable
Operator that returns the default value for each nil value of the source sequence
Signature:
mapDefault: <T>(aDefault: T) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > mapTypeOf
mapTypeOf variable
Returns the object if it is of a particular type, else undefined
Signature:
mapTypeOf: <T>(aPredicate: IsPredicate<T>) => OperatorFunction<any, T>
Home > @acoustic-content-sdk/utils > mergeHubInfo
mergeHubInfo variable
Merges the config of two hub infos
Signature:
_mergeHubInfo: BiFunction<HubInfo, HubInfo, HubInfo>
Home > @acoustic-content-sdk/utils > MODULE
MODULE variable
Module name
Signature:
MODULE = "@acoustic-content-sdk/utils"
Home > @acoustic-content-sdk/utils > NOOP_LOGGER_SERVICE
NOOP_LOGGER_SERVICE variable
Fallback logger service that exposes noop loggers
Signature:
NOOP_LOGGER_SERVICE: LoggerService
Home > @acoustic-content-sdk/utils > not
not variable
Negates a function
Signature:
not: <T>(aFunction: Predicate<T>) => Predicate<T>
Home > @acoustic-content-sdk/utils > NULL$
NULL$ variable
Operator representing undefined
Signature:
NULL$: Observable<any>
Home > @acoustic-content-sdk/utils > nullary
nullary variable
Guarantees a nullary function
Signature:
nullary: <T>(aFunction: () => T) => () => T
Home > @acoustic-content-sdk/utils > objectAssign
objectAssign variable
Assigns a property to an object and returns that object
Signature:
_objectAssign: <T, V>(aKey: string, aValue: V, aObject: T) => T
Home > @acoustic-content-sdk/utils > objectEquals
objectEquals variable
Tests if two objects are equal
Signature:
_objectEquals: (aLeft: any, aRight: any, aPredicate: EqualsPredicate<any>) => boolean
Home > @acoustic-content-sdk/utils > objectKeys
objectKeys variable
Make sure we have some of the central functions
Signature:
_keys: typeof Object.keys
Home > @acoustic-content-sdk/utils > opBoxLayoutMode
opBoxLayoutMode variable
Operator to box the layout mode
Signature:
opBoxLayoutMode: OperatorFunction<string, string>
Home > @acoustic-content-sdk/utils > opCacheLast
opCacheLast variable
Convenience operator for cacheLast()
Signature:
opCacheLast: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > opDeepDistinctUntilChanged
opDeepDistinctUntilChanged variable
Like using deepEquals
Signature:
opDeepDistinctUntilChanged: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > opDistinctUntilChanged
opDistinctUntilChanged variable
Like
Signature:
opDistinctUntilChanged: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > opFalse
opFalse variable
Warning: This API is now obsolete.
use FALSE$ instead
Operator representing false
Signature:
opFalse: Observable<boolean>
Home > @acoustic-content-sdk/utils > opFilterBoolean
opFilterBoolean variable
Filters booleans
Signature:
opFilterBoolean: OperatorFunction<any, boolean>
Home > @acoustic-content-sdk/utils > opFilterNever
opFilterNever variable
Filter that will completely ignore all events
Signature:
opFilterNever: OperatorFunction<any, never>
Home > @acoustic-content-sdk/utils > opFilterNotNil
opFilterNotNil variable
Makes sure the sequence does not have nils
Signature:
opFilterNotNil: <T>(src: Observable<T>) => Observable<NonNullable<T>>
Home > @acoustic-content-sdk/utils > opFilterNumber
opFilterNumber variable
Filters number
Signature:
opFilterNumber: OperatorFunction<any, number>
Home > @acoustic-content-sdk/utils > opFilterObject
opFilterObject variable
Filters plain objects
Signature:
opFilterObject: OperatorFunction<any, object>
Home > @acoustic-content-sdk/utils > opFilterString
opFilterString variable
Filters strings
Signature:
opFilterString: OperatorFunction<any, string>
Home > @acoustic-content-sdk/utils > opJsonParse
opJsonParse variable
Parses a string into a JSON object
Signature:
opJsonParse: <T>(src: Observable<string>) => Observable<T>
Home > @acoustic-content-sdk/utils > opLevels
opLevels variable
Converts the levels to a valid number value
Signature:
opLevels: OperatorFunction<string | number | null | undefined, number>
Home > @acoustic-content-sdk/utils > opNot
opNot variable
Negates a boolean
Signature:
opNot: MonoTypeOperatorFunction<boolean>
Home > @acoustic-content-sdk/utils > opPageArrayDistinctUntilChanged
opPageArrayDistinctUntilChanged variable
Like using pageArrayEquals()
Signature:
opPageArrayDistinctUntilChanged: MonoTypeOperatorFunction<DeliveryContentItem[]>
Home > @acoustic-content-sdk/utils > opPageDistinctUntilChanged
opPageDistinctUntilChanged variable
Like using pageEquals()
Signature:
opPageDistinctUntilChanged: MonoTypeOperatorFunction<DeliveryContentItem>
Home > @acoustic-content-sdk/utils > opPluckApiOrigin
opPluckApiOrigin variable
Extracts the origin of the API URL from the rendering context
Signature:
opPluckApiOrigin: OperatorFunction<RenderingContextV2, string>
Home > @acoustic-content-sdk/utils > opPluckCurrentPage
opPluckCurrentPage variable
Operator to pluck the current page
Signature:
opPluckCurrentPage: OperatorFunction<RenderingContextV2, DeliveryContentItem>
Home > @acoustic-content-sdk/utils > opPluckDistinctPage
opPluckDistinctPage variable
Operator to pluck a distinct page
Signature:
opPluckDistinctPage: OperatorFunction<RenderingContextV2, DeliveryContentItem>
Home > @acoustic-content-sdk/utils > opPluckResourceOrigin
opPluckResourceOrigin variable
Extracts the origin of the Resource URL from the rendering context
Signature:
opPluckResourceOrigin: OperatorFunction<RenderingContextV2, string>
Home > @acoustic-content-sdk/utils > opReplayLast
opReplayLast variable
Convenience operator for replayLast()
Signature:
opReplayLast: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > opShallowDistinctUntilChanged
opShallowDistinctUntilChanged variable
Like using shallowEquals
Signature:
opShallowDistinctUntilChanged: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > shallowEquals
shallowEquals variable
Tests if two objects are identical
Signature:
shallowEquals: (aLeft: any, aRight: any) => boolean
Home > @acoustic-content-sdk/utils > opShareLast
opShareLast variable
Shares and replays only the latest emission
Signature:
opShareLast: <T>(src: Observable<T>) => Observable<T>
Home > @acoustic-content-sdk/utils > opTrue
opTrue variable
Warning: This API is now obsolete.
use TRUE$ instead
Operator representing true
Signature:
opTrue: Observable<boolean>
Home > @acoustic-content-sdk/utils > or
or variable
Performs the "or" function
Signature:
or: <T>(aLeft: Predicate<T>, aRight: Predicate<T>) => Predicate<T>
Home > @acoustic-content-sdk/utils > pageArrayDistinctUntilChanged
pageArrayDistinctUntilChanged variable
Warning: This API is now obsolete.
use opPageArrayDistinctUntilChanged instead
Signature:
pageArrayDistinctUntilChanged: Generator<MonoTypeOperatorFunction<DeliveryContentItem[]>>
Home > @acoustic-content-sdk/utils > pageDistinctUntilChanged
pageDistinctUntilChanged variable
Warning: This API is now obsolete.
use opPageDistinctUntilChanged instead
Signature:
pageDistinctUntilChanged: Generator<MonoTypeOperatorFunction<DeliveryContentItem>>
Home > @acoustic-content-sdk/utils > pageFromRenderingContext
pageFromRenderingContext variable
Extracts the selected page from the rendering context
Signature:
_getPage: UnaryFunction<RenderingContextV2, DeliveryContentItem>
Home > @acoustic-content-sdk/utils > parsePath
parsePath variable
Our parsing function, we assume that the resulting array is read only
Signature:
parsePath: UnaryFunction<string, string[]>
Home > @acoustic-content-sdk/utils > parseURL
parseURL variable
Parses a URL or string into a URL object
Signature:
_parseURL: UnaryFunction<URL | string | null | undefined, URL | null | undefined>
Home > @acoustic-content-sdk/utils > partialFirst
partialFirst variable
Binds the first parameter
Signature:
partialFirst: <T1, T2, R>(aFunction: BiFunction<T1, T2, R>, aFirst: T1) => UnaryFunction<T2, R>
Home > @acoustic-content-sdk/utils > partialLeft
partialLeft variable
Our simple implementation
Signature:
_partialLeft: Partial
Home > @acoustic-content-sdk/utils > partialSecond
partialSecond variable
Binds the second parameter
Signature:
partialSecond: <T1, T2, R>(aFunction: BiFunction<T1, T2, R>, aSecond: T2) => UnaryFunction<T1, R>
Home > @acoustic-content-sdk/utils > pluckApiOrigin
pluckApiOrigin variable
Warning: This API is now obsolete.
use opPluckApiOrigin instead
Extracts the origin of the API URL from the rendering context
Signature:
pluckApiOrigin: Generator<OperatorFunction<RenderingContextV2, string>>
Home > @acoustic-content-sdk/utils > pluckCurrentPage
pluckCurrentPage variable
Warning: This API is now obsolete.
use opPluckCurrentPage instead
Signature:
pluckCurrentPage: Generator<OperatorFunction<RenderingContextV2, DeliveryContentItem>>
Home > @acoustic-content-sdk/utils > pluckLocale
pluckLocale variable
Accessor for locales from a localized context
Signature:
pluckLocale: UnaryFunction<LocalizedText, Locale>
Home > @acoustic-content-sdk/utils > pluckProperty
pluckProperty variable
Generates a function that returns a property
Signature:
pluckProperty: <T, K extends keyof T>(aKey: K, aDefault?: T[K]) => UnaryFunction<T, T[K]>
Home > @acoustic-content-sdk/utils > pluckResourceOrigin
pluckResourceOrigin variable
Warning: This API is now obsolete.
use opPluckResourceOrigin instead
Extracts the origin of the Resource URL from the rendering context
Signature:
pluckResourceOrigin: Generator<OperatorFunction<RenderingContextV2, string>>
Home > @acoustic-content-sdk/utils > pluckText
pluckText variable
Accessor for text from a localized context
Signature:
pluckText: UnaryFunction<LocalizedText, string>
Home > @acoustic-content-sdk/utils > propertyFromObject
propertyFromObject variable
Generates a function that returns a property
Signature:
propertyFromObject: <T, K extends keyof T>(aValue: T, aDefault?: T[K]) => UnaryFunction<K, T[K]>
Home > @acoustic-content-sdk/utils > replayLast
replayLast variable
Returns the shareReplay
operator with a buffer of 1
and refCount: true
Signature:
replayLast: <T>(scheduler?: SchedulerLike) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > rxError
rxError variable
Function that perform an info logging in an rx pipeline onto a given logger with a particular prefix
Signature:
rxError: <T>(aLogger: Logger, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > rxLog
rxLog variable
Returns a function that logs particular aspects of a subscription
Signature:
_rxLoggerMember: <T>(aMode: number) => (aLogger: Logger, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > rxLogAll
rxLogAll variable
Function that perform an info logging in an rx pipeline onto a given logger with a particular prefix
Signature:
rxLogAll: <T>(aLogger: Logger, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Example
const info = rxInfo(logger);
stream.pipe( info('onValue')
Home > @acoustic-content-sdk/utils > rxLogMember
rxLogMember variable
Returns a function that logs particular aspects of a subscription
Signature:
rxLogMember: <T>(aMode: number) => (aLogger$: Observable<Logger>, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > rxLogNext
rxLogNext variable
Function that perform an info logging in an rx pipeline onto a given logger with a particular prefix
Signature:
rxLogNext: <T>(aLogger$: Observable<Logger>, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > rxMemoize
rxMemoize variable
Operator that caches the result of a previous operator and monitors the result for changes
Signature:
rxMemoize: <T, R>(opFct: OperatorFunction<T, R>, cmp?: EqualsPredicate<R>, scheduler?: SchedulerLike) => UnaryFunction<Observable<T>, Observable<R>>
Home > @acoustic-content-sdk/utils > rxNext
rxNext variable
Function that perform an info logging in an rx pipeline onto a given logger with a particular prefix
Signature:
rxNext: <T>(aLogger: Logger, ...aArgs: any[]) => (...aValues: any[]) => MonoTypeOperatorFunction<T>
Example
const info = rxInfo(logger);
stream.pipe( info('onValue')
Home > @acoustic-content-sdk/utils > rxPluckPath
rxPluckPath variable
Operator to pluck a certain path
Signature:
rxPluckPath: <T>(aPath: string[], aDefault?: T) => OperatorFunction<any, T>
Home > @acoustic-content-sdk/utils > rxSelectPath
rxSelectPath variable
Memoized selector for a particular path
Signature:
rxSelectPath: <T, R>(aPath: string | string[], aDefault?: Maybe<R>, aCmp?: EqualsPredicate<R>, aScheduler?: SchedulerLike) => OperatorFunction<T, R>
Home > @acoustic-content-sdk/utils > rxSelectProperty
rxSelectProperty variable
Memoized selector for a particular property
Signature:
rxSelectProperty: <T, K extends keyof T>(aKey: K, aDefault?: Maybe<T[K]>, aCmp?: EqualsPredicate<T[K]>, aScheduler?: SchedulerLike) => OperatorFunction<T, T[K]>
Home > @acoustic-content-sdk/utils > safeMergeMap
safeMergeMap variable
Signature:
safeMergeMap: <T, R>(aDelegate: UnaryFunction<T, ObservableInput<R>>) => OperatorFunction<T, R>
Home > @acoustic-content-sdk/utils > safeSwitchMap
safeSwitchMap variable
Signature:
safeSwitchMap: <T, R>(aDelegate: UnaryFunction<T, ObservableInput<R>>) => OperatorFunction<T, R>
Home > @acoustic-content-sdk/utils > safeUnsubscribe
safeUnsubscribe variable
Unsubscribes if the subscription exists.
Signature:
safeUnsubscribe: (aSubscription: Unsubscribable) => void
Home > @acoustic-content-sdk/utils > safeUnsubscribeAll
safeUnsubscribeAll variable
Unsubscribes if the subscription exists.
Signature:
safeUnsubscribeAll: (aSubscriptions: ArrayLike<Unsubscribable>) => void
Home > @acoustic-content-sdk/utils > SEARCH_MAX_ROWS
SEARCH_MAX_ROWS variable
Signature:
_VALUE_MAX_ROWS = 2147483647
Home > @acoustic-content-sdk/utils > selectApiUrl
selectApiUrl variable
Signature:
selectApiUrl: UnaryFunction<UrlConfig, URL>
Home > @acoustic-content-sdk/utils > selectBaseUrl
selectBaseUrl variable
Signature:
selectBaseUrl: UnaryFunction<UrlConfig, URL>
Home > @acoustic-content-sdk/utils > selectPreviewMode
selectPreviewMode variable
Signature:
selectPreviewMode: UnaryFunction<UrlConfig, boolean>
Home > @acoustic-content-sdk/utils > selectResourceUrl
selectResourceUrl variable
Signature:
selectResourceUrl: UnaryFunction<UrlConfig, URL>
Home > @acoustic-content-sdk/utils > shareLast
shareLast variable
Warning: This API is now obsolete.
use opShareLast instead
https://blog.angularindepth.com/rxjs-whats-changed-with-sharereplay-65c098843e95
Signature:
shareLast: <T>() => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > switchMapDefault
switchMapDefault variable
Operator that returns the default sequence for each nil value of the source sequence
Signature:
switchMapDefault: <T>(aDefault: Observable<T>) => MonoTypeOperatorFunction<T>
Home > @acoustic-content-sdk/utils > ternary
ternary variable
Performs the ternary operation
Signature:
ternary: <T, R>(aPredicate: Predicate<T>, aLeft: UnaryFunction<T, R>, aRight: UnaryFunction<T, R>) => UnaryFunction<T, R>
Home > @acoustic-content-sdk/utils > thisThenThats
thisThenThats variable
Combines two observables such that the events on the first one are used until the second one starts to produce an event. From then on only the events on the second one will be used and the first one canceled.
Signature:
thisThenThats: <T>(...aObservables: Observable<T>[]) => Observable<T>
Home > @acoustic-content-sdk/utils > toArray
toArray variable
Converts an array like to an array
Signature:
toArray: <T>(aValue: ArrayLike<T>) => T[]
Home > @acoustic-content-sdk/utils > TRUE$
TRUE$ variable
Operator representing true
Signature:
TRUE$: Observable<boolean>
Home > @acoustic-content-sdk/utils > typedPluck
typedPluck variable
Operator that plucks a key from an object and makes sure that the key exists
Signature:
typedPluck: <T, K extends keyof T & string>(aKey: K) => OperatorFunction<T, T[K]>
Home > @acoustic-content-sdk/utils > unary
unary variable
Guarantees a unary function
Signature:
unary: <T, R>(aFunction: UnaryFunction<T, R>) => UnaryFunction<T, R>
Home > @acoustic-content-sdk/utils > UNDEFINED_RENDERING_CONTEXT
UNDEFINED_RENDERING_CONTEXT variable
Signature:
UNDEFINED_RENDERING_CONTEXT: RenderingContext
Home > @acoustic-content-sdk/utils > UNDEFINED_TYPE
UNDEFINED_TYPE variable
Signature:
_UNDEFINED_TYPE: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
Home > @acoustic-content-sdk/utils > UNDEFINED$
UNDEFINED$ variable
Operator representing undefined
Signature:
UNDEFINED$: Observable<any>
Home > @acoustic-content-sdk/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/utils > wchGetSiteURL
wchGetSiteURL variable
Returns the URI path for the site
Signature:
_getSiteURL: UnaryFunction<string, string>
Home > @acoustic-content-sdk/utils > zipArgs
zipArgs variable
Expose the array method in a strongly typed way
Signature:
zipArgs: ZippedArgs
Home > @acoustic-content-sdk/utils > BiConsumer
BiConsumer type
Signature:
export declare type BiConsumer<T1, T2> = BiFunction<T1, T2, any>;
Home > @acoustic-content-sdk/utils > BiFunction
BiFunction type
Signature:
export declare type BiFunction<T1, T2, R> = (t1: T1, t2: T2) => R;
Home > @acoustic-content-sdk/utils > CacheAccessor
CacheAccessor type
Signature:
export declare type CacheAccessor<V> = (aKey: string, aCallback: CacheCallback<V>, aLogger?: Logger) => V;
Home > @acoustic-content-sdk/utils > CacheCallback
CacheCallback type
Signature:
export declare type CacheCallback<V> = (aKey: string, aLogger?: Logger) => V;
Home > @acoustic-content-sdk/utils > Comparator
Comparator type
Comparison operator
Signature:
export declare type Comparator<T> = BiFunction<T, T, number>;
Home > @acoustic-content-sdk/utils > Consumer
Consumer type
Signature:
export declare type Consumer<T> = UnaryFunction<T, any>;
Home > @acoustic-content-sdk/utils > EqualsPredicate
EqualsPredicate type
Signature:
export declare type EqualsPredicate<T> = (aLeft: T, aRight: T) => boolean;
Home > @acoustic-content-sdk/utils > Function0
Function0 type
Signature:
export declare type Function0<R> = () => R;
Home > @acoustic-content-sdk/utils > Function1
Function1 type
Signature:
export declare type Function1<T1, R> = (t1: T1) => R;
Home > @acoustic-content-sdk/utils > Function2
Function2 type
Signature:
export declare type Function2<T1, T2, R> = (t1: T1, t2: T2) => R;
Home > @acoustic-content-sdk/utils > Function3
Function3 type
Signature:
export declare type Function3<T1, T2, T3, R> = (t1: T1, t2: T2, t3: T3) => R;
Home > @acoustic-content-sdk/utils > Function4
Function4 type
Signature:
export declare type Function4<T1, T2, T3, T4, R> = (t1: T1, t2: T2, t3: T3, t4: T4) => R;
Home > @acoustic-content-sdk/utils > Generator
Generator type
Signature:
export declare type Generator<T> = () => T | null | undefined;
Home > @acoustic-content-sdk/utils > GeneratorOrT
GeneratorOrT type
Signature:
export declare type GeneratorOrT<T> = T | (() => GeneratorOrT<T>);
Home > @acoustic-content-sdk/utils > IsPredicate
IsPredicate type
Signature:
export declare type IsPredicate<T> = (aValue: any | null | undefined) => aValue is T;
Home > @acoustic-content-sdk/utils > JSONValue
JSONValue type
Signature:
export declare type JSONValue = boolean | number | string | null | JSONArray | JSONObject;
Home > @acoustic-content-sdk/utils > MarkupTemplate
MarkupTemplate type
Signature:
export declare type MarkupTemplate = UnaryFunction<RenderingContextV2, Observable<string>>;
Home > @acoustic-content-sdk/utils > Maybe
Maybe type
maybe type
Signature:
export declare type Maybe<T> = NonNullable<T> | undefined;
Home > @acoustic-content-sdk/utils > ObservableOrT
ObservableOrT type
Signature:
export declare type ObservableOrT<T> = GeneratorOrT<T> | Observable<GeneratorOrT<T>>;
Home > @acoustic-content-sdk/utils > ParsedQuery
ParsedQuery type
Signature:
export declare type ParsedQuery = Record<string, string | string[]>;
Home > @acoustic-content-sdk/utils > PlaceholderResolver
PlaceholderResolver type
Given a series of type IDs, return the placeholder content items
Signature:
export declare type PlaceholderResolver = UnaryFunction<string[], Observable<RenderingContext[]>>;
Home > @acoustic-content-sdk/utils > Predicate
Predicate type
Signature:
export declare type Predicate<T> = (aValue: T | null | undefined) => boolean;
Home > @acoustic-content-sdk/utils > Request
Request type
Signature:
export declare type Request<T> = (aUrl: string, aOptions: HttpOptions) => Observable<T>;
Home > @acoustic-content-sdk/utils > ClientStorageService > (constructor)
ClientStorageService.(constructor)
Constructs a new instance of the ClientStorageService
class
Signature:
constructor(aUrlsService: UrlConfig, aWindow?: Window);
Parameters
Parameter | Type | Description |
---|
aUrlsService | UrlConfig | |
aWindow | Window | |
Home > @acoustic-content-sdk/utils > ClientStorageService > get
ClientStorageService.get property
Signature:
get: (aKey: string) => JSONValue;
Home > @acoustic-content-sdk/utils > ClientStorageService > put
ClientStorageService.put property
Signature:
put: (aKey: string, aValue: JSONValue) => void;
Home > @acoustic-content-sdk/utils > StaticResources > (constructor)
StaticResources.(constructor)
Constructs a new instance of the StaticResources
class
Signature:
constructor(aBaseUrl: URL | undefined, http: HttpService);
Parameters
Parameter | Type | Description |
---|
aBaseUrl | URL | undefined | |
http | HttpService | |
Home > @acoustic-content-sdk/utils > StaticResources > get
StaticResources.get() method
Retrieves the bootstrap data from the cache
Signature:
get(aKey: string): Observable<JSONValue>;
Parameters
Parameter | Type | Description |
---|
aKey | string | the key |
Returns:
Observable<JSONValue>
an observable for the result or the empty observable
Home > @acoustic-content-sdk/utils > SiteInformation > (constructor)
SiteInformation.(constructor)
Constructs a new instance of the SiteInformation
class
Signature:
constructor();
Home > @acoustic-content-sdk/utils > SiteInformation > observer
SiteInformation.observer property
Signature:
observer: Observer<Site>;
Home > @acoustic-content-sdk/utils > SiteInformation > site
SiteInformation.site property
Attaches the modifications on the current site
Signature:
get site(): Observable<Site>;
Home > @acoustic-content-sdk/utils > SiteInformation > getIdByPath
SiteInformation.getIdByPath() method
Returns an observable that communicates the content IDs of items for a particular path. If the mapping changes, the change will be propagated. If the mapping is unknown (because the site has not been loaded, yet) the mapping will be communicated as undefined. If the mapping is known to not exist it will be communicated as null.
Signature:
getIdByPath(path: string): Observable<string | null | undefined>;
Parameters
Parameter | Type | Description |
---|
path | string | the path to listen for |
Returns:
Observable<string | null | undefined>
an observable of the result
See https://github.com/angular/angular/issues/16051
Home > @acoustic-content-sdk/utils > SiteInformation > getSiteContextById
SiteInformation.getSiteContextById() method
Returns the site context for an ID
Signature:
getSiteContextById(aID: string | null): SiteContext;
Parameters
Parameter | Type | Description |
---|
aID | string | null | ID of the content item or the page |
Returns:
SiteContext
the site context
Home > @acoustic-content-sdk/utils > HttpService > getJson
HttpService.getJson() method
Signature:
getJson<T>(aUrl: string, aOptions: HttpOptions): Observable<T>;
Parameters
Parameter | Type | Description |
---|
aUrl | string | |
aOptions | HttpOptions | |
Returns:
Observable<T>
Home > @acoustic-content-sdk/utils > HttpService > getText
HttpService.getText() method
Signature:
getText(aUrl: string, aOptions: HttpOptions): Observable<string>;
Parameters
Parameter | Type | Description |
---|
aUrl | string | |
aOptions | HttpOptions | |
Returns:
Observable<string>
Home > @acoustic-content-sdk/utils > ClientStorage > get
ClientStorage.get() method
Signature:
get(aKey: string): JSONValue | null | undefined;
Parameters
Parameter | Type | Description |
---|
aKey | string | |
Returns:
JSONValue | null | undefined
Home > @acoustic-content-sdk/utils > ClientStorage > put
ClientStorage.put() method
Signature:
put(aKey: string, aValue: JSONValue): any;
Parameters
Parameter | Type | Description |
---|
aKey | string | |
aValue | JSONValue | |
Returns:
any
Home > @acoustic-content-sdk/utils > HttpOptions > dispatchError
HttpOptions.dispatchError property
Signature:
dispatchError?: boolean;
Home > @acoustic-content-sdk/utils > HttpOptions > withCredentials
HttpOptions.withCredentials property
Signature:
withCredentials: boolean;
Home > @acoustic-content-sdk/utils > RenderingContextInterceptors > opRenderingContext
RenderingContextInterceptors.opRenderingContext property
Signature:
opRenderingContext: MonoTypeOperatorFunction<RenderingContext>;
Home > @acoustic-content-sdk/utils > RenderingContextInterceptors > opRenderingContexts
RenderingContextInterceptors.opRenderingContexts property
Signature:
opRenderingContexts: MonoTypeOperatorFunction<RenderingContext[]>;