@taiga-ui/legacy
Version:
Legacy Taiga UI entities from the previous major release to simplify migration
31 lines (30 loc) • 1.23 kB
TypeScript
/**
* @deprecated: drop in v5.0
* Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead!
* @example
* import {maskitoTransform} from '@maskito/core';
*
* const mask = {
* mask: ['+', '1', ' ', /\d/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
* };
* maskitoTransform('12125552368', mask); // +1 (212) 555-2368
* ___
* @example
* import {maskitoTransform} from '@maskito/core';
* import {maskitoPhoneOptionsGenerator} from '@maskito/phone';
* import metadata from 'libphonenumber-js/min/metadata';
*
* const options = maskitoPhoneOptionsGenerator({countryIsoCode: 'US', metadata});
*
* maskitoTransform('12125552368', mask); // +1 (212) 555-2368
* ___
* @deprecated Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead<br/>
* Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,
* adding parentheses and hyphens.
*
* @param value the input string
* @param countryCode a country code
* @param phoneMask a phone number mask
* @return the formatted phone string of the form +7 XXX XXX-XX-XX
*/
export declare function tuiFormatPhone(value: string, countryCode: string, phoneMask: string): string;