import { NameOrder, Namon, Separator, Title, Surname } from './types.js'; /** * The Configuration to use across the other components. * * The multiton pattern is used to handle configurations across the `namefully` * setup. This adds consistency when building other components such as `FirstName`, * `LastName`, or `Name` of distinct types that may be of particular shapes. * * For example, a person's `FullName` may appear by: * - NameOrder.FIRST_NAME: `Jon Snow` or * - NameOrder.LAST_NAME: `Snow Jon`. * * `Config` makes it easy to set up a specific configuration for `Namefully` * and reuse it through other instances or components along the way. If a new * `Config` is needed, a named configuration may be created. It is actually * advised to use named `Config.create(name)` instead as it may help mitigate issues * and avoid confusion and ambiguity in the future. Plus, a named configuration * explains its purpose. * * ```ts * const defaultConfig = Config.create(); * const mergedConfig = Config.merge({ name: 'other', title: Title.US }); * const copyConfig = mergedConfig.copyWith({ ending: true }); * ``` * * Additionally, a configuration may be merged with or copied from an existing * configuration, prioritizing the new one's values, as shown in the example * above. */ export declare class Config { #private; /** Cache for multiple instances. */ private static cache; /** The order of appearance of a full name. */ get orderedBy(): NameOrder; /** The token used to indicate how to split string values. */ get separator(): Separator; /** * The abbreviation type to indicate whether or not to add period to a prefix * using the American or British way. */ get title(): Title; /** The option indicating if an ending suffix is used in a formal way. */ get ending(): boolean; /** * A bypass of the validation rules with this option. This option is ideal * to avoid checking their validity. */ get bypass(): boolean; /** * An option indicating how to format a surname. * * The supported formats are: * - `FATHER` name only * - `MOTHER` name only * - `HYPHENATED`, joining both father and mother names with a hyphen * - `ALL`, joining both father and mother names with a space. * * Note that this option can be set when creating a `LastName`. As this can * become ambiguous at the time of handling it, the value set in this is * prioritized and viewed as the source of truth for future considerations. */ get surname(): Surname; /** Whether to parse a single word name as a mononym. */ get mono(): boolean | Namon; /** The name of the cached configuration. */ get name(): string; private constructor(); /** * Returns a named configuration with default values. * @param name describing its purpose. */ static create(name?: string): Config; /** * Returns a combined version of the existing values of the default configuration * and the provided optional values of another configuration. * @param other partial config to be combined with. */ static merge(other?: Partial): Config; /** * Returns a copy of this configuration merged with the provided values. * * The word `_copy` is added to the existing config's name to create the new * config's name if the name already exists for previous configurations. This * is useful to maintain the uniqueness of each configuration. For example, * if the new copy is made from the default configuration, this new copy will * be named `default_copy`. */ copyWith(options?: Partial): Config; /** Makes an exact copy of the current configuration. */ clone(): Config; /** Resets the configuration by setting it back to its default values. */ reset(): void; /** Allows the possibility to alter behavior-related options after creating a name set. */ update({ orderedBy, title, ending }: Partial>): void; }