@arc-js/config-manager 0.0.94 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.d.ts +12 -9
- package/config.js +902 -5
- package/config.min.js +1 -1
- package/core/ConfigService.d.ts +23 -7
- package/core/ConfigService.js +1014 -54
- package/core/ConfigService.min.js +1 -1
- package/{types.d.ts → core/types.d.ts} +7 -5
- package/hooks/useConfig.jsx +23 -16
- package/hooks/useConfig.tsx +26 -18
- package/index.d.ts +17 -0
- package/index.js +896 -0
- package/index.min.js +2 -0
- package/package.json +3 -2
- package/providers/ConfigProvider.jsx +60 -33
- package/providers/ConfigProvider.tsx +121 -79
- package/utils/loaders.d.ts +8 -11
- package/utils/loaders.js +21 -32
- package/utils/loaders.min.js +1 -1
- package/utils.d.ts +23 -0
- package/utils.js +94 -0
- package/utils.min.js +2 -0
- /package/{types.js → core/types.js} +0 -0
- /package/{types.min.js → core/types.min.js} +0 -0
package/config.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const DEFAULT_SCOPE = "app";
|
|
2
|
+
declare const COOKIE_NAME = "app_config_scope";
|
|
3
|
+
type ConfigScope = string;
|
|
2
4
|
interface ConfigMap {
|
|
3
|
-
[
|
|
5
|
+
[scope: string]: () => Promise<Record<string, any>>;
|
|
4
6
|
}
|
|
5
7
|
interface ModuleConfigs {
|
|
6
8
|
[moduleName: string]: () => Promise<Record<string, any>>;
|
|
7
9
|
}
|
|
8
|
-
interface
|
|
9
|
-
base:
|
|
10
|
+
interface ConfigManagerConfig {
|
|
11
|
+
base: {
|
|
12
|
+
[scope: string]: () => Promise<Record<string, any>>;
|
|
13
|
+
};
|
|
10
14
|
modules?: ModuleConfigs;
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
declare
|
|
14
|
-
declare const setConfigManagerConfig: (config: ConfigManagerConfig) => void;
|
|
16
|
+
declare const getSavedScope: () => ConfigScope;
|
|
17
|
+
declare const saveScope: (scope: ConfigScope) => void;
|
|
15
18
|
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
19
|
+
export { COOKIE_NAME, DEFAULT_SCOPE, getSavedScope, saveScope };
|
|
20
|
+
export type { ConfigManagerConfig, ConfigMap, ConfigScope, ModuleConfigs };
|