@o3r/dynamic-content
Version:
This module provides a mechanism to retrieve media and data depending on the host or a server specific url.
36 lines • 1.44 kB
TypeScript
/**
* Strategies available to read / write data in the RequestParameters service.
* Rehydrate: if the storage already have data, those will be used by the service, ignoring new data. Otherwise set the storage
* Merge: storage data will be merged with the ones provided. (provided data has priority)
* Replace: storage data will be completely replaced by the ones provided
* ReplaceIfNotEmpty: If no parameters are provided, use the content from storage. Otherwise use the ones provided and update the storage with them.
*/
export declare enum StorageStrategy {
Rehydrate = 0,
Merge = 1,
Replace = 2,
ReplaceIfNotEmpty = 3
}
/**
* Configuration used by a user to feed the request parameters service.
*/
export interface RequestParametersConfig {
/**
* Strategy used by the RequestParameters Service. See StorageStrategy for more info
*/
strategy: StorageStrategy;
/**
* Storage used by the RequestParameters service
*/
storage?: Storage;
/**
* Value of the DOM element containing your query parameters (e.g. `document.body.dataset.query`)
*/
queryParamsValue: string;
/**
* Value of the DOM element containing your post parameters (e.g. `document.body.dataset.post`)
*/
postParamsValue: string;
}
export declare const defaultRequestParametersConfig: Readonly<RequestParametersConfig>;
//# sourceMappingURL=request-parameters.config.d.ts.map