parse-full-name icon indicating copy to clipboard operation
parse-full-name copied to clipboard

Typescript definitions

Open sparebytes opened this issue 7 years ago • 2 comments

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;
}

sparebytes avatar Feb 08 '18 14:02 sparebytes

Thanks, you should consider added this to https://github.com/DefinitelyTyped/DefinitelyTyped - I'll try to once I get some free time

sudosoul avatar Feb 21 '19 16:02 sudosoul

@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.

chris-pardy avatar Sep 16 '19 15:09 chris-pardy