@h3ravel/config 1.3.7 → 1.4.0

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/dist/index.d.cts CHANGED
@@ -1,33 +1,220 @@
1
- import { DotNestedKeys, DotNestedValue } from '@h3ravel/support';
2
- import { Application, ServiceProvider } from '@h3ravel/core';
1
+ import { DotNestedKeys, DotNestedValue, PathLoader } from "@h3ravel/shared";
3
2
 
3
+ //#region ../core/dist/index.d.ts
4
+ declare var Application: {
5
+ new (basePath: any): {
6
+ paths: PathLoader;
7
+ tries: number;
8
+ booted: boolean;
9
+ versions: {
10
+ app: string;
11
+ ts: string;
12
+ };
13
+ basePath: any;
14
+ providers: any[];
15
+ externalProviders: any[];
16
+ /**
17
+ * List of registered console commands
18
+ */
19
+ registeredCommands: any[];
20
+ /**
21
+ * Register core bindings into the container
22
+ */
23
+ registerBaseBindings(): void;
24
+ /**
25
+ * Dynamically register all configured providers
26
+ */
27
+ registerConfiguredProviders(): Promise<void>;
28
+ loadOptions(): Promise<void>;
29
+ /**
30
+ * Get all registered providers
31
+ */
32
+ getRegisteredProviders(): any[];
33
+ /**
34
+ * Load default and optional providers dynamically
35
+ *
36
+ * Auto-Registration Behavior
37
+ *
38
+ * Minimal App: Loads only core, config, http, router by default.
39
+ * Full-Stack App: Installs database, mail, queue, cache → they self-register via their providers.
40
+ */
41
+ getConfiguredProviders(): Promise<typeof CoreServiceProvider[]>;
42
+ getAllProviders(): Promise<any>;
43
+ sortProviders(providers: any): any;
44
+ registerProviders(providers: any): void;
45
+ /**
46
+ * Register a provider
47
+ */
48
+ register(provider: any): Promise<void>;
49
+ /**
50
+ * checks if the application is running in CLI
51
+ */
52
+ runningInConsole(): boolean;
53
+ getRuntimeEnv(): "browser" | "node" | "unknown";
54
+ /**
55
+ * Boot all service providers after registration
56
+ */
57
+ boot(): Promise<void>;
58
+ /**
59
+ * Fire up the developement server using the user provided arguments
60
+ *
61
+ * Port will be auto assigned if provided one is not available
62
+ *
63
+ * @param h3App The current H3 app instance
64
+ * @param preferedPort If provided, this will overide the port set in the evironment
65
+ */
66
+ fire(h3App: any, preferedPort: any): Promise<void>;
67
+ /**
68
+ * Attempt to dynamically import an optional module
69
+ */
70
+ safeImport(moduleName: any): Promise<any>;
71
+ /**
72
+ * Get the base path of the app
73
+ *
74
+ * @returns
75
+ */
76
+ getBasePath(): any;
77
+ /**
78
+ * Dynamically retrieves a path property from the class.
79
+ * Any property ending with "Path" is accessible automatically.
80
+ *
81
+ * @param name - The base name of the path property
82
+ * @returns
83
+ */
84
+ getPath(name: any, suffix: any): string;
85
+ /**
86
+ * Programatically set the paths.
87
+ *
88
+ * @param name - The base name of the path property
89
+ * @param path - The new path
90
+ * @returns
91
+ */
92
+ setPath(name: any, path$1: any): void;
93
+ /**
94
+ * Returns the installed version of the system core and typescript.
95
+ *
96
+ * @returns
97
+ */
98
+ getVersion(key: any): any;
99
+ bindings: Map<any, any>;
100
+ singletons: Map<any, any>;
101
+ bind(key: any, factory: any): void;
102
+ /**
103
+ * Bind a singleton service to the container
104
+ */
105
+ singleton(key: any, factory: any): void;
106
+ /**
107
+ * Resolve a service from the container
108
+ */
109
+ make(key: any): any;
110
+ /**
111
+ * Automatically build a class with constructor dependency injection
112
+ */
113
+ build(ClassType: any): any;
114
+ /**
115
+ * Check if a service is registered
116
+ */
117
+ has(key: any): boolean;
118
+ };
119
+ /**
120
+ * Check if the target has any decorators
121
+ *
122
+ * @param target
123
+ * @returns
124
+ */
125
+ hasAnyDecorator(target: any): boolean;
126
+ };
127
+ /**
128
+ * Bootstraps core services and bindings.
129
+ *
130
+ * Bind essential services to the container (logger, config repository).
131
+ * Register app-level singletons.
132
+ * Set up exception handling.
133
+ *
134
+ * Auto-Registered
135
+ */
136
+ declare var CoreServiceProvider: {
137
+ new (app: any): {
138
+ register(): void;
139
+ /**
140
+ * List of registered console commands
141
+ */
142
+ registeredCommands: any;
143
+ app: any;
144
+ /**
145
+ * An array of console commands to register.
146
+ */
147
+ commands(commands: any): void;
148
+ };
149
+ priority: number;
150
+ /**
151
+ * Sort order
152
+ */
153
+ order: any;
154
+ /**
155
+ * Indicate that this service provider only runs in console
156
+ */
157
+ console: boolean;
158
+ };
159
+ declare var ServiceProvider: {
160
+ new (app: any): {
161
+ /**
162
+ * List of registered console commands
163
+ */
164
+ registeredCommands: any;
165
+ app: any;
166
+ /**
167
+ * An array of console commands to register.
168
+ */
169
+ commands(commands: any): void;
170
+ };
171
+ /**
172
+ * Sort order
173
+ */
174
+ order: any;
175
+ /**
176
+ * Sort priority
177
+ */
178
+ priority: number;
179
+ /**
180
+ * Indicate that this service provider only runs in console
181
+ */
182
+ console: boolean;
183
+ };
184
+ //#endregion
185
+ //#region src/ConfigRepository.d.ts
4
186
  declare class ConfigRepository {
5
- protected app: Application;
6
- private loaded;
7
- private configs;
8
- constructor(app: Application);
9
- /**
10
- * Get the defined configurations
11
- */
12
- get<X extends Record<string, any>>(): X;
13
- get<X extends Record<string, any>, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
14
- /**
15
- * Modify the defined configurations
16
- */
17
- set<T extends string>(key: T, value: any): void;
18
- load(): Promise<this>;
187
+ protected app: Application;
188
+ private loaded;
189
+ private configs;
190
+ constructor(app: Application);
191
+ /**
192
+ * Get the defined configurations
193
+ */
194
+ get<X extends Record<string, any>>(): X;
195
+ get<X extends Record<string, any>, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
196
+ /**
197
+ * Modify the defined configurations
198
+ */
199
+ set<T extends string>(key: T, value: any): void;
200
+ load(): Promise<this>;
19
201
  }
