//#region src/get-iban-info/get-iban-info.d.ts /** The fields `getIbanInfo` reads out of a Brazilian IBAN. */ export type IbanInfo = { /** ISO 3166-1 alpha-2 country code. Always `"BR"`, the only country this parser supports. */ countryCode: "BR"; /** The 2 digit ISO 7064 MOD 97-10 check digits. */ checkDigits: string; /** The 8 digit ISPB (Identificador do Sistema de Pagamentos Brasileiro) of the institution. */ bankIspb: string; /** The 5 digit branch (agência) number, zero-padded. */ branch: string; /** The 10 digit account (conta) number, zero-padded. */ account: string; /** * The 1 letter account type, as published in the "Dicionário de Tipos" of the Catálogo de * Mensagens e de Arquivos do SFN. `"C"` (conta corrente) and `"P"` (conta poupança) are the * usual values, but any letter is allowed. */ accountType: string; /** * The 1 character owner indicator, distinguishing co-owners of the same account: `"1"` for * the first or only holder up to `"9"` for the ninth, then `"A"` to `"Z"` from the tenth. */ owner: string; }; /** * Parses a Brazilian IBAN (International Bank Account Number) into its fields. * * The 29 character Brazilian IBAN is laid out as 2 (country code, always `BR`) + 2 (ISO 7064 * MOD 97-10 check digits) + 8 (ISPB) + 5 (branch) + 10 (account) + 1 (account type, any letter, * usually `C` for conta corrente or `P` for conta poupança) + 1 (owner indicator, `1` to `9` * then `A` to `Z`). Only * Brazilian IBANs are supported: the field layout of the other ISO 13616 countries is out of * scope, so a well-formed non `BR` IBAN also returns `null`. * * Accepts the same input forms as `isValidIban`, compact or in the ISO 13616 print format (groups * of 4 split by a single whitespace, `.`, `-` or `/`), in either case with optional surrounding * whitespace and in any case, and returns `null` whenever `isValidIban` would return `false`, * including a value carrying a separator away from a group boundary, a run of separators or any * character other than letters and digits. * * @param {string} value - The IBAN to be parsed. * @returns {IbanInfo|null} The parsed IBAN, or `null` when it is not a valid Brazilian IBAN. * * @example * ```typescript * getIbanInfo("BR1500000000000010932840814P2"); * // { * // countryCode: "BR", * // checkDigits: "15", * // bankIspb: "00000000", * // branch: "00001", * // account: "0932840814", * // accountType: "P", * // owner: "2", * // } * * getIbanInfo("BR15 0000 0000 0000 1093 2840 814P 2"); // same result (grouping spaces) * getIbanInfo("BR15-0000-0000-0000-1093-2840-814P-2"); // same result (any of the mask characters) * getIbanInfo("DE89370400440532013000"); // null (non Brazilian IBAN) * getIbanInfo("BR1500000000000010932840814P3"); // null (bad check digits) * getIbanInfo("BR15 000 00000 0000 1093 2840 814P 2"); // null (a separator inside a group) * ``` * * @see Official: https://www.bcb.gov.br/pre/normativos/circ/2013/pdf/circ_3625_v1_O.pdf * Circular BCB nº 3.625/2013 * @see Official: https://www.bcb.gov.br/content/estabilidadefinanceira/Documents/sistema_pagamentos_brasileiro/IBAN-Guidelines_%20port.pdf * Diretrizes de Implementação do IBAN no Brasil * @see Official: https://www.iso.org/standard/81090.html * ISO 13616-1:2020 (IBAN structure) * @see Official: https://www.iso.org/standard/31531.html * ISO/IEC 7064:2003 (MOD 97-10 check digit algorithm) */ export declare const getIbanInfo: (value: string) => IbanInfo | null; //#endregion