File tree Expand file tree Collapse file tree 6 files changed +48
-0
lines changed
Expand file tree Collapse file tree 6 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ export default function hasFlag ( country : string ) : boolean ;
Original file line number Diff line number Diff line change 1+ import { countries , hasFlag } from 'country-flag-icons' ;
2+ import getUnicodeFlagIcon from 'country-flag-icons/unicode' ;
3+
4+ hasFlag ( 'US' ) ; // $ExpectType boolean
5+ hasFlag ( 'ZZ' ) ; // $ExpectType boolean
6+ countries ; // $ExpectType string[]
7+ countries . includes ( 'US' ) ; // $ExpectType boolean
8+ countries . includes ( 'ZZ' ) ; // $ExpectType boolean
9+ getUnicodeFlagIcon ( 'US' ) ; // $ExpectType string
10+ getUnicodeFlagIcon ( 'ZZ' ) ; // $ExpectType string
Original file line number Diff line number Diff line change 1+ // Type definitions for country-flag-icons 1.2
2+ // Project: https://gitlab.com/catamphetamine/country-flag-icons#readme
3+ // Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
4+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+ export { default as hasFlag } from "./commonjs/hasFlag" ;
7+ export const countries : string [ ] ;
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "module" : " commonjs" ,
4+ "lib" : [
5+ " es6" , " ES2017"
6+ ],
7+ "noImplicitAny" : true ,
8+ "noImplicitThis" : true ,
9+ "strictFunctionTypes" : true ,
10+ "strictNullChecks" : true ,
11+ "baseUrl" : " ../" ,
12+ "typeRoots" : [
13+ " ../"
14+ ],
15+ "types" : [],
16+ "noEmit" : true ,
17+ "forceConsistentCasingInFileNames" : true
18+ },
19+ "files" : [
20+ " index.d.ts" ,
21+ " country-flag-icons-tests.ts"
22+ ]
23+ }
Original file line number Diff line number Diff line change 1+ { "extends" : " dtslint/dt.json" }
Original file line number Diff line number Diff line change 1+ /**
2+ * Creates Unicode flag from a two-letter ISO country code.
3+ * https://stackoverflow.com/questions/24050671/how-to-put-japan-flag-character-in-a-string
4+ * @param country — A two-letter ISO country code (case-insensitive).
5+ */
6+ export default function getCountryFlag ( country : string ) : string ;
You can’t perform that action at this time.
0 commit comments