import { type ClassValue } from 'clsx'; /** * Utility functions for common operations */ /** * Merge class names with Tailwind CSS * @param inputs - Class names to merge * @returns Merged class names */ export declare function cn(...inputs: ClassValue[]): string; /** * Human-readable message for a caught value. * * `catch (e)` binds `unknown` under this tsconfig, and a thrown value is not * guaranteed to be an `Error`. Use this instead of `catch (e: any)` + * `e.message`, which crashes on a thrown string/object with no `message`. * * @param error - The caught value * @param fallback - Returned when the value carries no usable message */ export declare function errorMessage(error: unknown, fallback?: string): string; /** * Human-readable message for a FAILED API response body. * * `Response.json()` is typed `any`, so `body.error` used to be read off an * `any` at every call site. The platform's route helpers answer errors with * `{ error, code, details }` (see `errorResponse` in the hub's * `lib/api/route-base.ts`); a few endpoints answer `{ message }` instead, so * both are accepted before giving up. * * @param payload - The parsed response body (or whatever came back) * @param fallback - Returned when the body carries no usable message */ export declare function apiErrorMessage(payload: unknown, fallback: string): string; /** * Delay execution for a specified time * @param ms - Milliseconds to delay * @returns Promise that resolves after the delay */ export declare function delay(ms: number): Promise; /** * Generate a random string of specified length * @param length - Length of the string * @returns Random string */ export declare function generateRandomString(length?: number): string; /** * Truncate a string to a specified length * @param str - String to truncate * @param maxLength - Maximum length * @param suffix - Suffix to add to truncated string * @returns Truncated string */ export declare function truncateString(str: string, maxLength: number, suffix?: string): string; /** * Serialize a JSON-LD schema for a `" inside any admin/user-entered field would terminate the tag * early (stored XSS). Every "<" becomes the JSON escape sequence * backslash-u003c — still valid JSON, inert in HTML. */ export declare function serializeJsonLd(schema: unknown): string; /** * Deep clone an object through a JSON round-trip. * * Lossy by construction, and deliberately so — this is the JSON projection of * `T`: `undefined` members and functions are dropped, `Date` becomes an ISO * string, `Map`/`Set` become `{}`, and a cyclic graph throws. Reach for * `structuredClone` when any of that matters. * * `JSON.parse` is typed `any`; the assertion states the contract above, which * is the closest a JSON clone can get to "still a `T`". * * @param obj - Object to clone (must be JSON-serializable) * @returns Cloned object */ export declare function deepClone(obj: T): T; /** * Get the Slack community join URL from environment variables * @returns Slack community join URL or fallback URL */ export declare function getSlackCommunityJoinUrl(): string; /** * Clamp a number into an inclusive range. THE one clamp for the lib and the hub * (step/page/contrast math all bottom out here). */ export declare function clamp(value: number, min: number, max: number): number; /** * Typed key-subset of an object. Keys whose value is `undefined` on the source * are still copied when present, so `pick(params, dropped)` writes explicit * `null`s (the URL-state writer's "remove this key" signal). */ export declare function pick(source: T, keys: readonly K[]): Pick; /** * React Query options for data that MUST NOT be served from the client cache. * * The rule (hub memory `feedback_no_client_query_cache_for_mutable_entities`): * anything a user can mutate, or a cron can rewrite under them, is refetched on * mount. Spread this instead of retyping `staleTime: 0` — it is also the hub * QueryClient's default, so a hook that spreads it is explicit rather than * silently inheriting. */ export declare const NO_CLIENT_CACHE: { readonly staleTime: 0; }; //# sourceMappingURL=common.d.ts.map