Interface ConfigInstance<T>

Represents the schema of the configuration object.

interface ConfigInstance<T> {
    get: <TPath extends string>(
        path: TPath,
    ) => GetFieldType<T, TPath, "Path">;
    getAll: () => T;
    getConfigParts: () => {
        config: object;
        envConfig: object;
        localConfig: object;
    };
    getResolvedOptions: () => BaseOptions;
    initializeMetrics: (registry: Registry) => void;
}

Type Parameters

  • T

    The type of the configuration schema.

Properties

get: <TPath extends string>(path: TPath) => GetFieldType<T, TPath, "Path">

Retrieves the value at the specified path from the configuration object.

Type declaration

    • <TPath extends string>(path: TPath): GetFieldType<T, TPath, "Path">
    • Type Parameters

      • TPath extends string

        The type of the path.

      Parameters

      • path: TPath

        The path to the desired value.

      Returns GetFieldType<T, TPath, "Path">

      The value at the specified path.

getAll: () => T

Retrieves the entire configuration object.

Type declaration

    • (): T
    • Returns T

      The entire configuration object.

getConfigParts: () => { config: object; envConfig: object; localConfig: object }

Retrieves different parts of the configuration object before being merged and validated.

Type declaration

    • (): { config: object; envConfig: object; localConfig: object }
    • Returns { config: object; envConfig: object; localConfig: object }

      An object containing the localConfig, config, and envConfig parts of the configuration.

getResolvedOptions: () => BaseOptions

Retrieves the resolved options from the configuration object.

Type declaration

    • (): BaseOptions
    • Returns BaseOptions

      The resolved options.

initializeMetrics: (registry: Registry) => void

Initializes the metrics for the configuration object.

Type declaration

    • (registry: Registry): void
    • Parameters

      • registry: Registry

        The registry for the metrics.

      Returns void