import type { IConstruct } from "constructs"; /** * Inputs to {@link resolveAlarmThresholdBasis}. * * @typeParam T - The input value's type (e.g. `Duration`, `number`). */ export interface AlarmThresholdBasisOptions { /** Construct to annotate when the alarm is skipped. */ scope: IConstruct; /** * The value the alarm threshold is derived from. May be `undefined` (the * input was simply not configured) or an unresolved token (e.g. threaded * through a `CfnParameter`). */ value: T | undefined; /** * Converts a known-resolved `value` into the numeric basis for the threshold * (e.g. `(d) => d.toMilliseconds()`, or the identity for a raw number). Only * invoked once `value` is confirmed present and resolved, so it is safe to * call conversions that throw on tokens. */ resolve: (value: T) => number; /** * Predicate deciding whether `value` is an unresolved token. Defaults to * {@link Token.isUnresolved}. Override for wrapper types that carry their own * check rather than being a token directly — notably a CDK `Duration`, whose * token state is exposed via `value.isUnresolved()`. */ isUnresolved?: (value: T) => boolean; /** * Stable warning identifier, also the handle callers pass to * `Annotations.of(scope).acknowledgeWarning(...)` to suppress it. By * convention `@composurecdk/:`. */ warningId: string; /** * Human-readable name of the alarm being skipped, interpolated into the * warning (e.g. `"Lambda duration"`). Phrase it to read after * "Skipping the recommended ". */ alarmLabel: string; /** * How a caller can intentionally suppress the warning, interpolated into the * warning's closing sentence (e.g. `"recommendedAlarms({ duration: false })"`). */ suppressHint: string; } /** * Resolves the numeric basis for a derived-threshold alarm, short-circuiting * when the basis cannot be known at synth time. * * Recommended alarms whose threshold is a function of a configured input (a * percentage of a timeout, of a reserved-concurrency limit, etc.) can only be * rendered when that input is concrete. When the input is an unresolved token — * e.g. a value threaded through a `CfnParameter` — there is no number to derive * from at synth time, and unit-converting it would either throw or silently * produce a meaningless threshold. In that case this annotates `scope` with a * standardized, acknowledgeable warning and returns `undefined`, signalling the * caller to omit the alarm. * * Returns `undefined` (without warning) when `value` is `undefined`, since an * unconfigured input is not a skipped guardrail. The escape hatch that disables * the alarm entirely (e.g. `recommendedAlarms({ duration: false })`) belongs at * the call site, ahead of this call. * * @returns The resolved numeric basis, or `undefined` when the alarm should be * omitted. * @see https://github.com/laazyj/composureCDK/issues/196 */ export declare function resolveAlarmThresholdBasis(opts: AlarmThresholdBasisOptions): number | undefined; //# sourceMappingURL=alarm-threshold-basis.d.ts.map