@player-ui/player
Version:
45 lines • 1.84 kB
TypeScript
export interface ConstantsProvider {
/**
* Function to add constants to the providers store
* - @param data values to add to the constants store
*/
addConstants(data: Record<string, any>, namespace: string): void;
/**
* Function to retrieve constants from the providers store
* - @param key Key used for the store access
* - @param namespace namespace values were loaded under (defined in the plugin)
* - @param fallback Optional - if key doesn't exist in namespace what to return (will return unknown if not provided)
*/
getConstants(key: any, namespace: string, fallback?: any): any;
/**
* Function to set values to temporarily override certain keys in the perminant store
* - @param data values to override store with
* - @param namespace namespace to override
*/
setTemporaryValues(data: any, namespace: string): void;
/**
* Clears any temporary values that were previously set
*/
clearTemporaryValues(): void;
}
/**
* Key/Value store for constants and context for Player
*/
export declare class ConstantsController implements ConstantsProvider {
/**
* Data store is basically a map of namespaces to DataModels to provide some data isolation
*/
private store;
/**
* Separate store for temporary flow specific overrides.
* They are kept in a separate data model to make clearing it easier between flows
* and so there is no confusion on what is static and what is temporary
*/
private tempStore;
constructor();
addConstants(data: any, namespace: string): void;
getConstants(key: string, namespace: string, fallback?: any): any;
setTemporaryValues(data: any, namespace: string): void;
clearTemporaryValues(namespace?: string): void;
}
//# sourceMappingURL=index.d.ts.map