@o3r/dynamic-content
Version:
This module provides a mechanism to retrieve media and data depending on the host or a server specific url.
40 lines • 1.88 kB
TypeScript
import { Store } from '@ngrx/store';
import { AssetPathOverrideStore } from '../../stores/index';
import * as i0 from "@angular/core";
/**
* Service for getting dynamic content path
*/
export declare class DynamicContentService {
private readonly cmsOnlyAssetsPath;
private readonly store?;
readonly basePath: string;
private readonly mediaFolder;
constructor(dynamicContentPath: string, cmsOnlyAssetsPath: string, store?: Store<AssetPathOverrideStore> | undefined);
private normalizePath;
private getContentPath;
private getMediaPath;
/**
* Gets the full path of a content relative to the root
* Content path doesn't consider any override, you will always get the same file
* @param assetPath asset location in the root folder
* @example
* ```typescript
* getMediaPath('assets/imgs/my-image.png') // will give you the basePath + 'assets/imgs/my-image.png'
* ```
*/
getContentPathStream(assetPath?: string): import("rxjs").Observable<string>;
/**
* Gets the stream that provides the full path of a media content
* A Media content is always stored in the 'assets' media folder, no external content will be accessible through this function
* If any override is applied to the content, returns the override path instead
* @param assetPath asset location in the media folder (e.g imgs/my-image.png)
* @example
* ```typescript
* getMediaPathStream('imgs/my-image.png') // will give you the basePath + mediaFolder + 'imgs/my-image.png'
* ```
*/
getMediaPathStream(assetPath?: string): import("rxjs").Observable<string>;
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicContentService, [null, null, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<DynamicContentService>;
}
//# sourceMappingURL=dynamic-content.service.d.ts.map