type DocumentFormat = 'numeric' | 'alphanumeric' | 'legacy' | 'mercosul' | 'email' | 'phone' | 'evp' | 'linha-digitavel' | 'codigo-barras' | 'cartao-credito' | 'ean-8' | 'ean-13' | 'inscricao-estadual' | 'inscricao-estadual-produtor-rural' | 'telefone' | 'brcode' | 'arrecadacao' | 'rg'; type PixKeyType = 'cpf' | 'cnpj' | 'email' | 'phone' | 'evp'; type TelefoneTipo = 'celular' | 'fixo'; type BoletoInputKind = 'linha-digitavel' | 'codigo-barras' | 'arrecadacao-linha' | 'arrecadacao-codigo-barras'; type ValidationErrorCode = 'INVALID_LENGTH' | 'INVALID_CHARACTER' | 'INVALID_CHECK_DIGIT' | 'KNOWN_INVALID_PATTERN' | 'UNSUPPORTED_FORMAT' | 'EMPTY_INPUT' | 'UF_NOT_IMPLEMENTED'; type ValidationResult = { ok: true; value: T; format: DocumentFormat; } | { ok: false; code: ValidationErrorCode; message: string; }; type FormatResult = { ok: true; formatted: string; } | { ok: false; code: ValidationErrorCode; message: string; }; type Cnpj = string & { readonly __brand: 'Cnpj'; }; type Cpf = string & { readonly __brand: 'Cpf'; }; type Cnh = string & { readonly __brand: 'Cnh'; }; type Renavam = string & { readonly __brand: 'Renavam'; }; type TituloEleitor = string & { readonly __brand: 'TituloEleitor'; }; type NfeChave = string & { readonly __brand: 'NfeChave'; }; type ProcessoJudicial = string & { readonly __brand: 'ProcessoJudicial'; }; type Cep = string & { readonly __brand: 'Cep'; }; type Placa = string & { readonly __brand: 'Placa'; }; type PisPasep = string & { readonly __brand: 'PisPasep'; }; type Nit = string & { readonly __brand: 'Nit'; }; type NitIssuer = 'inss' | 'caixa'; type NitTipo = 'nit' | 'pis' | 'nis'; type NitValidationResult = { ok: true; value: Nit; format: 'numeric'; issuer: NitIssuer; tipo: NitTipo; } | { ok: false; code: ValidationErrorCode; message: string; }; type PixKey = string & { readonly __brand: 'PixKey'; }; type LinhaDigitavel = string & { readonly __brand: 'LinhaDigitavel'; }; type CodigoBarras = string & { readonly __brand: 'CodigoBarras'; }; type Arrecadacao = string & { readonly __brand: 'Arrecadacao'; }; type CartaoCredito = string & { readonly __brand: 'CartaoCredito'; }; type Ean = string & { readonly __brand: 'Ean'; }; type InscricaoEstadual = string & { readonly __brand: 'InscricaoEstadual'; }; type InscricaoEstadualProdutorRural = string & { readonly __brand: 'InscricaoEstadualProdutorRural'; }; type Rg = string & { readonly __brand: 'Rg'; }; type Telefone = string & { readonly __brand: 'Telefone'; }; type BrCodePayload = string & { readonly __brand: 'BrCodePayload'; }; type UfCode = 'AC' | 'AL' | 'AM' | 'AP' | 'BA' | 'CE' | 'DF' | 'ES' | 'GO' | 'MA' | 'MG' | 'MS' | 'MT' | 'PA' | 'PB' | 'PE' | 'PI' | 'PR' | 'RJ' | 'RN' | 'RO' | 'RR' | 'RS' | 'SC' | 'SE' | 'SP' | 'TO'; /** Phase-1 RG UFs with implemented validators. */ type RgUfCode = 'SP' | 'RJ' | 'MG' | 'PR' | 'RS' | 'SC' | 'BA' | 'AC' | 'AL' | 'AM' | 'AP' | 'DF' | 'ES' | 'GO' | 'MA' | 'MS' | 'MT' | 'PA' | 'PB' | 'CE' | 'PE' | 'PI' | 'RN' | 'RO' | 'RR' | 'SE' | 'TO'; type CardBrand = 'visa' | 'mastercard' | 'amex' | 'elo' | 'hipercard' | 'unknown'; type CartaoCreditoValidationResult = { ok: true; value: CartaoCredito; format: 'cartao-credito'; brand: CardBrand; } | { ok: false; code: ValidationErrorCode; message: string; brand?: CardBrand; }; type EanValidationResult = { ok: true; value: Ean; format: 'ean-8' | 'ean-13'; } | { ok: false; code: ValidationErrorCode; message: string; }; type PixValidationResult = { ok: true; value: PixKey; keyType: PixKeyType; format: DocumentFormat; } | { ok: false; code: ValidationErrorCode; message: string; keyType?: PixKeyType; }; type BoletoSituacao = '1' | '2'; type CobrancaBoletoValidationResult = { ok: true; value: LinhaDigitavel; inputKind: 'linha-digitavel'; format: 'linha-digitavel'; situacao: BoletoSituacao; } | { ok: true; value: CodigoBarras; inputKind: 'codigo-barras'; format: 'codigo-barras'; situacao: BoletoSituacao; } | { ok: false; code: ValidationErrorCode; message: string; inputKind?: BoletoInputKind; }; type CobrancaBoletoFailureResult = Extract; type LinhaDigitavelValidationResult = Extract | CobrancaBoletoFailureResult; type CodigoBarrasValidationResult = Extract | CobrancaBoletoFailureResult; type BoletoValidationResult = { ok: true; value: LinhaDigitavel; inputKind: 'linha-digitavel'; format: 'linha-digitavel'; situacao: BoletoSituacao; } | { ok: true; value: CodigoBarras; inputKind: 'codigo-barras'; format: 'codigo-barras'; situacao: BoletoSituacao; } | { ok: true; value: Arrecadacao; inputKind: 'arrecadacao-linha' | 'arrecadacao-codigo-barras'; format: 'arrecadacao'; segment: string; valueType: '6' | '7' | '8' | '9'; } | { ok: false; code: ValidationErrorCode; message: string; inputKind?: BoletoInputKind; }; type InscricaoEstadualValidationResult = { ok: true; value: InscricaoEstadual; uf: UfCode; format: 'inscricao-estadual'; } | { ok: false; code: ValidationErrorCode; message: string; uf?: UfCode; }; type IeProdutorRuralValidationResult = { ok: true; value: InscricaoEstadualProdutorRural; uf: 'SP'; format: 'inscricao-estadual-produtor-rural'; } | { ok: false; code: ValidationErrorCode; message: string; uf?: UfCode; }; type RgValidationResult = { ok: true; value: Rg; uf: RgUfCode; format: DocumentFormat; checkDigitValidated: boolean; } | { ok: false; code: ValidationErrorCode; message: string; uf?: RgUfCode; }; type TituloEleitorValidationResult = { ok: true; value: TituloEleitor; format: 'numeric'; ufCode: number; uf?: UfCode; exterior?: true; } | { ok: false; code: ValidationErrorCode; message: string; ufCode?: number; }; type NfeChaveParsed = { cUF: string; aamm: string; cnpj: string; mod: string; serie: string; nNF: string; tpEmis: string; cNF: string; cDV: string; }; type NfeChaveValidationResult = { ok: true; value: NfeChave; format: 'numeric'; parsed: NfeChaveParsed; uf?: UfCode; } | { ok: false; code: ValidationErrorCode; message: string; uf?: UfCode; }; type TelefoneValidationResult = { ok: true; value: Telefone; tipo: TelefoneTipo; format: 'telefone'; } | { ok: false; code: ValidationErrorCode; message: string; }; type BrCodeValidationResult = { ok: true; value: BrCodePayload; format: 'brcode'; merchantName: string; merchantCity: string; amount?: string; txid?: string; pixKey?: PixKey; pixKeyType?: PixKeyType; pixInitiationUrl?: string; } | { ok: false; code: ValidationErrorCode; message: string; }; export type { Arrecadacao as A, BoletoInputKind as B, CartaoCredito as C, DocumentFormat as D, Ean as E, FormatResult as F, RgUfCode as G, RgValidationResult as H, IeProdutorRuralValidationResult as I, TelefoneTipo as J, TelefoneValidationResult as K, LinhaDigitavel as L, TituloEleitor as M, NfeChave as N, TituloEleitorValidationResult as O, PisPasep as P, ValidationResult as Q, Renavam as R, LinhaDigitavelValidationResult as S, Telefone as T, UfCode as U, ValidationErrorCode as V, CodigoBarrasValidationResult as W, BoletoSituacao as a, BoletoValidationResult as b, BrCodePayload as c, BrCodeValidationResult as d, CartaoCreditoValidationResult as e, Cep as f, Cnh as g, Cnpj as h, CodigoBarras as i, Cpf as j, EanValidationResult as k, InscricaoEstadual as l, InscricaoEstadualProdutorRural as m, InscricaoEstadualValidationResult as n, NfeChaveParsed as o, NfeChaveValidationResult as p, Nit as q, NitIssuer as r, NitTipo as s, NitValidationResult as t, PixKey as u, PixKeyType as v, PixValidationResult as w, Placa as x, ProcessoJudicial as y, Rg as z };