import { n as StateCode } from "./states-BHJ5gB-2.cjs"; //#region src/is-valid-ie/is-valid-ie.d.ts /** The parameters `isValidIe` takes: the registration and the state whose rule it is checked against. */ export type IsValidIeParams = { /** The inscrição estadual to validate. */ value: string; /** The two letter state code the registration belongs to, e.g. `"SP"`. Case insensitive. */ stateCode: StateCode; }; /** * Validates a Brazilian state tax registration number (IE). * * Per state notes, all of them deliberate and unchanged since 2.3.0: * - DF: the SINTEGRA page is published but empty, and no SEFAZ-DF roteiro is published either, * so DF follows the 13 digit AC rule under the prefix 07. * - GO: the SINTEGRA page is superseded by the SEFAZ-GO roteiro, which is the source of the * prefixes 10, 11 and 15, of the 10103105 to 10119997 range and of the dual digit * registration 11094402. * - RJ: the SINTEGRA page publishes only the modulus rule; the 8 digit length and the weights * 2, 7, 6, 5, 4, 3 and 2 come from the SINTEGRA validator itself, not from the page. * - SP: characters other than "P" and digits are rejected on purpose, a deliberate deviation * from the Regra Geral of the SINTEGRA page, which ignores them instead. * - AL: the tipo de empresa digit (third position) is not restricted to 0, 3, 5, 7 and 8. * - PE: only the current 9 digit eFisco format is accepted; the old 14 digit CACEPE format * documented on the same page is not. * - TO: the SINTEGRA page documents only the 11 digit form, the one carrying the tipo digits in * positions 3 and 4. The 9 digit form is also accepted, applying the same modulus 11 rule with * weights 9 down to 2 to the first eight digits; it is 2.3.0 behavior kept for compatibility * and no published SEFAZ-TO roteiro covers it. * - An all zero registration is accepted for every state whose published formula yields a * check digit of 0 for it (AM, BA with 8 or 9 digits, CE, ES, MG, MT, PB, PE, PI, PR, RJ, RS, * SC, SE, SP and TO with 9 digits), unlike isValidCpf and isValidCnpj, which reject repeated * digits. AM is on that list through the second branch of its published formula only: the * page's first branch, "Se Soma < 11 Então Dígito = 11 - Soma", gives 11 for an all zero * registration, while the "resto <= 1 ⇒ 0" branch, the one implemented here, gives 0. * * The state can also be passed first and the registration second, `isValidIe('SP', '110042490114')`, * the 2.3.0 form, which still works and is deprecated. The two forms are told apart by the first * argument: an object is the parameters of the current form, a string the state code of the * deprecated one, and anything else returns false. * * @param {IsValidIeParams} params - The registration to validate and the state to validate it against * @param {string} params.value - The state registration number to validate * @param {StateCode} params.stateCode - The state abbreviation (e.g., 'SP', 'RJ', 'MG') * @returns {boolean} True if the state registration number is valid, false otherwise * * @example * ```typescript * isValidIe({ value: '110042490114', stateCode: 'SP' }); // true * isValidIe({ value: 'P011004243002', stateCode: 'SP' }); // true * isValidIe({ value: '12345', stateCode: 'RJ' }); // false * isValidIe({ value: '109161793', stateCode: 'go' as StateCode }); // true (case-insensitive) * ``` * * @see Official: http://www.sintegra.gov.br/insc_est.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_AC.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_AL.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_AM.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_AP.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_BA.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_CE.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_DF.html * The page is published but empty: it carries no format, no weights and no worked example, * and no SEFAZ-DF roteiro is published either, so DF follows the 13 digit AC rule under the * prefix 07. * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_ES.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_GO.html * Superseded for Goiás by the SEFAZ-GO roteiro below: this page still gives the prefixes as * 10, 11 or 20 to 29 and knows nothing of the special ranges. * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_MA.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_MG.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_MS.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_MT.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_PA.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_PB.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_PE.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_PI.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_PR.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_RJ.html * Publishes only the modulus rule: the 8 digit length and the weights 2, 7, 6, 5, 4, 3 and 2 * come from the SINTEGRA validator itself, not from this page. * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_RN.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_RO.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_RR.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_RS.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_SC.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_SE.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_SP.html * @see Official: http://www.sintegra.gov.br/Cad_Estados/cad_TO.html * Documents only the 11 digit form, with the tipo digits 01, 02, 03 and 99 in positions 3 and 4; * the 9 digit form the validator also accepts is not covered by this page or by any other * published SEFAZ-TO roteiro. * @see Official: https://goias.gov.br/economia/roteiro-de-critica-da-inscricao-estadual-de-goias/ * SEFAZ-GO's roteiro de crítica, the source of the Goiás prefixes and special ranges. */ export declare function isValidIe(params: IsValidIeParams): boolean; /** * Validates a Brazilian state tax registration number (IE) with the state given first. See the * overload taking the parameters object for the full documentation. * * @param {StateCode} stateCode - The state abbreviation (e.g., 'SP', 'RJ', 'MG') * @param {string} ie - The state registration number to validate * @returns {boolean} True if the state registration number is valid, false otherwise * * @deprecated Use the object form, `isValidIe({ value, stateCode })`. */ export declare function isValidIe(stateCode: StateCode, ie: string): boolean; //#endregion export type { StateCode };