@brasil-interface/utils
Version:
118 lines • 4.83 kB
TypeScript
export declare class BA {
private static readonly CASE_1_MOD_ALG;
private static readonly CASE_1_LENGTH;
private static readonly CASE_1_STARTS_WITH;
private static readonly CASE_1_BASE_NUMERALS_LENGTH;
private static readonly CASE_1_BASE_NUMERALS_START;
private static readonly CASE_1_BASE_NUMERALS_END;
private static readonly CASE_1_FIRST_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_1_SECOND_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_2_MOD_ALG;
private static readonly CASE_2_LENGTH;
private static readonly CASE_2_STARTS_WITH;
private static readonly CASE_2_BASE_NUMERALS_LENGTH;
private static readonly CASE_2_BASE_NUMERALS_START;
private static readonly CASE_2_BASE_NUMERALS_END;
private static readonly CASE_2_FIRST_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_2_SECOND_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_3_MOD_ALG;
private static readonly CASE_3_LENGTH;
private static readonly CASE_3_STARTS_WITH;
private static readonly CASE_3_BASE_NUMERALS_LENGTH;
private static readonly CASE_3_BASE_NUMERALS_START;
private static readonly CASE_3_BASE_NUMERALS_END;
private static readonly CASE_3_FIRST_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_3_SECOND_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_4_MOD_ALG;
private static readonly CASE_4_LENGTH;
private static readonly CASE_4_STARTS_WITH;
private static readonly CASE_4_BASE_NUMERALS_LENGTH;
private static readonly CASE_4_BASE_NUMERALS_START;
private static readonly CASE_4_BASE_NUMERALS_END;
private static readonly CASE_4_FIRST_VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_4_SECOND_VERIFIER_DIGIT_WEIGHTS;
private static readonly FORMAT_REGEX;
private static readonly FORMAT_PATTERN;
private static readonly VALIDATION_RULES;
/**
* PT-BR: Verifica se uma inscrição estadual da Bahia é válida.
*
* EN: Checks if a Bahia state registration is valid.
*
* @param inscricaoE - PT-BR: A inscrição estadual. Com ou sem máscara. EN: The state registration. With or without mask.
* @returns PT-BR: `true` se a inscrição estadual for válida. EN: `true` if the state registration is valid.
*
* @example
* ```
* InscricaoEstadual.BA.isValid("111117470"); // false
* InscricaoEstadual.BA.isValid("835368160"); // true
* ```
*/
static isValid(inscricaoE: string): boolean;
/**
* PT-BR: Máscara uma inscrição estadual da Bahia.
*
* EN: Masks a Bahia state registration.
*
* @param inscricaoE - PT-BR: A inscrição estadual. Com ou sem máscara. EN: The state registration. With or without mask.
* @returns PT-BR: A inscrição estadual mascarada. EN: The masked state registration.
*
* @example
* ```
* InscricaoEstadual.BA.mask("835368160"); // "8353681-60"
* ```
*/
static mask(inscricaoE: string): string;
/**
* PT-BR: Desmascara uma inscrição estadual da Bahia.
*
* EN: Unmasks a Bahia state registration.
*
* @param inscricaoE - PT-BR: A inscrição estadual mascarada. EN: The masked state registration.
* @returns PT-BR: A inscrição estadual. EN: The state registration.
*
* @example
* ```
* InscricaoEstadual.BA.clear("8353681-60"); // "835368160"
* ```
*/
static unmask(inscricaoE: string): string;
/**
* PT-BR: Gera um número de inscrição estadual da Bahia válido.
*
* EN: Generates a valid Bahia state registration number.
*
* @returns PT-BR: Um número de inscrição estadual da Bahia válido. EN: A valid Bahia state registration number.
*
* @example
* ```
* InscricaoEstadual.BA.generate(); // "835368160"
* ```
*/
static generate(): string;
/**
* PT-BR: Gera um número de inscrição estadual da Bahia válido com máscara.
*
* EN: Generates a valid masked Bahia state registration number.
*
* @returns PT-BR: Um número de inscrição estadual da Bahia válido com máscara. EN: A valid masked Bahia state registration number.
*
* @example
* ```
* InscricaoEstadual.BA.generateMasked(); // "8353681-60"
* ```
*/
static generateMasked(): string;
private static clear;
private static shouldHaveValidVerifierDigits;
private static getCase;
private static getBaseNumerals;
private static getBaseNumeralsLength;
private static getWeights;
private static getModAlg;
private static getBaseStartsWith;
private static calculateVerifierDigits;
private static calculateSecondVerifierDigit;
private static calculateFirstVerifierDigit;
}
//# sourceMappingURL=BA.d.ts.map