20
-
202
+ //#endregion
203
+ //#region src/EnvLoader.d.ts
21
204
  declare class EnvLoader {
22
- protected _app: Application;
23
- constructor(_app: Application);
24
- /**
25
- * Get the defined environment vars
26
- */
27
- get<X extends NodeJS.ProcessEnv>(): X;
28
- get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
205
+ protected _app: Application;
206
+ constructor(_app: Application);
207
+ /**
208
+ * Get the defined environment vars
209
+ */
210
+ get<X extends NodeJS.ProcessEnv>(): X;
211
+ get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
29
212
  }
30
-
213
+ //#endregion
214
+ //#region src/Helpers.d.ts
215
+ declare class Helpers {}
216
+ //#endregion
217
+ //#region src/Providers/ConfigServiceProvider.d.ts
31
218
  /**
32
219
  * Loads configuration and environment files.
33
220
  *
@@ -37,8 +224,9 @@ declare class EnvLoader {
37
224
  * Auto-Registered
38
225
  */
39
226
  declare class ConfigServiceProvider extends ServiceProvider {
40
- static priority: number;
41
- register(): Promise<void>;
227
+ static priority: number;
228
+ register(): Promise<void>;
42
229
  }
43
-
44
- export { ConfigRepository, ConfigServiceProvider, EnvLoader };
230
+ //#endregion
231
+ export { ConfigRepository, ConfigServiceProvider, EnvLoader, Helpers };
232
+ //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,33 +1,220 @@
1
- import { DotNestedKeys, DotNestedValue } from '@h3ravel/support';
2
- import { Application, ServiceProvider } from '@h3ravel/core';
1
+ import { DotNestedKeys, DotNestedValue, PathLoader } from "@h3ravel/shared";
3
2
 
