import type { TemporalDurationObject } from '../intrinsics/Temporal/Duration.mts'; import { ObjectValue, ThrowCompletion, Value, type Integer, type PlainCompletion, type PlainEvaluator, type TimeRecord, type ValueEvaluator } from '#self'; /** https://tc39.es/proposal-temporal/#sec-temporal-iso-string-time-zone-parse-records */ export interface ISOStringTimeZoneParseRecord { readonly Z: boolean; readonly OffsetString: string | undefined; readonly TimeZoneAnnotation: string | undefined; } /** https://tc39.es/proposal-temporal/#sec-temporal-iso-date-time-parse-records */ export interface ISODateTimeParseRecord { readonly Year: bigint | undefined; readonly Month: bigint; readonly Day: bigint; readonly Time: TimeRecord | 'start-of-day'; readonly TimeZone: ISOStringTimeZoneParseRecord; readonly Calendar: string | undefined; } /** https://tc39.es/proposal-temporal/#sec-temporal-parseisodatetime */ export declare function ParseISODateTime(isoString: string, allowedFormats: Array<'TemporalInstantString' | 'TemporalDateTimeString[~Zoned]' | 'TemporalTimeString' | 'TemporalMonthDayString' | 'TemporalYearMonthString' | 'TemporalDateTimeString[+Zoned]' | 'DateTimeString'>): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalcalendarstring */ export declare function ParseTemporalCalendarString(isoString: string): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldurationstring */ export declare function ParseTemporalDurationString(isoString: string): ValueEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimezonestring */ export declare function ParseTemporalTimeZoneString(timeZoneString: string): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-time-zone-identifier-parse-records */ export interface TimeZoneIdentifierParseRecord { Name: string | undefined; OffsetMinutes: bigint | undefined; } /** https://tc39.es/proposal-temporal/#sec-temporal-parsemonthcode */ export declare function ParseMonthCode(argument: Value | string): PlainEvaluator<{ MonthNumber: Integer; IsLeapMonth: boolean; }>; /** https://tc39.es/proposal-temporal/#sec-parsedatetimeutcoffset */ export declare function ParseDateTimeUTCOffset(offsetString: string): PlainCompletion; export declare function ParseTimeZoneIdentifier(identifier: string): PlainCompletion; export declare namespace RFC9557ParseNode { interface Annotation { readonly CriticalFlag: boolean; readonly AnnotationKey: string; readonly AnnotationValue: string; } interface UTCOffset { readonly Sign: '+' | '-'; readonly Hour: bigint; readonly Minute?: bigint; readonly Second?: bigint; readonly TemporalDecimalFraction?: { readonly separator: '.' | ','; readonly digits: string; }; readonly Extended?: boolean; readonly sourceText: string; } interface TimeZoneIdentifier { readonly UTCOffset?: UTCOffset; readonly TimeZoneIANAName?: string; readonly sourceText: string; } interface TimeZoneAnnotation { readonly CriticalFlag: boolean; readonly TimeZoneIdentifier: TimeZoneIdentifier; } interface DateSpecYearMonth { readonly Year: bigint; readonly Month: bigint; } interface DateSpecMonthDay { readonly Month: bigint; readonly Day: bigint; } interface DateSpec { readonly Year: bigint; readonly Month: bigint; readonly Day: bigint; } interface DateTimeUTCOffset { readonly UTCDesignator?: 'Z' | 'z'; readonly UTCOffset?: UTCOffset; } interface TemporalDecimalFraction { readonly separator: '.' | ','; readonly digits: string; } interface TimeSpec { readonly Hour: bigint; readonly Minute?: bigint; readonly Second?: bigint; readonly TemporalDecimalFraction?: TemporalDecimalFraction; } interface DateTime { readonly Date: DateSpec; readonly DateTimeSeparator?: ' ' | 'T' | 't'; readonly Time?: TimeSpec; readonly DateTimeUTCOffset?: DateTimeUTCOffset; } interface AnnotatedDateTime { readonly DateTime: DateTime; readonly TimeZoneAnnotation?: TimeZoneAnnotation; readonly Annotations?: readonly Annotation[]; } interface TemporalMonthDayString { readonly AnnotatedMonthDay?: AnnotatedMonthDay; readonly AnnotatedDateTime?: AnnotatedDateTime; } interface AnnotatedMonthDay { readonly DateSpecMonthDay: DateSpecMonthDay; readonly TimeZoneAnnotation?: TimeZoneAnnotation; readonly Annotations?: readonly Annotation[]; } interface AnnotatedTime { readonly TimeDesignator?: 'T' | 't'; readonly Time: TimeSpec; readonly DateTimeUTCOffset?: DateTimeUTCOffset; readonly TimeZoneAnnotation?: TimeZoneAnnotation; readonly Annotations?: readonly Annotation[]; } interface TemporalTimeString { readonly AnnotatedDateTime?: AnnotatedDateTime; readonly AnnotatedTime?: AnnotatedTime; } interface TemporalYearMonthString { readonly AnnotatedYearMonth?: AnnotatedYearMonth; readonly AnnotatedDateTime?: AnnotatedDateTime; } interface AnnotatedYearMonth { readonly DateSpecYearMonth: DateSpecYearMonth; readonly TimeZoneAnnotation?: TimeZoneAnnotation; readonly Annotations?: readonly Annotation[]; } interface TemporalInstantString { readonly Date: DateSpec; readonly DateTimeSeparator: ' ' | 'T' | 't'; readonly Time: TimeSpec; readonly DateTimeUTCOffset: DateTimeUTCOffset; readonly TimeZoneAnnotation?: TimeZoneAnnotation; readonly Annotations?: readonly Annotation[]; } interface Duration { readonly AsciiSign?: '+' | '-'; readonly Years?: string; readonly Months?: string; readonly Weeks?: string; readonly Days?: string; readonly Hours?: string; readonly Minutes?: string; readonly Seconds?: string; } } export declare class DateParser { static parse(source: string, f: (parser: DateParser) => T, parameters?: Partial): T | ObjectValue[]; input: string; pos: number; constructor(input: string, parameters?: Partial); private grammarParameters; private earlyErrors; private raise; peek(length?: number): string | undefined; private lookahead; private lookaheads; private eat; private eatRegExp; private parseDateSeparator; private parseDateSeparatorExtendedOrNot; private parseDateYear; private parseDateMonth; private parseDateDay; private parseDate; with(parameters: Partial, f: () => T): T; private parseDateTimeSeparator; private parseTimeSecond; private parseTimeSeparator; private parseTimeSeparatorExtendedOrNot; private parseTime; private parseDateTimeUTCOffset; parseDateTime(): RFC9557ParseNode.DateTime; private parseAnnotatedDateTime; private parseAnnotatedTime; expect(char: string, message?: () => ThrowCompletion): void; private parse; try(f: () => T, consumeAll: boolean): T | undefined; consumeAll(): void; parseAnnotationValue(): string; parseTemporalDurationString(): RFC9557ParseNode.Duration; parseTemporalDateTimeString(): RFC9557ParseNode.AnnotatedDateTime; parseTemporalInstantString(): RFC9557ParseNode.TemporalInstantString; parseTemporalYearMonthString(): RFC9557ParseNode.TemporalYearMonthString; parseAnnotatedYearMonth(): RFC9557ParseNode.AnnotatedYearMonth; parseTemporalMonthDayString(): RFC9557ParseNode.TemporalMonthDayString; parseAnnotatedMonthDay(): RFC9557ParseNode.AnnotatedMonthDay; parseTemporalTimeString(): RFC9557ParseNode.TemporalTimeString; parseTimeZoneIdentifier(): RFC9557ParseNode.TimeZoneIdentifier; parseUTCOffset(): RFC9557ParseNode.UTCOffset; parseAsciiSign(): '+' | '-'; parseTimeZoneIANAName(): string; parseHour(): bigint; parseMinuteSecond(): bigint; tryParseTemporalDecimalFraction(): RFC9557ParseNode.TemporalDecimalFraction | undefined; parseDateSpecMonthDay(): RFC9557ParseNode.DateSpecMonthDay; parseDateSpecYearMonth(): RFC9557ParseNode.DateSpecYearMonth; parseTimeZoneAnnotation(): RFC9557ParseNode.TimeZoneAnnotation; parseAnnotations(): Array; parseAnnotationKey(): string; /** https://tc39.es/ecma262/pr/3759/#sec-rfc9557grammar-static-semantics-isvalidmonthday */ IsValidMonthDay(node: RFC9557ParseNode.DateSpec | RFC9557ParseNode.DateSpecMonthDay): void; /** https://tc39.es/ecma262/pr/3759/#sec-rfc9557grammar-static-semantics-isvaliddate */ IsValidDate(node: RFC9557ParseNode.DateSpec): void; } //# sourceMappingURL=TemporalParser.d.mts.map