/** * @module ConfigAccessor */ import type { Get, Paths } from "type-fest"; import { type OneOrArray, type UndefinedToNull } from "../../utilities/_module.js"; /** * @group Contracts */ export type FieldConfigValue = string | number | boolean; /** * @group Contracts */ export type BaseConfig = Partial>>>>; /** * @group Contracts */ export declare function defineConfig(config: TConfig): TConfig; /** * @group contracts */ export type RestrictedPaths = Paths; /** * @group contracts */ export type PathValue = UndefinedToNull>; /** * `IConfigAccessor` provides type-safe access to configuration objects. * * @group Contracts */ export type IConfigAccessor = { /** * Get a value from the config, or null if missing/undefined. * * @param path The config value path to retrieve. * @returns The value or null if not present. */ get>(path: TPath): PathValue; /** * Get a value from the config, or return default value. * * @param path The config value path to retrieve. * @param defaultValue The default value when not found. * @returns The value or default value. */ getOr>(path: TPath, defaultValue: NonNullable>): NonNullable>; };