import { ValueObject } from './value-object.js'; /** * Text Value Object * * Represents a validated string value with utility methods for text manipulation. * Extends the ValueObject base class to provide immutability and value semantics. * * @example * ```typescript * const text = new Text('Hello World'); * console.log(text.toString()); // 'Hello World' * console.log(text.toSlug()); // 'hello-world' * ``` */ declare class Text extends ValueObject { /** * Creates a new Text instance. * * @param text - The string value to be wrapped in the Text value object * @throws {Error} Throws 'Not a valid Text' if the input is not a string * * @example * ```typescript * const text = new Text('Sample text'); * ``` */ constructor(text: string); /** * Validates if the provided input is a valid string. * * @param text - The value to validate * @returns true if the value is a string, false otherwise * * @example * ```typescript * Text.validate('hello'); // true * Text.validate(123); // false * Text.validate(null); // false * ``` */ static validate(text: string): boolean; /** * Factory method to create a new Text instance. * * @param input - The string value to be wrapped in the Text value object * @returns A new Text instance * @throws {Error} Throws 'Not a valid Text' if the input is not a string * * @example * ```typescript * const text = Text.create('Sample text'); * ``` */ static create(input: string): Text; /** * Returns the string representation of the Text value object. * * @returns The underlying string value * * @example * ```typescript * const text = new Text('Hello'); * console.log(text.toString()); // 'Hello' * ``` */ toString(): string; /** * Converts the text to a URL-friendly slug format. * * The transformation process: * 1. Converts to lowercase * 2. Normalizes Unicode characters (NFD form) * 3. Removes diacritical marks (accents) * 4. Removes all non-alphanumeric characters * * @returns A slug version of the text (lowercase alphanumeric only) * * @example * ```typescript * const text = new Text('Hello World!'); * console.log(text.toSlug()); // 'helloworld' * * const text2 = new Text('Café José'); * console.log(text2.toSlug()); // 'cafejose' * * const text3 = new Text(' Multiple Spaces '); * console.log(text3.toSlug()); // 'multiplespaces' * * const text4 = new Text('Product-123'); * console.log(text4.toSlug()); // 'product123' * ``` */ toSlug(): string; } export { Text };