import type { ValidationError } from './types.js'; /** * A single outlet a control's native/Strato messages can render in. `'field'` is * the control's own `FormField`; `'form'` is the enclosing form's form-wide * messages outlet. `'group'` is reserved for the deferred group feature. Use an * array to mirror a message to several outlets. * @public */ export type MessageTarget = 'field' | 'form'; /** * The outlet a control's messages render in when `messageTarget` is not set. * @public */ export declare const DEFAULT_MESSAGE_TARGET: MessageTarget; /** * Normalizes the `messageTarget` shorthand to a de-duplicated array. `undefined` * (and an empty array) resolve to the default `['field']`. * @internal */ export declare function normalizeMessageTarget(target: MessageTarget | MessageTarget[] | undefined): MessageTarget[]; /** * A {@link ValidationError} annotated with the outlet(s) it should render in. The * annotation rides the emit path; it is NOT part of the base `ValidationError` * class contract, so the shared type every control emits stays unchanged. * @internal */ export type RoutedValidationError = ValidationError & { readonly targetOutlet?: readonly MessageTarget[]; }; /** * Returns a copy of the emitted error annotated with its resolved routing * outlets, without mutating the input or changing the base class (the copy keeps * the original's prototype, `message`, and `stack`). Only native/Strato messages * are ever routed; consumer-authored errors are left unannotated so they keep * placing themselves. * @internal */ export declare function withTargetOutlet(error: ValidationError, targetOutlet: readonly MessageTarget[]): RoutedValidationError; /** * Whether a (possibly annotated) error routes to the given outlet. Unannotated * errors follow the default (`'field'`), so form-validator, manual, and * consumer-authored errors are unaffected by routing. * @internal */ export declare function routesTo(error: ValidationError, outlet: MessageTarget): boolean; //# sourceMappingURL=message-routing.d.ts.map