/** * URL and Path Utilities * * Shared utilities for URL slug generation and path manipulation * used by server.ts for generating filenames. */ /** Maximum length for generated slugs */ export declare const MAX_SLUG_LENGTH = 50; /** Maximum length for log messages in summaries */ export declare const MAX_LOG_MESSAGE_LENGTH = 200; /** * Generate a URL-safe slug from a URL path or title * * @param url - The URL to generate a slug from * @param title - Optional title to use as fallback * @returns A URL-safe slug string * * @example * ```ts * generateSlugFromUrl('https://example.com/company/acme-corp') * // Returns: 'company-acme-corp' * * generateSlugFromUrl('https://example.com/', 'Home Page') * // Returns: 'index' * ``` */ export declare function generateSlugFromUrl(url: string, title?: string): string; /** * Format a timestamp for use in filenames * * @param timestamp - Unix timestamp in milliseconds * @returns ISO date string with colons and periods replaced by dashes * * @example * ```ts * formatTimestampForFilename(Date.now()) * // Returns: '2024-01-15T10-30-45-123Z' * ``` */ export declare function formatTimestampForFilename(timestamp: number): string; /** * Generate a base filename with type prefix and timestamp * * @param type - The type prefix (e.g., 'screenshot', 'design-review', 'outline') * @param timestamp - Unix timestamp in milliseconds * @param slug - Optional slug to include in the filename * @returns A formatted filename without extension * * @example * ```ts * generateBaseFilename('screenshot', Date.now()) * // Returns: 'screenshot-2024-01-15T10-30-45-123Z' * * generateBaseFilename('outline', Date.now(), 'company-page') * // Returns: 'outline-company-page-2024-01-15T10-30-45-123Z' * ``` */ export declare function generateBaseFilename(type: string, timestamp: number, slug?: string): string; /** * Default screenshot directory path */ export declare const SCREENSHOT_DIR = ".tmp/sweetlink-screenshots"; /** * Default HMR screenshot directory path */ export declare const HMR_SCREENSHOT_DIR = ".tmp/hmr-screenshots"; /** * Truncate a message to a maximum length * * @param message - The message to truncate * @param maxLength - Maximum length (default: MAX_LOG_MESSAGE_LENGTH) * @returns Truncated message */ export declare function truncateMessage(message: string, maxLength?: number): string; //# sourceMappingURL=urlUtils.d.ts.map