@o3r/dynamic-content
Version:
This module provides a mechanism to retrieve media and data depending on the host or a server specific url.
75 lines • 3.15 kB
TypeScript
import { type EnvironmentProviders, ModuleWithProviders, type Provider } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "./dynamic-content.pipe";
/**
* Function to get dynamic content from body dataset
*/
export declare function getDynamicContent(): string;
/**
* Function to get the cms assets from body dataset
* This will be used only in a CMS context(not in local or prod) to display correctly the assets in the editor
*/
export declare function getCmsAssets(): string;
/**
* DynamicContent module
* @deprecated Will be removed in v14.
*/
export declare class DynamicContentModule {
/**
* Customize the location where the application will search for the base path of dynamic content
* @param dynamicPath Configuration for dynamic content path
* @param dynamicPath.content The string will be used as base path of dynamic content
* @param dynamicPath.cmsAssets The string will be used for the the base path of cms assets
* @note The cmsAssets will be used only in the cms editor mode and it will take priority over dynamic content
* @deprecated Please use {@link provideDynamicContent} instead. Will be removed in v14.
*/
static forRoot(dynamicPath: {
content: string;
} | {
cmsAssets: string;
}): ModuleWithProviders<DynamicContentModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicContentModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<DynamicContentModule, never, [typeof i1.O3rDynamicContentPipe], [typeof i1.O3rDynamicContentPipe]>;
static ɵinj: i0.ɵɵInjectorDeclaration<DynamicContentModule>;
}
type DynamicContentFeatureKind = 'base-path' | 'cms-assets-path';
interface DynamicContentFeature<FeatureKind extends DynamicContentFeatureKind> {
ɵkind: FeatureKind;
ɵproviders: Provider[];
}
type BasePathFeature = DynamicContentFeature<'base-path'>;
type CmsAssetsPathFeature = DynamicContentFeature<'cms-assets-path'>;
type DynamicContentFeatures = BasePathFeature | CmsAssetsPathFeature;
/**
* Specify a custom base path
* @param basePath
*/
export declare function withBasePath(basePath: string | (() => string)): BasePathFeature;
/**
* Specify a custom CMS assets path
* @param cmsAssetsPath
*/
export declare function withCmsAssetsPath(cmsAssetsPath: string | (() => string)): DynamicContentFeature<'cms-assets-path'>;
/**
* Provide dynamic content default configuration.
* To customize the location where the application will search for the base path of dynamic content
* @see {@link withBasePath}
* @see {@link withCmsAssetsPath}
* @note The cmsAssets will be used only in the cms editor mode and it will take priority over dynamic content
* @param features
* @example
* ```typescript
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideDynamicContent(
* withBasePath('custom/base/path'),
* withCmsAssetsPath('custom/cms/assets/path'),
* )
* ]
* }
* );
*/
export declare function provideDynamicContent(...features: DynamicContentFeatures[]): EnvironmentProviders;
export {};
//# sourceMappingURL=dynamic-content.module.d.ts.map