parse-full-name
parse-full-name copied to clipboard
Typescript definitions
I'll just leave this here for now, until I can make a pull request to include the Typescript definitions.
declare module "parse-full-name" {
export type PartToReturnSingle = "title" | "first" | "middle" | "last" | "nick" | "suffix" | "error";
export type PartToReturnAll = "all" | undefined | null;
export type FixCase = -1 | 0 | 1;
export interface FullNameParsed {
title: string;
first: string;
middle: string;
last: string;
nick: string;
suffix: string;
error: string[];
}
export function parseFullName(nameToParse: string, partToReturn: PartToReturnSingle, fixCase?: FixCase, stopOnError?: boolean, useLongLists?: boolean): string;
export function parseFullName(nameToParse: string, partToReturn?: PartToReturnAll, fixCase?: FixCase, stopOnError?: boolean, useLongLists?: boolean): FullNameParsed;
export function parseFullName(nameToParse: string, partToReturn?: PartToReturnAll | PartToReturnSingle, fixCase?: FixCase, stopOnError?: boolean, useLongLists?: boolean): string | FullNameParsed;
}
Thanks, you should consider added this to https://github.com/DefinitelyTyped/DefinitelyTyped - I'll try to once I get some free time
@sparebytes @sudosoul we've taken over ownership of this library I'm moving issues into our fork. Please feel free to comment further on your issue there.