Skip to content

Commit 5b4ec21

Browse files
committed
fix typescript
1 parent b8dab7d commit 5b4ec21

File tree

1 file changed

+37
-38
lines changed

1 file changed

+37
-38
lines changed

src/CountryPicker.d.ts

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { StyleProp, ViewStyle, ImageProps } from 'react-native';
2-
import * as React from 'react';
1+
import { StyleProp, ViewStyle, ImageProps } from 'react-native'
2+
import * as React from 'react'
33

44
/**
55
* Country metadata stored in this library to display and query
66
* `<CountryPicker />`
77
*/
88
export interface Country {
9-
currency: CurrencyCode;
10-
callingCode: CallingCode;
11-
flag: string;
12-
name: { [key in TranslationLanguageCode]: string };
9+
currency: CurrencyCode
10+
callingCode: CallingCode
11+
flag: string
12+
name: { [key in TranslationLanguageCode]: string }
13+
cca2: CCA2Code
1314
}
1415

1516
/**
@@ -263,17 +264,17 @@ export type CCA2Code =
263264
| 'YE'
264265
| 'ZM'
265266
| 'ZW'
266-
| 'AX';
267+
| 'AX'
267268
/**
268269
* Calling code for a given country. For example, the entry for United States is
269270
* `1` (referring to "+1`")
270271
*/
271-
export type CallingCode = string;
272+
export type CallingCode = string
272273
/**
273274
* Currency code for a country, as specified in ISO 4217. For example, the entry
274275
* for United States is `USD` (referring to US Dollars)
275276
*/
276-
export type CurrencyCode = string;
277+
export type CurrencyCode = string
277278
/**
278279
* Language codes for available translations in this library
279280
*/
@@ -292,7 +293,7 @@ export type TranslationLanguageCode =
292293
| 'svk'
293294
| 'fin'
294295
| 'zho'
295-
| 'isr';
296+
| 'isr'
296297

297298
export enum FlagType {
298299
FLAT = 'flat',
@@ -308,93 +309,91 @@ export interface CountryPickerProps {
308309
/**
309310
* Country code, as specified in ISO 3166-1 alpha-2 (ie. `FR`, `US`, etc.)
310311
*/
311-
cca2: CCA2Code;
312+
cca2: CCA2Code
312313
/**
313314
* The handler when a country is selected
314315
*/
315-
onChange: (value: Country) => void;
316+
onChange: (value: Country) => void
316317
/**
317318
* Override any style specified in the component (see source code)
318319
*/
319-
styles?: StyleProp<ViewStyle>;
320+
styles?: StyleProp<ViewStyle>
320321
/**
321322
* If set to true, Country Picker List will show calling code after country name. For example: `United States (+1)`
322323
*/
323-
showCallingCode?: boolean;
324+
showCallingCode?: boolean
324325
/**
325326
* The handler when the close button is clicked
326327
*/
327-
onClose?: () => void;
328+
onClose?: () => void
328329
/**
329330
* List of custom CCA2 countries to render in the list. Use getAllCountries to filter what you need if you want to pass in a custom list
330331
*/
331-
countryList?: CCA2Code[];
332+
countryList?: CCA2Code[]
332333
/**
333334
* The language display for the name of the country
334335
*/
335-
translation?: TranslationLanguageCode;
336+
translation?: TranslationLanguageCode
336337
/**
337338
* If true, the CountryPicker will have a close button
338339
*/
339-
closeable?: boolean;
340+
closeable?: boolean
340341
/**
341342
* If true, the CountryPicker will have search bar
342343
*/
343-
filterable?: boolean;
344+
filterable?: boolean
344345
/**
345346
* List of custom CCA2 countries you don't want to render
346347
*/
347-
excludeCountries?: CCA2Code[];
348+
excludeCountries?: CCA2Code[]
348349
/**
349350
* The search bar placeholder
350351
*/
351-
filterPlaceholder?: string;
352+
filterPlaceholder?: string
352353
/**
353354
* Whether or not the search bar should be autofocused
354355
*/
355-
autoFocusFilter?: boolean;
356+
autoFocusFilter?: boolean
356357
/**
357358
* Whether or not the Country Picker onPress is disabled
358359
*/
359-
disabled?: boolean;
360+
disabled?: boolean
360361
/**
361362
* The search bar placeholder text color
362363
*/
363-
filterPlaceholderTextColor?: string;
364+
filterPlaceholderTextColor?: string
364365
/**
365366
* Custom close button Image
366367
*/
367-
closeButtonImage?: ImageProps['source'];
368+
closeButtonImage?: ImageProps['source']
368369
/**
369370
* If true, the CountryPicker will render the modal over a transparent background
370371
*/
371-
transparent?: boolean;
372+
transparent?: boolean
372373
/**
373374
* The handler that controls how the modal animates
374375
*/
375-
animationType?: AnimationType;
376+
animationType?: AnimationType
376377
/**
377378
* If set, overwrites the default OS based flag type.
378379
*/
379-
flagType?: FlagType;
380+
flagType?: FlagType
380381
/**
381382
* If set to true, prevents the alphabet filter rendering
382383
*/
383-
hideAlphabetFilter?: boolean;
384+
hideAlphabetFilter?: boolean
384385
/**
385386
* If 'filterable={true}' and renderFilter function is provided, render custom filter component.*
386387
*/
387-
renderFilter?: (
388-
args: {
389-
value: string;
390-
onChange: CountryPickerProps['onChange'];
391-
onClose: CountryPickerProps['onClose'];
392-
}
393-
) => React.ReactNode;
388+
renderFilter?: (args: {
389+
value: string
390+
onChange: CountryPickerProps['onChange']
391+
onClose: CountryPickerProps['onClose']
392+
}) => React.ReactNode
394393
}
395394

396395
export default class CountryPicker extends React.Component<CountryPickerProps> {
397-
openModal: () => void;
396+
openModal: () => void
398397
}
399398

400-
export function getAllCountries(): Country[];
399+
export function getAllCountries(): Country[]

0 commit comments

Comments
 (0)