/** * @deprecated Use `cn` instead. * @param args * @returns */ declare function classNames(...args: unknown[]): string; /** * Joins class names from strings, numbers, arrays and condition maps into a single space-separated string. Falsy * arguments are skipped, arrays are flattened recursively, and object keys are kept only where the value is truthy. * Duplicates are not removed. * * @param args Class name sources. * @returns Space-separated class list. * * @example * ```ts * cn('p-button', ['p-button-sm', null], { 'p-disabled': disabled, 'p-button-text': false }); * // 'p-button p-button-sm p-disabled' (when disabled is true) * ``` */ declare function cn(...args: unknown[]): string; /** * How `pcn` and `psel` rename class names. * * @since 0.8.3 */ interface ClassPrefixOptions { /** * The prefix class names get. Without one, or when it equals `from`, nothing is renamed. */ prefix?: string | undefined; /** * The prefix class names carry before renaming. * * @default 'p' */ from?: string | undefined; /** * Names, without the prefix, that keep their prefix, together with their `-` variants. `['icon']` * keeps `p-icon` and `p-icon-spin` but still renames `p-iconfield`. */ keep?: readonly string[] | undefined; } /** * Joins class names like `cn`, then renames the prefix of every class that carries `from` (`p` by * default). Idempotent, and the same as `cn` without a prefix or when the prefix equals `from`. * * @param options The new prefix, or `{ prefix, from, keep }`. * @param args Class name sources, as for `cn`. * @returns Space-separated, prefixed class list. * * @example * ```ts * pcn('x', 'p-button', { 'p-disabled': disabled }); // 'x-button x-disabled' (when disabled is true) * pcn({ prefix: 'x', keep: ['icon'] }, 'p-button p-icon'); // 'x-button p-icon' * ``` */ declare function pcn(options: string | ClassPrefixOptions | undefined, ...args: unknown[]): string; /** * Renames the prefixed classes of a DOM query selector: `.p-` classes and the values of `[class^=]`, * `[class*=]`, `[class~=]` and the other `[class...=]` forms. Takes the same options as `pcn`. * Idempotent, and a no-op without a prefix or when the prefix equals `from`. * * @param options The new prefix, or `{ prefix, from, keep }`. * @param selector Selector to rewrite; `null`, `undefined` and `''` are returned as given. * @returns The prefixed selector. * * @example * ```ts * psel('x', '.p-dialog [class^="p-"]'); // '.x-dialog [class^="x-"]' * ``` */ declare function psel(options: string | ClassPrefixOptions | undefined, selector: T): T; export { type ClassPrefixOptions, classNames, cn, pcn, psel };