mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add typings for humanname 1.1.1 (#12641)
This commit is contained in:
parent
e1fb8319cf
commit
c6f86d519c
19
humanparser/humanparser-tests.ts
Normal file
19
humanparser/humanparser-tests.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import human = require('humanparser');
|
||||
|
||||
let parsedName = human.parseName("Mr. William R. Hearst, III");
|
||||
parsedName.firstName;
|
||||
parsedName.lastName;
|
||||
parsedName.fullName;
|
||||
parsedName.suffix;
|
||||
parsedName.middleName;
|
||||
parsedName.salutation;
|
||||
|
||||
let parsedAddress = human.parseAddress("123 Happy Street, Honolulu, HI 65780");
|
||||
parsedAddress.address;
|
||||
parsedAddress.state;
|
||||
parsedAddress.fullAddress;
|
||||
parsedAddress.zip;
|
||||
parsedAddress.city;
|
||||
|
||||
let parsedFullName = human.getFullestName("John & Peggy Sue");
|
||||
parsedFullName.fullName;
|
||||
37
humanparser/index.d.ts
vendored
Normal file
37
humanparser/index.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Type definitions for humanparser 1.1.1
|
||||
// Project: https://github.com/chovy/humanparser
|
||||
// Definitions by: Michał Podeszwa <https://github.com/MichalPodeszwa/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace humanparser {
|
||||
interface NameOutput {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
fullName: string;
|
||||
suffix?: string;
|
||||
middleName?: string;
|
||||
salutation?: string;
|
||||
}
|
||||
|
||||
interface FullerNameOutput {
|
||||
fullName: string;
|
||||
}
|
||||
|
||||
interface AddressOutput {
|
||||
address: string;
|
||||
state: string;
|
||||
fullAddress: string;
|
||||
zip: string;
|
||||
city: string;
|
||||
}
|
||||
|
||||
interface HumanparserStatic {
|
||||
parseName (name: string): NameOutput;
|
||||
getFullestName (name: string): FullerNameOutput;
|
||||
parseAddress (address: string): AddressOutput;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare const humanparser: humanparser.HumanparserStatic;
|
||||
export = humanparser;
|
||||
19
humanparser/tsconfig.json
Normal file
19
humanparser/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"humanparser-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user