@types/react-phone-number-input
Advanced tools
Comparing version 3.0.9 to 3.0.10
@@ -37,4 +37,29 @@ // Type definitions for react-phone-number-input 3.0 | ||
export function parsePhoneNumber(input: string): PhoneNumber | undefined; | ||
export interface ParsePhoneNumberOptions { | ||
/** | ||
* Default country for parsing national numbers. Instead of passing options.defaultCountry | ||
* one could pass defaultCountry argument directly. | ||
*/ | ||
defaultCountry?: string; | ||
/** | ||
* Default calling code for parsing national numbers. Some numbering plans | ||
* are for "non-geographic numbering plans" and they don't have a country code, | ||
* so defaultCountry can't be specified for them. | ||
*/ | ||
defaultCallingCode?: string; | ||
/** | ||
* By default, the parsing function will attempt to extract a phone number | ||
* from an input string even in cases like "Support: (213) 373-4253 (robot)", | ||
* which mimicks the behavior of the original Google's libphonenumber library, | ||
* and is the default behavior for legacy reasons. However, if "strict" input | ||
* validation is required, one can pass extract: false flag to demand that the | ||
* whole input string be a viable phone number. | ||
* @default true | ||
*/ | ||
extract?: boolean; | ||
} | ||
export function parsePhoneNumber(input: string, options?: string | ParsePhoneNumberOptions): PhoneNumber | undefined; | ||
/** | ||
@@ -68,5 +93,5 @@ * Returns a list of supported countries. | ||
export interface CountrySelectComponentProps { | ||
className?: string | undefined; | ||
disabled?: boolean | undefined; | ||
name?: string | undefined; | ||
className?: string; | ||
disabled?: boolean; | ||
name?: string; | ||
onBlur?: (() => void) | undefined; | ||
@@ -79,3 +104,3 @@ onChange?: ((value?: string) => void) | undefined; | ||
options?: Array<{ value?: string | undefined; label: string; icon: React.Component }> | undefined; | ||
tabIndex?: number | undefined; | ||
tabIndex?: number; | ||
/** | ||
@@ -104,3 +129,3 @@ * The currently selected country code | ||
*/ | ||
addInternationalOption?: boolean | undefined; | ||
addInternationalOption?: boolean; | ||
/** | ||
@@ -110,3 +135,3 @@ * If specified, only these countries will be available for selection. | ||
*/ | ||
countries?: string[] | undefined; | ||
countries?: string[]; | ||
@@ -118,3 +143,3 @@ /** | ||
*/ | ||
country?: string | undefined; | ||
country?: string; | ||
@@ -130,4 +155,4 @@ /** | ||
*/ | ||
countryOptionsOrder?: string[] | undefined; | ||
countrySelectComponent?: React.ComponentType<CountrySelectComponentProps> | undefined; | ||
countryOptionsOrder?: string[]; | ||
countrySelectComponent?: React.ComponentType<CountrySelectComponentProps>; | ||
/** | ||
@@ -137,3 +162,3 @@ * Country <select/> component props. Along with the usual DOM properties such as aria-label | ||
*/ | ||
countrySelectProps?: object | undefined; | ||
countrySelectProps?: object; | ||
/** | ||
@@ -146,7 +171,7 @@ * A two-letter country code for formatting `value` | ||
*/ | ||
defaultCountry?: string | undefined; | ||
defaultCountry?: string; | ||
/** | ||
* Set to true to disable both the phone number <input/> and the country <select/> | ||
*/ | ||
disabled?: boolean | undefined; | ||
disabled?: boolean; | ||
/** | ||
@@ -157,5 +182,5 @@ * @deprecated | ||
*/ | ||
displayInitialValueAsLocalNumber?: boolean | undefined; | ||
flagComponent?: React.ComponentType<{ country: string; countryName: string, flagUrl: string; flags: FlagsMap }> | undefined; | ||
flags?: FlagsMap | undefined; | ||
displayInitialValueAsLocalNumber?: boolean; | ||
flagComponent?: React.ComponentType<{ country: string; countryName: string; flagUrl: string; flags: FlagsMap }>; | ||
flags?: FlagsMap; | ||
/** | ||
@@ -171,3 +196,3 @@ * A URL template of a country flag, where "{XX}" is a two-letter country code in upper case, | ||
*/ | ||
flagUrl?: string | undefined; | ||
flagUrl?: string; | ||
/** | ||
@@ -187,3 +212,3 @@ * Phone number <input/> component. | ||
React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<any> | ||
> | undefined; | ||
>; | ||
@@ -200,3 +225,3 @@ /** | ||
*/ | ||
international?: boolean | undefined; | ||
international?: boolean; | ||
@@ -207,3 +232,3 @@ /** | ||
*/ | ||
initialValueFormat?: "national" | undefined; | ||
initialValueFormat?: 'national'; | ||
@@ -220,17 +245,17 @@ /** | ||
*/ | ||
internationalIcon?: React.ComponentType<object> | undefined; | ||
labels?: { [key: string]: string } | undefined; | ||
internationalIcon?: React.ComponentType<object>; | ||
labels?: { [key: string]: string }; | ||
/** | ||
* If set to true the phone number input will get trimmed if it exceeds the maximum length for the country. | ||
*/ | ||
limitMaxLength?: boolean | undefined; | ||
metadata?: object | undefined; | ||
limitMaxLength?: boolean; | ||
metadata?: object; | ||
/** | ||
* Phone number <input/> component additional props. | ||
*/ | ||
numberInputProps?: object | undefined; | ||
numberInputProps?: object; | ||
/** | ||
* Is called every time the selected country changes: either programmatically or when user selects it manually from the list. | ||
*/ | ||
onCountryChange?: ((countryCode?: string) => void) | undefined; | ||
onCountryChange?: (countryCode?: string) => void; | ||
/** | ||
@@ -244,3 +269,3 @@ * By default, the caret position is being "intelligently" managed | ||
*/ | ||
smartCaret?: boolean | undefined; | ||
smartCaret?: boolean; | ||
/** | ||
@@ -252,5 +277,5 @@ * When `defaultCountry` is defined and the initial `value` corresponds to `defaultCountry`, | ||
*/ | ||
useNationalFormatForDefaultCountryValue?: boolean | undefined; | ||
useNationalFormatForDefaultCountryValue?: boolean; | ||
} | ||
export default class PhoneInput extends React.Component<PhoneInputProps, object> {} |
{ | ||
"name": "@types/react-phone-number-input", | ||
"version": "3.0.9", | ||
"version": "3.0.10", | ||
"description": "TypeScript definitions for react-phone-number-input", | ||
@@ -50,4 +50,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-phone-number-input", | ||
}, | ||
"typesPublisherContentHash": "4eb95db3ef18b33dcd9cf9be44b9e827bc3814d67ff2c949c966de336f41d055", | ||
"typesPublisherContentHash": "16de9d896719d62d85b169d550625778dd652d7ff4399fdf3be8497393e11118", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 07 Jul 2021 17:33:53 GMT | ||
* Last updated: Tue, 13 Jul 2021 15:01:25 GMT | ||
* Dependencies: [@types/react](https://npmjs.com/package/@types/react) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18174
5
318