UNPKG

@phensley/cldr-core

Version:
38 lines (37 loc) 2.06 kB
import { CalendarDate, CalendarType } from '../../systems/calendars'; import { DayPeriodType, Schema } from '@phensley/cldr-schema'; import { Bundle } from '../../resource'; import { NumberParams } from '../../common/private'; import { CalendarInternals } from '../internals'; import { Renderer } from '../../utils/render'; import { CalendarContext, CalendarFormatter } from './formatter'; import { Internals } from '../internals'; import { Cache } from '../../utils/cache'; import { DateTimeNode } from '../../parsing/patterns/date'; import { DayPeriodRules } from './rules'; /** * Framework scoped calendar functions. */ export declare class CalendarInternalsImpl implements CalendarInternals { readonly internals: Internals; readonly cacheSize: number; readonly schema: Schema; readonly dayPeriodRules: DayPeriodRules; readonly patternCache: Cache<DateTimeNode[]>; readonly hourPatternCache: Cache<[DateTimeNode[], DateTimeNode[]]>; readonly calendarFormatterCache: Cache<CalendarFormatter<CalendarDate>>; constructor(internals: Internals, cacheSize?: number); flexDayPeriod(bundle: Bundle, minutes: number): DayPeriodType | undefined; getCalendarFormatter(type: CalendarType): CalendarFormatter<CalendarDate>; parseDatePattern(raw: string): DateTimeNode[]; getHourPattern(raw: string, negative: boolean): DateTimeNode[]; weekFirstDay(region: string): number; weekMinDays(region: string): number; formatDateTime<R>(calendar: CalendarType, ctx: CalendarContext<CalendarDate>, renderer: Renderer<R>, date?: DateTimeNode[], time?: DateTimeNode[], wrapper?: string): R; formatInterval<R>(calendar: CalendarType, bundle: Bundle, params: NumberParams, renderer: Renderer<R>, start: CalendarDate, end: CalendarDate, pattern: DateTimeNode[]): R; selectCalendar(bundle: Bundle, ca?: CalendarType): CalendarType; /** * Translates a string into a supported calendar type, or undefined if none match. */ protected supportedCalendar(c: string | undefined): CalendarType | undefined; }