import { F as FeatureFlags, E as EmailOptions } from "../../packem_shared/types.d-CyiC9uRC.js"; import 'node:buffer'; /** * A single capability that a message uses but the target provider cannot represent. */ interface FeatureViolation { /** * The provider capability flag that is not supported. */ feature: keyof FeatureFlags; /** * The message field that triggered the check. */ field: string; /** * Human-readable explanation of the violation. */ message: string; } /** * Result of a fail-fast provider capability check. */ interface FeatureSupportResult { /** * True when the message uses no capability the provider has explicitly disabled. */ supported: boolean; /** * The list of capabilities the message uses that the provider cannot represent. */ violations: FeatureViolation[]; } /** * Performs a fail-fast field-support check for a message against a provider's declared capabilities. * * A capability counts as a violation only when the message actually uses it **and** the provider * has explicitly declared it unsupported (`features[capability] === false`). Capabilities left * `undefined` are treated as "unknown" and never raise a violation, so providers that publish a * partial (or no) {@link FeatureFlags} map are never falsely rejected. * @param options The normalized email options about to be sent. * @param features The target provider's declared capabilities. When omitted the check is a no-op. * @returns A {@link FeatureSupportResult} describing any unsupported capabilities in use. * @example * ```ts * const { supported, violations } = checkFeatureSupport(message, provider.features); * * if (!supported) { * throw new Error(violations.map((v) => v.message).join(", ")); * } * ``` */ declare function checkFeatureSupport(options: EmailOptions, features?: FeatureFlags): FeatureSupportResult; export { FeatureSupportResult, FeatureViolation, checkFeatureSupport as default };