import * as React from 'react'; export type LinkPreviewKind = 'article' | 'post' | 'video' | 'other'; export interface LinkPreviewData { url: string; title?: string | null; description?: string | null; imageUrl?: string | null; siteName?: string | null; /** Derived from `url` when missing. */ domain?: string | null; faviconUrl?: string | null; kind?: LinkPreviewKind | null; author?: string | null; publishedAt?: string | Date | null; lang?: string | null; } export type LinkPreviewVariant = 'compact' | 'row' | 'rich' | 'hero'; export interface LinkPreviewCardProps extends Omit, 'onSelect' | 'title'> { data: LinkPreviewData; /** Default `rich`. */ variant?: LinkPreviewVariant; badges?: React.ReactNode; /** Extra line under the title (municipality, topic...). */ meta?: React.ReactNode; footer?: React.ReactNode; /** Default `data.url`; `null` renders no link. */ href?: string | null; /** When set, the card is an accessible button and the external link becomes a secondary action. */ onSelect?: () => void; /** Default true → `target=_blank rel="noopener noreferrer nofollow"`. */ external?: boolean; /** Maps image/favicon URLs, e.g. to the backend image proxy. */ resolveImageUrl?: (url: string) => string; /** Default `es`. */ locale?: string; /** Reference time for the relative date (tests, SSR). */ now?: Date; /** Renders a skeleton with the same footprint. */ loading?: boolean; } /** Hostname without `www.`; best effort for malformed URLs. */ export declare function domainFromUrl(url: string): string; /** «hace 3 horas», «ayer», «hace 2 semanas»... via `Intl.RelativeTimeFormat`. */ export declare function formatRelativeTime(date: string | Date, opts?: { now?: Date; locale?: string; }): string; export interface FaviconAvatarProps { domain?: string | null; faviconUrl?: string | null; /** Used for the initial when there is no favicon (falls back to the domain). */ name?: string | null; /** Default `sm`. */ size?: 'xs' | 'sm' | 'md' | 'lg'; resolveImageUrl?: (u: string) => string; className?: string; } /** Site favicon in a fixed box; shows the site's initial when missing or broken. Decorative. */ export declare function FaviconAvatar({ domain, faviconUrl, name, size, resolveImageUrl, className, }: FaviconAvatarProps): React.JSX.Element; export interface SourceBadgeProps { domain?: string | null; siteName?: string | null; faviconUrl?: string | null; resolveImageUrl?: (u: string) => string; /** Rendered after the name (e.g. «· hace 2 h», a tier). */ suffix?: React.ReactNode; className?: string; } /** Favicon + site name (or domain): who published it. */ export declare function SourceBadge({ domain, siteName, faviconUrl, resolveImageUrl, suffix, className, }: SourceBadgeProps): React.JSX.Element; export interface MediaGridProps extends React.HTMLAttributes { /** Default `grid`. */ layout?: 'grid' | 'list'; /** Minimum card width in px for the auto-fill grid. Default 280. */ minItemWidth?: number; /** Default `md`. */ gap?: 'sm' | 'md' | 'lg'; } /** Responsive feed: auto-fill grid (one column on phones) or a vertical list. */ export declare function MediaGrid({ layout, minItemWidth, gap, className, style, ...props }: MediaGridProps): React.JSX.Element; /** * Link preview card in four variants: `compact` (one line, list/sidebar), * `row` (square thumbnail + text, feeds on phones), `rich` (16:9 image on top, * grids) and `hero` (featured item). Fixed aspect ratios → no layout shift; * skeleton + blur while the image loads; favicon/domain/initial fallback when * there is no image or it fails. The whole card is clickable (stretched * link/button) while badges and the external link stay focusable. */ export declare function LinkPreviewCard({ data, variant, badges, meta, footer, href, onSelect, external, resolveImageUrl, locale, now, loading, className, ...props }: LinkPreviewCardProps): React.JSX.Element; //# sourceMappingURL=link-preview.d.ts.map