3
+ //#region ../core/dist/index.d.ts
4
+ declare var Application: {
5
+ new (basePath: any): {
6
+ paths: PathLoader;
7
+ tries: number;
8
+ booted: boolean;
9
+ versions: {
10
+ app: string;
11
+ ts: string;
12
+ };
13
+ basePath: any;
14
+ providers: any[];
15
+ externalProviders: any[];
16
+ /**
17
+ * List of registered console commands
18
+ */
19
+ registeredCommands: any[];
20
+ /**
21
+ * Register core bindings into the container
22
+ */
23
+ registerBaseBindings(): void;
24
+ /**
25
+ * Dynamically register all configured providers
26
+ */
27
+ registerConfiguredProviders(): Promise<void>;
28
+ loadOptions(): Promise<void>;
29
+ /**
30
+ * Get all registered providers
31
+ */
32
+ getRegisteredProviders(): any[];
33
+ /**
34
+ * Load default and optional providers dynamically
35
+ *
36
+ * Auto-Registration Behavior
37
+ *
38
+ * Minimal App: Loads only core, config, http, router by default.
39
+ * Full-Stack App: Installs database, mail, queue, cache → they self-register via their providers.
40
+ */
41
+ getConfiguredProviders(): Promise<typeof CoreServiceProvider[]>;
42
+ getAllProviders(): Promise<any>;
43
+ sortProviders(providers: any): any;
44
+ registerProviders(providers: any): void;
45
+ /**
46
+ * Register a provider
47
+ */
48
+ register(provider: any): Promise<void>;
49
+ /**
50
+ * checks if the application is running in CLI
51
+ */
52
+ runningInConsole(): boolean;
53
+ getRuntimeEnv(): "browser" | "node" | "unknown";
54
+ /**
55
+ * Boot all service providers after registration
56
+ */
57
+ boot(): Promise<void>;
58
+ /**
59
+ * Fire up the developement server using the user provided arguments
60
+ *
61
+ * Port will be auto assigned if provided one is not available
62
+ *
63
+ * @param h3App The current H3 app instance
64
+ * @param preferedPort If provided, this will overide the port set in the evironment
65
+ */
66
+ fire(h3App: any, preferedPort: any): Promise<void>;
67
+ /**
68
+ * Attempt to dynamically import an optional module
69
+ */
70
+ safeImport(moduleName: any): Promise<any>;
71
+ /**
72
+ * Get the base path of the app
73
+ *
74
+ * @returns
75
+ */
76
+ getBasePath(): any;
77
+ /**
78
+ * Dynamically retrieves a path property from the class.
79
+ * Any property ending with "Path" is accessible automatically.
80
+ *
81
+ * @param name - The base name of the path property
82
+ * @returns
83
+ */
84
+ getPath(name: any, suffix: any): string;
85
+ /**
86
+ * Programatically set the paths.
87
+ *
88
+ * @param name - The base name of the path property
89
+ * @param path - The new path
90
+ * @returns
91
+ */
92
+ setPath(name: any, path$1: any): void;
93
+ /**
94
+ * Returns the installed version of the system core and typescript.
95
+ *
96
+ * @returns
97
+ */
98
+ getVersion(key: any): any;
99
+ bindings: Map<any, any>;
100
+ singletons: Map<any, any>;
101
+ bind(key: any, factory: any): void;
102
+ /**
103
+ * Bind a singleton service to the container
104
+ */
105
+ singleton(key: any, factory: any): void;
106
+ /**
107
+ * Resolve a service from the container
108
+ */
109
+ make(key: any): any;
110
+ /**
111
+ * Automatically build a class with constructor dependency injection
112
+ */
113
+ build(ClassType: any): any;
114
+ /**
115
+ * Check if a service is registered
116
+ */
117
+ has(key: any): boolean;
118
+ };
119
+ /**
120
+ * Check if the target has any decorators
121
+ *
122
+ * @param target
123
+ * @returns
124
+ */
125
+ hasAnyDecorator(target: any): boolean;
126
+ };
127
+ /**
128
+ * Bootstraps core services and bindings.
129
+ *
130
+ * Bind essential services to the container (logger, config repository).
131
+ * Register app-level singletons.
132
+ * Set up exception handling.
133
+ *
134
+ * Auto-Registered
135
+ */
136
+ declare var CoreServiceProvider: {
137
+ new (app: any): {
138
+ register(): void;
139
+ /**
140
+ * List of registered console commands
141
+ */
142
+ registeredCommands: any;
143
+ app: any;
144
+ /**
145
+ * An array of console commands to register.
146
+ */
147
+ commands(commands: any): void;
148
+ };
149
+ priority: number;
150
+ /**
151
+ * Sort order
152
+ */
153
+ order: any;
154
+ /**
155
+ * Indicate that this service provider only runs in console
156
+ */
157
+ console: boolean;
158
+ };
159
+ declare var ServiceProvider: {
160
+ new (app: any): {
161
+ /**
162
+ * List of registered console commands
163
+ */
164
+ registeredCommands: any;
165
+ app: any;
166
+ /**
167
+ * An array of console commands to register.
168
+ */
169
+ commands(commands: any): void;
170
+ };
171
+ /**
172
+ * Sort order
173
+ */
174
+ order: any;
175
+ /**
176
+ * Sort priority
177
+ */
178
+ priority: number;
179
+ /**
180
+ * Indicate that this service provider only runs in console
181
+ */
182
+ console: boolean;
183
+ };
184
+ //#endregion
185
+ //#region src/ConfigRepository.d.ts
4
186
  declare class ConfigRepository {
5
- protected app: Application;
6
- private loaded;
7
- private configs;
8
- constructor(app: Application);
9
- /**
10
- * Get the defined configurations
11
- */
12
- get<X extends Record<string, any>>(): X;
13
- get<X extends Record<string, any>, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
14
- /**
15
- * Modify the defined configurations
16
- */
17
- set<T extends string>(key: T, value: any): void;
18
- load(): Promise<this>;
187
+ protected app: Application;
188
+ private loaded;
189
+ private configs;
190
+ constructor(app: Application);
191
+ /**
192
+ * Get the defined configurations
193
+ */
194
+ get<X extends Record<string, any>>(): X;
195
+ get<X extends Record<string, any>, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
196
+ /**
197
+ * Modify the defined configurations
198
+ */
199
+ set<T extends string>(key: T, value: any): void;
200
+ load(): Promise<this>;
19
201
  }
