/**
 * `<relative-time-ui>` — Display a timestamp as a human-readable relative time — "3 hours ago",
"in 2 days", "yesterday". Wraps `Intl.RelativeTimeFormat` for i18n
+ auto-updates on a configurable interval (default every 60 s) so
rendered text stays current without re-mounting.

Set `[datetime]` to an ISO 8601 timestamp; the element computes the
delta against `Date.now()` and renders the formatted string. Pair
with a `title` for full-precision-on-hover (the element sets one
automatically from a default locale-aware long format unless you
override).

 *
 * @see https://ui-kit.exe.xyz/site/components/relative-time
 *
 * Type declarations generated by scripts/build/dts-codegen.mjs from
 * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
 * run `npm run build:components`, then `npm run codegen:dts` to
 * regenerate; or hand-author this file fully if rich event types are
 * needed beyond what the yaml `events:` block can express.
 */

import { UIElement } from '../../core/element.js';

export class UIRelativeTime extends UIElement {
  /** ISO 8601 timestamp (e.g. `2026-05-25T09:30:00Z`) or any string
parseable by `Date`. Required for output — empty value renders
nothing.
 */
  datetime: string;
  /** BCP-47 locale tag for the formatter. Empty defaults to the document
locale (`<html lang>`) then to the browser default.
 */
  locale: string;
  /** `Intl.RelativeTimeFormat` `numeric` option. `auto` lets the
formatter substitute "yesterday" / "tomorrow" for ±1 day deltas;
`always` keeps the numeric form ("1 day ago"). Defaults to `auto`.
 */
  numeric: 'auto' | 'always';
  /** `Intl.RelativeTimeFormat` `style` option. `long` = "3 hours ago",
`short` = "3 hr. ago", `narrow` = "3h ago". Defaults to `long`.
 */
  timeStyle: 'long' | 'short' | 'narrow';
  /** Auto-refresh interval in seconds. The component restarts a
`setInterval` tick that re-reads `Date.now()` and re-renders the
relative string. Set to `0` to disable auto-update (static
render). Default `60` (one minute) is the natural cadence for
"minutes ago" granularity.
 */
  updateInterval: number;
}
