/** * @file Dependency.ts * @author Gage Sorrell * @copyright (c) 2026 Gage Sorrell * @license MIT */ import type { DependencyLogger, TRuntimeModeProductionOptions } from "./Dependency.Types.ts"; /** * Guess whether the current session is in *production mode* by, * * 1. If the function did not already return in Step 1, then {@link process.env} is checked for * a property with key `"NODE_ENV"`. * - If there exists a property with this key, and if `process.env["NODE_ENV"] === "production"` * (or similar; see below), then this returns `true`. * 2. If the function did not already return in Step 2, then `true` is returned. * * @note If Step 2 is executed, then this returns `true` when `process.env["NODE_ENV"].toLowerCase()` * is any one of, * - `"production"` * - `"prod"` * * @returns {boolean} Whether the current session is likely in *production mode*, or, * if unsure, `true` is returned. */ export declare function IsRuntimeModeProduction(): boolean; /** * Guess whether the current session is in *production mode* by, * * 1. If a {@link DebugEnvironmentVariable} is given, then {@link process.env} * is checked for the existence of a property having this key. * - If the property exists and is in {@link TruthyValues}, then this function returns `true`. * - If the property exists but is in {@link TruthyValues}, then this returns `false`. * 2. If the function did not already return in Step 1, then {@link process.env} is checked for * a property with key `"NODE_ENV"`. * - If there exists a property with this key, and if `process.env["NODE_ENV"] === "production"` * (or similar; see below), then this returns `true`. * 3. If the function did not already return in Step 2, then {@link UncertainValue} is returned. * By default, this is `true`, but any value of any type can be used. * * @template UncertainType - The type of the {@link UncertainValue}. By default, this is `boolean`. * * @param Options - The {@link TRuntimeModeProductionOptions} options object. All properties are optional. * * @note If Step 2 is executed, then this returns `true` when `process.env["NODE_ENV"].toLowerCase()` * is any one of, * - `"production"` * - `"prod"` * * @returns {boolean | typeof UncertainValue} Whether the current session is likely in *production mode*, or, * if unsure, the given {@link UncertainValue} is returned (by default, this is `true`). */ export declare function IsRuntimeModeProduction(Options: TRuntimeModeProductionOptions): boolean | Exclude; /** * This patches the default logger so that the statements that are logged by your dependency package * do not overwhelm or annoy the consuming developer. * * {@link IsDependentModeProduction} is used to determine whether to return a no-op * (iff `true`), or a function that wraps {@link Console} (iff `false`). * * @param PackageName - The name of your package. It is strongly recommended, but not *enforced*, * that this is exactly the `name` in your `package.json`. Statements logged under this * {@link Layer.Layer | Layer} are prefixed with `[${ PackageName }]`. * * @param SuppressLoggerFrequency - When {@link SuppressLoggerFrequency} statements have been logged, * a short message is *also* logged, explaining how to suppress output from your package. * * @param SuppressLogEnvironmentVariable - If specified, this is the environment variable name passed to * {@link IsDependentModeProduction} to determine whether the logger will be a no-op. * * @returns {Layer.Layer} A {@link Layer.Layer | Layer} that provides the {@link DependencyLogger} * with the {@link PackageName}. */ export declare function GetDependencyLogger(PackageName: string, SuppressLoggerFrequency?: number, SuppressLogEnvironmentVariable?: string | undefined): DependencyLogger; //# sourceMappingURL=Dependency.d.ts.map