@widergy/web-utils
Version:
Utility GO! Web utils
80 lines (79 loc) • 5.33 kB
TypeScript
import { AllValuesInterface } from './constants/commonInterfaces';
export declare const noInitialSpace: (value: string) => string;
export declare const normalizeNumberWithDecimalsInput: (value: string, previousValue: string) => string;
export declare const padTwo: (number: number) => string;
export declare const onlyNumbers: (value: string) => string;
export declare const numbersWithDecimals: (value: string) => string;
export declare const normalizeName: (value: string) => string;
export declare const onlyLettersAndSpaces: (value: string) => string;
export declare const onlyLetters: (value: string) => string;
export declare const normalizeDate: (value: string) => string;
export declare const normalizeAccount: (value: string, accountLength: number) => string;
export declare const normalizeLowerCase: (value: string) => string;
export declare const numberMaxLength: (length: number) => (value: string) => string;
export declare const withoutNumbers: (value: string) => string;
export declare function formatCreditCardNumber(value: string): string;
export declare function formatCVC(cvcValue: string, cardNumber: string): string;
export declare function formatExpirationDate(value: string): string;
export declare const noInitialZero: (value: string) => string;
export declare const normalizeDocumentNumber: (docTypeId: number, docTypeKey: number, docTypeMapping: any) => (value: string, prevValue: string, allValues: AllValuesInterface) => string;
export declare const removeWhitespaces: (value: string) => string;
export declare const noConsecutiveSpaces: (value: string) => string;
export declare const normalizeUpperCase: (value: string) => string;
export declare const normalizeAll: (normalizers: Array<Function>) => (value: string, previousValue: string, allValues: AllValuesInterface, previousAllValues: AllValuesInterface) => string;
export declare function dateToString(date: any, format?: string): string;
export declare const changeCase: (s: string, options: {
from: string;
to: string;
}) => string;
export declare const withoutPaste: (value: string, previousValue: string | undefined) => string | undefined;
export declare const onlyLettersAndNumbers: (value: string) => string;
export declare const maxLength: (length: number) => (value: string) => string;
export declare const cuitFormatter: (value: string) => string;
export declare const normalizeCBU: (cbuEntityKey: string, cbuNumberKey: string) => (value?: any) => Object | undefined;
export declare const normalizeByRegex: (regex: RegExp) => (value: string, previousValue: string | undefined) => string | undefined;
export declare const replaceByRegex: (regex: RegExp, replacement?: string) => (value: string) => string | undefined;
export declare const noEmojis: (value: string) => string | undefined;
export declare const rutNormalizer: (value: string) => string;
export declare const phoneDashedNormalizer: (value: string) => string;
interface NormalizeUtils {
noInitialSpace: (value: string) => string;
normalizeNumberWithDecimalsInput: (value: string, previousValue: string) => string;
padTwo: (number: number) => string;
onlyNumbers: (value: string) => string;
numbersWithDecimals: (value: string) => string;
normalizeName: (value: string) => string;
onlyLettersAndSpaces: (value: string) => string;
onlyLetters: (value: string) => string;
rutNormalizer: (value: string) => string;
phoneDashedNormalizer: (value: string) => string;
normalizeDate: (value: string) => string;
normalizeAccount: (value: string, accountLength: number) => string;
normalizeLowerCase: (value: string) => string;
numberMaxLength: (length: number) => (value: string) => string;
withoutNumbers: (value: string) => string;
formatCreditCardNumber: (value: string) => string;
formatCVC: (cvcValue: string, cardNumber: string) => string;
formatExpirationDate: (value: string) => string;
normalizeDocumentNumber: (docTypeId: number, docTypeKey: number, docTypeMapping: any) => (value: string, prevValue: string, allValues: AllValuesInterface) => string;
removeWhitespaces: (value: string) => string;
noConsecutiveSpaces: (value: string) => string;
noInitialZero: (value: string) => string;
normalizeUpperCase: (value: string) => string;
normalizeAll: (normalizers: Array<Function>) => (value: string, previousValue: string, allValues: AllValuesInterface, previousAllValues: AllValuesInterface) => string;
dateToString: (date: any, format: string) => string;
changeCase: (s: string, options: {
from: string;
to: string;
}) => string;
withoutPaste: (value: string, previousValue: string | undefined) => string | undefined;
onlyLettersAndNumbers: (value: string) => string;
maxLength: (length: number) => (value: string) => string;
cuitFormatter: (value: string) => string;
normalizeCBU: (cbuEntityKey: string, cbuNumberKey: string) => (value: Object) => Object | undefined;
normalizeByRegex: (regex: RegExp) => (value: string, previousValue: string | undefined) => string | undefined;
replaceByRegex: (regex: RegExp, replacement: string) => (value: string) => string | undefined;
noEmojis: (value: string) => string | undefined;
}
declare const NORMALIZE_UTILS: NormalizeUtils;
export default NORMALIZE_UTILS;