@brasil-interface/utils
Version:
97 lines • 3.91 kB
TypeScript
export declare class RN {
private static readonly MOD_ALG;
private static readonly CASE_1_LENGTH;
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_2_LENGTH;
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 STARTS_WITH;
private static readonly VERIFIER_DIGIT_WEIGHTS;
private static readonly CASE_1_MASK_REGEX;
private static readonly CASE_1_MASK_PATTERN;
private static readonly CASE_2_MASK_REGEX;
private static readonly CASE_2_MASK_PATTERN;
private static readonly VALIDATION_RULES;
/**
* PT-BR: Verifica se uma inscrição estadual do Rio Grande do Norte é válida.
*
* EN: Checks if an Rio Grande do Norte 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.RN.isValid("111.11583-00"); // false
* InscricaoEstadual.RN.isValid("292.33583-00"); // true
* InscricaoEstadual.RN.isValid("1111158300"); // false
* InscricaoEstadual.RN.isValid("2923358300"); // true
* ```
*/
static isValid(inscricaoE: any): boolean;
/**
* PT-BR: Máscara uma inscrição estadual do RioGrandeDoNorte.
*
* EN: Masks an Rio Grande do Norte 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.RN.mask("2923358300"); // "292.33583-00"
* ```
*/
static mask(inscricaoE: any): string;
/**
* PT-BR: Desmascara uma inscrição estadual do RioGrandeDoNorte.
*
* EN: Unmasks an Rio Grande do Norte 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 desmascarada. EN: The unmasked state registration.
*
* @example
* ```
* InscricaoEstadual.RN.unmask("292.33583-00"); // "2923358300"
* ```
*/
static unmask(inscricaoE: any): string;
/**
* PT-BR: Gera um número de inscrição estadual do Rio Grande do Norte válido e aleatório.
*
* EN: Generates a random valid Rio Grande do Norte state registration number.
*
* @returns PT-BR: O número de inscrição estadual gerado. EN: The generated state registration number.
*
* @example
* ```
* InscricaoEstadual.RN.generate(); // "2923358300"
* ```
*/
static generate(): string;
/**
* PT-BR: Gera um número de inscrição estadual do Rio Grande do Norte válido e aleatório com máscara.
*
* EN: Generates a random valid Rio Grande do Norte state registration number with mask.
*
* @returns PT-BR: O número de inscrição estadual gerado com máscara. EN: The generated state registration number with mask.
*
* @example
* ```
* InscricaoEstadual.RN.generateMasked(); // "292.33583-00"
* ```
*/
static generateMasked(): string;
private static clear;
private static shouldHaveValidVerifierDigits;
private static getCase;
private static getBaseNumerals;
private static getMaskRegex;
private static getMaskPattern;
private static calculateVerifierDigit;
}
//# sourceMappingURL=RN.d.ts.map