import { AbstractValidatableDocument } from '../../contracts/abstract-validatable-document.js'; import { ReasonCode } from '../../contracts/reason-code.js'; /** * Validates Brazilian CNH (Carteira Nacional de Habilitação) numbers. * * Algorithm (DENATRAN): * 1. DV1 (position 10): weighted sum of 9 digits with weights 9..1, mod 11. * If rest > 9 → DV1 = 0 and `firstIsTenPlus` flag is set. * 2. DV2 (position 11): weighted sum of same 9 digits with weights 1..9, mod 11. * If `firstIsTenPlus` is set, subtract 2 from the result (wrapping: if result < 0, add 9). * If final result > 9 → DV2 = 0. */ export declare class CNHValidation extends AbstractValidatableDocument { protected documentName(): string; /** * Generates a valid CNH. * * The DV algorithm has overflow adjustments that are awkward to invert, so we * pick a random 9-digit base and scan the 100 possible check-digit pairs for * the one that validates — always exactly one exists. CNH has no canonical * mask, so there is no `formatted` option. */ static generate(): string; protected doValidate(): ReasonCode | null; }