import type { Request } from 'express'; import type { RuleMap } from '../../validation/validate.js'; import type { ValidationMessages } from '../../validation/ValidationMessages.js'; /** * Base class for typed HTTP requests with {@link rules} and optional {@link messages}. * * Typical usage: * `const data = (await StoreUserRequest.validate()).validated();` */ export declare abstract class FormRequest { protected readonly req: Request; private validatedData; constructor(req: Request); /** * Determine if the user is authorized to make this request. */ authorize(): boolean | Promise; /** * Validation rules (pipe-delimited rule strings). */ abstract rules(): RuleMap; /** * Optional custom messages (flat `attribute.rule` and/or nested per field). */ messages(): ValidationMessages; /** * Data source for validation (merged `params`, `query`, `body` — same as `request().validate()`). */ validationData(): unknown; /** * Return the validated payload. * * @throws Error when called before {@link validateSelf}. */ validated = Record>(): T; /** * Validate this instance and store the validated data. * * @throws ValidationException on validation failure. * @throws Error when not authorized. */ validateSelf(): Promise; /** * Create and validate a request instance using the current HTTP context. */ static validate(this: new (req: Request) => T): Promise; } //# sourceMappingURL=FormRequest.d.ts.map