Skip to content

Commit f14f781

Browse files
committed
docs: more jsdocs
1 parent 81708ed commit f14f781

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app-config-main/src/index.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const assertLoaded = () => {
2323
return loadedConfig;
2424
};
2525

26+
/**
27+
* Reads and validates app-config, using the default loading strategy.
28+
* Same as `loadValidatedConfig` but stores loaded config in the `config` export.
29+
*/
2630
export async function loadConfig(
2731
options?: ConfigLoadingOptions,
2832
schemaOptions?: SchemaLoadingOptions,
@@ -42,6 +46,11 @@ export async function loadConfig(
4246
return config;
4347
}
4448

49+
/**
50+
* Singleton for loaded configuration, when `loadConfig` has completed successfully.
51+
*
52+
* Reading properties on this object before `loadConfig` completes will throw errors.
53+
*/
4554
export const config: ExportedConfig = new Proxy(
4655
{
4756
APP_CONFIG_WAS_NOT_LOADED_YET_LOOK_AT_THE_DOCS: true,
@@ -81,7 +90,7 @@ export const config: ExportedConfig = new Proxy(
8190
export default config;
8291

8392
/**
84-
* Only available when using @app-config/webpack. Validates configuration using AJV.
93+
* ONLY available when using @app-config/webpack. Validates configuration using AJV.
8594
*/
8695
export const validateConfig: ValidateFunction<ExportedConfig> = null as any; // eslint-disable-line
8796

@@ -138,7 +147,7 @@ export {
138147
defaultMetaExtensions,
139148
} from '@app-config/default-extensions';
140149

141-
/** @hidden */
150+
/** @hidden Please don't rely on this. */
142151
export function resetConfigInternal() {
143152
loadedConfig = undefined;
144153
}

0 commit comments

Comments
 (0)