/** * Parse a date-ish flag value into an ISO 8601 string. * * Rules: * - Date-only (`YYYY-MM-DD`) → LOCAL midnight of that date, expressed as * ISO. We deliberately do NOT use `new Date("YYYY-MM-DD")` because the * JS spec parses that as UTC midnight (a well-known footgun), which * contradicts our docs ("midnight local"). * - Datetime with offset (`YYYY-MM-DDTHH:MM:SS±HH:MM` or trailing `Z`) * → parsed as-is, timezone preserved. * - Datetime without offset (`YYYY-MM-DDTHH:MM`) → parsed as local time * per the JS spec (which for this format does use local). * - Anything else → AxiError with a clear format hint. * * Returns an ISO string (with timezone info) suitable for Google API * `timeMin` / `timeMax` parameters. */ export declare function parseDateishFlag(value: string): string; /** * Format a Google Calendar dateTime/date field for detail-view output. * Timed events: datetime + "(IANA tz)" suffix when timeZone is set. * All-day events: "YYYY-MM-DD (all-day)". * Missing/empty: empty string. * * Use for single-event detail views (get, create, update, respond). * List views should stick to offset-only for compact columns. */ export declare function formatEventTime(value: { dateTime?: string | null; date?: string | null; timeZone?: string | null; } | null | undefined): string; /** * Convert a UTC timestamp string (e.g. "2026-04-22T13:00:00Z") to an ISO * string with the system's local timezone offset (e.g. * "2026-04-22T09:00:00-04:00"). Useful for making freebusy output * consistent with events output, which already comes back in * offset-preserving form from Google. * * Invalid input returns the original string unchanged. */ export declare function toLocalOffsetISO(input: string): string; export type RangeEdge = "from" | "to"; /** * Parse one range-flag value into an ISO instant, honoring per-edge day * expansion and relative tokens. Anything that isn't a token or a bare date * falls through to `parseDateishFlag` unchanged (instant semantics, existing * error messages). */ export declare function parseRangeFlag(value: string, edge: RangeEdge, now?: Date): string; /** Local midnight of the most recent `weekStartDay` (0=Sun … 6=Sat) on or before `now`. */ export declare function startOfWeek(now: Date, weekStartDay: number): Date; export interface WindowInput { /** Raw, unresolved flag values — resolution happens here so errors can quote what was typed. */ from?: string; to?: string; today?: boolean; thisWeek?: boolean; } export interface WindowOptions { /** Already-ISO fallbacks used when the corresponding flag is absent. */ defaults?: { from?: string; to?: string; }; /** Flag spellings for error messages — `drive activity` uses --since/--until. */ flagNames?: { from: string; to: string; }; /** 0=Sun … 6=Sat. Callers resolve this from the account before calling. */ weekStartDay?: number; /** * Whether the calling command actually offers --today/--this-week. False for * `drive activity`, whose errors must not suggest flags it doesn't have * (principles.md#no-dead-end-surfaces). */ shortcuts?: boolean; now?: Date; } /** * Resolve `--today` / `--this-week` / `--from` / `--to` into one validated * window. Single source of truth for the shortcut-conflict and empty-window * rules so no call site re-implements them. */ export declare function resolveWindow(input: WindowInput, options?: WindowOptions): { from: string | undefined; to: string | undefined; };