UNPKG

ng-dynamic-mf

Version:

[![npm](https://img.shields.io/npm/v/ng-dynamic-mf?color=%2300d26a&style=for-the-badge)](https://www.npmjs.com/package/ng-dynamic-mf) [![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/LoaderB0T_ng-dynamic-mf?server=https%3A%2F%2Fsonarcloud

37 lines (36 loc) 1.81 kB
export type Environment = { production: boolean; [key: string]: any; }; export declare function setWindow(window: Window): void; /** * import this for all values of the environment.json file */ export declare const environment: Environment; export declare const envValidator: (defaultEnvironment: Environment) => void; export declare const ɵinitializeEnvironment: (env: Environment, disableParentEnvironmentReuse?: boolean) => void; export declare const ɵreuseEnvironment: () => boolean; /** * Use this to check if the ng-dynamic-mf environment is available. * Will be false if ng-dynamic-mf was not used to bootstrap the app and no environment was set manually */ export declare function hasEnvironment(): boolean; /** * Copies all environment variables into an iframe * Make sure to call this mehtod before the angular app in the iframe is bootstrapped * @param iframe the iframe to copy the environment into * @param environment optional environment to copy into the iframe. If not provided, the environment from the parent window is used * * @throws if the environment is not available. Check with `hasEnvironment()` before calling this method */ export declare function copyEnvironmentIntoIFrame(iframe: HTMLIFrameElement, environment?: Environment): void; /** * Use this to set a custom environment variable at runtime * @param key the key of the environment variable * @param value the value of the environment variable */ export declare const setEnvironmentValue: (key: string, value: unknown) => void; /** * Registers a callback that is called whenever the environment is updated * @param callback the callback that is called whenever the environment is updated */ export declare const registerEnvironmentUpdateCallback: (callback: (environment: Environment) => void) => void;