import { CapsRange, Namon, Surname } from './types.js'; /** Representation of a string type name with some extra capabilities. */ export declare class Name { #private; readonly type: Namon; protected initial: string; protected capsRange: CapsRange; /** * Creates augmented names by adding extra functionality to a string name. * @param {Namon} type must be indicated to categorize the name so it can be * treated accordingly. * @param {CapsRange} capsRange determines how the name should be capitalized initially. */ constructor(value: string, type: Namon, capsRange?: CapsRange); set value(newValue: string); /** The piece of string treated as a name. */ get value(): string; /** The length of the name. */ get length(): number; /** Whether the name is a prefix. */ get isPrefix(): boolean; /** Whether the name is a first name. */ get isFirstName(): boolean; /** Whether the name is a middle name. */ get isMiddleName(): boolean; /** Whether the name is a last name. */ get isLastName(): boolean; /** Whether the name is a suffix. */ get isSuffix(): boolean; /** Creates a prefix. */ static prefix(value: string): Name; /** Creates a first name. */ static first(value: string): Name; /** Creates a middle name. */ static middle(value: string): Name; /** Creates a last name. */ static last(value: string): Name; /** Creates a suffix. */ static suffix(value: string): Name; /** Gets the initials (first character) of this name. */ initials(): string[]; /** String representation of this object. */ toString(): string; /** Returns true if the other is equal to this name. */ equal(other: Name | unknown): boolean; /** Capitalizes the name. */ caps(range?: CapsRange): Name; /** De-capitalizes the name. */ decaps(range?: CapsRange): Name; protected validate(name?: string): void; } /** Representation of a first name with some extra functionality. */ export declare class FirstName extends Name { #private; /** * Creates an extended version of `Name` and flags it as a first name `type`. * * Some may consider `more` additional name parts of a given name as their * first names, but not as their middle names. Though it may mean the same, * `more` provides the freedom to do it as it pleases. */ constructor(value: string, ...more: string[]); /** Determines whether a first name has `more` name parts. */ get hasMore(): boolean; get length(): number; /** Returns a combined version of the `value` and `more` if any. */ get asNames(): Name[]; /** The additional name parts of the first name. */ get more(): string[]; toString(withMore?: boolean): string; initials(withMore?: boolean): string[]; caps(range?: CapsRange): FirstName; decaps(range?: CapsRange): FirstName; /** Makes a copy of the current name. */ copyWith(values?: { first?: string; more?: string[]; }): FirstName; } /** Representation of a last name with some extra functionality. */ export declare class LastName extends Name { #private; readonly format: Surname | 'father' | 'mother' | 'hyphenated' | 'all'; /** * Creates an extended version of `Name` and flags it as a last name `type`. * * Some people may keep their @param mother's surname and want to keep a clear cut * from their @param father's surname. However, there are no clear rules about it. */ constructor(father: string, mother?: string, format?: Surname | 'father' | 'mother' | 'hyphenated' | 'all'); /** The surname inherited from the father side. */ get father(): string; /** The surname inherited from the mother side. */ get mother(): string | undefined; /** Returns `true` if the mother's surname is defined. */ get hasMother(): boolean; get length(): number; /** Returns a combined version of the `father` and `mother` if any. */ get asNames(): Name[]; toString(format?: Surname | 'father' | 'mother' | 'hyphenated' | 'all'): string; initials(format?: Surname | 'father' | 'mother' | 'hyphenated' | 'all'): string[]; caps(range?: CapsRange): LastName; decaps(range?: CapsRange): LastName; /** Makes a copy of the current name. */ copyWith(values?: { father?: string; mother?: string; format?: Surname; }): LastName; } export declare function isNameArray(value?: unknown): value is Name[]; /** JSON signature for `FullName` data. */ export interface JsonName { prefix?: string; firstName: string | { value: string; more?: string[]; }; middleName?: string | string[]; lastName: string | { father: string; mother?: string; }; suffix?: string; }