/** * Joins an array of strings into a natural language list. * * @param strings - The array of strings to join. * @param zeroLength - The string to return if the array is empty. Defaults to an empty string. * @returns A string that represents the natural language list. * * @example * ```typescript * naturalLanguageJoin([]); // "" * naturalLanguageJoin([], "No items"); // "No items" * naturalLanguageJoin(["apple"]); // "apple" * naturalLanguageJoin(["apple", "banana"]); // "apple and banana" * naturalLanguageJoin(["apple", "banana", "cherry"]); // "apple, banana, and cherry" * ``` */ export declare const naturalLanguageJoin: (strings: string | string[], zeroLength?: string) => string; /** * Creates a list of short identifiers from a given name. * * @param name - The name to create identifiers from. * @returns An array of unique short identifiers. * * @example * ```typescript * createShortIdentifiers("John Doe"); // ["jd", "j_d", "johdoe", "joh_doe"] * createShortIdentifiers("Alice 123"); // ["a1", "a_1", "a123", "a_12_3", "ali123", "ali_123"] * createShortIdentifiers("Bob"); // ["bob"] * ``` */ export declare const createShortIdentifiers: (name: string) => string[]; /** * Removes a prefix from a string if it exists. * * @param str - The string to remove the prefix from. * @param prefix - The prefix to remove. * @returns The string with the prefix removed if it was present, otherwise the original string. * * @example * ```typescript * trimPrefix("hello world", "hello "); // "world" * trimPrefix("hello world", "goodbye "); // "hello world" * trimPrefix("hello world", ""); // "hello world" * trimPrefix("hello world", "hello world"); // "" * ``` */ export declare const trimPrefix: (str: string, prefix: string) => string; /** * Escapes HTML special characters in a string to prevent XSS and ensure * correct rendering in HTML contexts. * * @param s - The string to escape. * @returns The escaped string with &, <, >, ", and ' replaced by their * HTML entity equivalents. */ export declare const escapeHTML: (s: string) => string; //# sourceMappingURL=strings.d.ts.map