/** * Utility functions for time parsing and manipulation */ /** * Parse ISO 8601 duration format to milliseconds using dayjs * Supports full ISO 8601 duration formats: * - PT[n]H[n]M[n]S (e.g., PT5H30M, PT1H, PT30M, PT45S) * - P[n]D (e.g., P7D, P1D) * - P[n]W (e.g., P2W for 2 weeks) * - P[n]DT[n]H[n]M[n]S (e.g., P1DT2H30M) * - P[n]Y[n]M[n]D (e.g., P1Y6M15D) * - And all combinations thereof * * @param duration - ISO 8601 duration string * @returns Duration in milliseconds * @throws Error if duration format is invalid or zero */ export declare function parseDurationToMilliseconds(duration: string): number; /** * Parse a time string that can be either an ISO 8601 timestamp or duration * If it's a duration, convert it to a timestamp relative to now * * @param since - Time string (ISO timestamp or duration like "PT5H") * @returns ISO 8601 timestamp string * @throws Error if format is invalid */ export declare function parseSinceOption(since: string): string; export interface TimestampRangeOptions { start?: string; end?: string; } export interface RequiredTimestampRange { start: string; end: string; startDate: Date; endDate: Date; } /** * Parse a required timestamp using strict ISO 8601 syntax with an explicit * timezone and includes the flag name in validation errors. */ export declare function parseIsoTimestamp(value: string, flagName: string): Date; /** * Require both endpoints of a backfill/query time range and return the parsed * dates after enforcing start <= end. */ export declare function requireTimestampRange(options: TimestampRangeOptions): RequiredTimestampRange; /** * Validate whichever endpoints are present on an optional time range without * requiring callers that only support one bound to synthesize the other. */ export declare function validateOptionalTimestampRange(options: TimestampRangeOptions): void; //# sourceMappingURL=time-utils.d.ts.map