/** * Sentinel-based "this value must be filled in before deploy" marker. * * Use `todo(reason)` in `defaults` or any `perEnv` branch to declare a * slot you'll fill in later. The loader scans the merged config before * calling `build()`; if any sentinel survives the merge for the env * being loaded, it throws `NodeSettingsError` with code `PER_ENV_TODO`. * * @example * ```ts * import { defineSettings, todo } from "@env-kit/node-settings"; * * defineSettings({ * envSchema, envKey: "APP_ENV", * defaults: { bucket: "" }, * perEnv: { * local: { bucket: "local-bucket" }, * prod: { bucket: todo("set production bucket name before deploy") }, * }, * build: (env, config) => ({ bucket: config.bucket }), * }); * * settings({ APP_ENV: "local", ... }); // ok * settings({ APP_ENV: "prod", ... }); // throws NodeSettingsError (PER_ENV_TODO) * ``` * * Sentinels behave as opaque values inside `deepMerge` — a child * `perEnv` branch can fully replace a parent's sentinel with a real * value. This means `defaults: { bucket: todo("...") }` is a useful * pattern: every per-env branch is *forced* to provide a value. */ /** * Globally registered symbol that marks an object as a todo sentinel. * Using `Symbol.for(...)` keeps the marker stable across module * boundaries (e.g. mixed CJS / ESM situations). */ export declare const TODO_SYMBOL: unique symbol; /** Runtime shape of a todo sentinel. */ export interface TodoSentinel { readonly [k: symbol]: unknown; readonly reason: string; /** * Custom `toJSON` so `JSON.stringify(config)` produces a readable * marker (`{ "$todo": "reason" }`) instead of an opaque object. * Honored automatically by `JSON.stringify`. */ readonly toJSON: () => { $todo: string; }; } /** * Mark a config field as "not yet set; must be filled in before the * env that contains it can be loaded". * * Typed as returning `never` so the result is assignable to any field * type. At runtime it returns a sentinel object that the loader, * `deepMerge`, `checkPerEnvCompleteness`, and the `inspect` CLI all * recognise. */ export declare function todo(reason?: string): never; /** True when `value` is a `todo(...)` sentinel. */ export declare function isTodo(value: unknown): value is TodoSentinel; /** * Recursively scan `value` for any `todo(...)` sentinels and return * their locations. Used by both the loader (to throw before build) * and the `check` CLI (to report across every perEnv branch). */ export declare function findTodos(value: unknown, path?: string): Array<{ path: string; reason: string; }>; //# sourceMappingURL=todo.d.ts.map