@activejs/core
Version:
Pragmatic, Reactive State Management for JavaScript Apps
148 lines (147 loc) • 4.6 kB
TypeScript
import { DictValue, EnvironmentConfig, GlobalActionConfig, GlobalAsyncSystemConfig, GlobalClusterConfig, GlobalConfig, GlobalUnitConfig } from '../models';
/**
* @internal please do not use.
*/
export declare const UniqueIdsAndLocationIdMap: {
[]: string;
};
/**
* The Global configuration for all ActiveJS constructs, Units, Systems, Action and Cluster.
*
* See {@link https://docs.activejs.dev/guides/configuration} for more details.
*
* @category 4. Utility
*/
export declare class Configuration {
/**
* @internal please do not use.
*/
private static _isDevMode;
/**
* @internal please do not use.
*/
private static _storage;
/**
* @internal please do not use.
*/
private static _ENVIRONMENT;
/**
* @internal please do not use.
*/
private static _ACTION;
/**
* @internal please do not use.
*/
private static _CLUSTER;
/**
* @internal please do not use.
*/
private static _UNITS;
/**
* @internal please do not use.
*/
private static _BOOL_UNIT;
/**
* @internal please do not use.
*/
private static _NUM_UNIT;
/**
* @internal please do not use.
*/
private static _STRING_UNIT;
/**
* @internal please do not use.
*/
private static _LIST_UNIT;
/**
* @internal please do not use.
*/
private static _DICT_UNIT;
/**
* @internal please do not use.
*/
private static _GENERIC_UNIT;
/**
* @internal please do not use.
*/
private static _ASYNC_SYSTEM;
/**
* The default Storage API being used for storing the values of persistent Units.
*
* @default `localStorage`
*/
static get storage(): Readonly<Storage>;
/**
* Global ActiveJS environment configurations options.
*/
static get ENVIRONMENT(): Readonly<EnvironmentConfig>;
/**
* Configuration options applied to all the Actions. {@link Action}
*/
static get ACTION(): Readonly<GlobalActionConfig>;
/**
* Configuration options applied to all the Clusters. {@link Cluster}
*/
static get CLUSTER(): Readonly<GlobalClusterConfig>;
/**
* Configuration options applied to all the Units. {@link Unit}
*/
static get UNITS(): Readonly<GlobalUnitConfig<any>>;
/**
* Configuration options applied to all the BoolUnits. {@link BoolUnit}
*/
static get BOOL_UNIT(): Readonly<GlobalUnitConfig<boolean>>;
/**
* Configuration options applied to all the NumUnits. {@link NumUnit}
*/
static get NUM_UNIT(): Readonly<GlobalUnitConfig<number>>;
/**
* Configuration options applied to all the StringUnits. {@link StringUnit}
*/
static get STRING_UNIT(): Readonly<GlobalUnitConfig<string>>;
/**
* Configuration options applied to all the ListUnits. {@link ListUnit}
*/
static get LIST_UNIT(): Readonly<GlobalUnitConfig<any[]>>;
/**
* Configuration options applied to all the DictUnits. {@link DictUnit}
*/
static get DICT_UNIT(): Readonly<GlobalUnitConfig<DictValue<any>>>;
/**
* Configuration options applied to all the GenericUnits. {@link GenericUnit}
*/
static get GENERIC_UNIT(): Readonly<GlobalUnitConfig<any>>;
/**
* Configuration options applied to all the AsyncSystems. {@link AsyncSystem}
*/
static get ASYNC_SYSTEM(): Readonly<GlobalAsyncSystemConfig>;
/**
* Sets and overrides default configurations. \
* These configurations can still be overridden at the time of instantiation.
*
* It should only be called once in the whole app.
* Calling it second time doesn't merge the new configuration,
* it simply rewrites it.
*
* However, the defaults are not affected by this behavior, \
* they have to be overridden specifically every time.
*
* @param config The configuration options.
*/
static set(config: GlobalConfig): void;
/**
* Resets all global configurations to their default/empty state. \
* It doesn't affect any currently existing instances, it's only applicable to the instances created after this.
*/
static reset(): void;
/**
* It sets the {@link ENVIRONMENT} to it's default configuration, \
* i.e: it turns off all the checks declared in {@link ENVIRONMENT} and \
* also, disables the extra logs.
*/
static enableProdMode(): void;
/**
* To check whether the production mode has been enabled or not.
*/
static isDevMode(): boolean;
}