20
-
202
+ //#endregion
203
+ //#region src/EnvLoader.d.ts
21
204
  declare class EnvLoader {
22
- protected _app: Application;
23
- constructor(_app: Application);
24
- /**
25
- * Get the defined environment vars
26
- */
27
- get<X extends NodeJS.ProcessEnv>(): X;
28
- get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
205
+ protected _app: Application;
206
+ constructor(_app: Application);
207
+ /**
208
+ * Get the defined environment vars
209
+ */
210
+ get<X extends NodeJS.ProcessEnv>(): X;
211
+ get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>>(key: K, def?: any): DotNestedValue<X, K>;
29
212
  }
30
-
213
+ //#endregion
214
+ //#region src/Helpers.d.ts
215
+ declare class Helpers {}
216
+ //#endregion
217
+ //#region src/Providers/ConfigServiceProvider.d.ts
31
218
  /**
32
219
  * Loads configuration and environment files.
33
220
  *
@@ -37,8 +224,9 @@ declare class EnvLoader {
37
224
  * Auto-Registered
38
225
  */
39
226
  declare class ConfigServiceProvider extends ServiceProvider {
40
- static priority: number;
41
- register(): Promise<void>;
227
+ static priority: number;
228
+ register(): Promise<void>;
42
229
  }
43
-
44
- export { ConfigRepository, ConfigServiceProvider, EnvLoader };
230
+ //#endregion
231
+ export { ConfigRepository, ConfigServiceProvider, EnvLoader, Helpers };
232
+ //# sourceMappingURL=index.d.ts.map