/** * Removes duplicate characters from a string, keeping only the first occurrence of each character. * * @param s - The input string to deduplicate * @returns A new string with duplicate characters removed * * @example * dedup("aabbcc") // "abc" * dedup("hello") // "helo" */ export declare const dedup: (s: string) => string; /** * Regular expression flags quick reference and type definitions. * Provides constants and types for working with RegExp flags. */ /** Union type of all valid RegExp flags */ export type RegExpFlag = 'i' | 'g' | 'm' | 's' | 'u' | 'y' | 'd'; /** * Named constants for RegExp flags for better readability. * Maps descriptive names to their corresponding flag characters. */ export declare const RegExpFlags: Record; /** * Human-readable descriptions of what each RegExp flag does. * Useful for documentation and debugging. */ export declare const RegExpFlagMeanings: Record; /** Array of all valid RegExp flags */ export declare const allRegExpFlags: RegExpFlag[]; /** Union type for various ways to specify RegExp flags */ export type RegExpFlags = string | number | RegExpFlag | RegExpFlag[]; /** * Normalizes and validates RegExp flags, removing duplicates and invalid characters. * Converts various flag formats to a clean string of valid flags. * * @param flags - The flags to normalize (string, array, or undefined) * @returns A deduplicated string of valid RegExp flags * * @example * regexpFlags(['g', 'i', 'g']) // "gi" * regexpFlags("gim") // "gim" * regexpFlags("xyz") // "" (invalid flags removed) */ export declare function regexpFlags(flags: RegExpFlags | undefined): string; /** * Creates a new RegExp with the specified flags, replacing any existing flags. * Preserves parsers from the original RegExp if present. * * @param rx - The input RegExp, string, or number to convert * @param flags - The new flags to apply (optional, uses existing flags if not provided) * @returns A new RegExp with the specified flags and preserved parsers * * @example * setFlags(/abc/i, 'g') // /abc/g * setFlags('hello', 'i') // /hello/i */ export declare function setFlags(rx: string | RegExp, flags?: RegExpFlags): RegExp; /** * Adds new flags to an existing RegExp without removing existing ones. * Preserves parsers from the original RegExp if present. * * @param rx - The input RegExp, string, or number to convert * @param flags - The flags to add to existing flags * @returns A new RegExp with combined flags and preserved parsers * * @example * withFlags(/abc/i, 'g') // /abc/gi * withFlags('hello', 'im') // /hello/im */ export declare function withFlags(rx: string | number | RegExp, flags?: RegExpFlags): RegExp; /** * Removes specified flags from an existing RegExp. * Preserves parsers from the original RegExp if present. * * @param rx - The input RegExp, string, or number to convert * @param flags - The flags to remove from existing flags * @returns A new RegExp with specified flags removed and preserved parsers * * @example * removeFlags(/abc/gi, 'i') // /abc/g * removeFlags(/hello/im, 'm') // /hello/i */ export declare function removeFlags(rx: string | number | RegExp, flags?: RegExpFlags): RegExp; //# sourceMappingURL=flags.d.ts.map