@map-colonies/config
    Preparing search index...

    Interface ConfigInstance<T>

    Represents the schema of the configuration object.

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

    Type Parameters

    • T

      The type of the configuration schema.

    Index

    Properties

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

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

    Type Declaration

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

        • TPath extends string

          The type of the path.

        Parameters

        • path: TPath

          The path to the desired value.

        Returns GetFieldType<T, TPath>

        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