import { SupportedDbtAdapter } from '../types/dbt';
import { DimensionType } from '../types/field';
import { TimeFrames } from '../types/timeFrames';
export declare enum WeekDay {
    MONDAY = 0,
    TUESDAY = 1,
    WEDNESDAY = 2,
    THURSDAY = 3,
    FRIDAY = 4,
    SATURDAY = 5,
    SUNDAY = 6
}
export declare const isWeekDay: (value: unknown) => value is WeekDay;
/** Per-warehouse SQL for the DATE_TRUNC timezone round-trip. `toProjectTz`
 *  shifts into project-local wall-clock before truncation; `toUTC` converts
 *  the truncated value back into a proper UTC instant. `castAsDate` casts a
 *  truncated wall-clock value to a real DATE (GLITCH-452) — every adapter's
 *  wrapped path truncates a naive project-local wall-clock, so `CAST(x AS DATE)`
 *  reads the right date. `sourceTimezone` is the timezone the
 *  column is in — only Snowflake uses it explicitly (in `CONVERT_TIMEZONE`);
 *  other adapters ignore it.
 *
 *  `castToInstant` rebases a naive timestamp into a true instant via the
 *  warehouse session timezone; identity in value for aware columns. It is the
 *  inner term of `toProjectTz`, composed below so the two cannot drift. */
type DateTruncTimezoneConversion = {
    toProjectTz: (sql: string, tz: string, sourceTimezone?: string) => string;
    toUTC: (sql: string, tz: string) => string;
    castAsDate: (sql: string, tz: string) => string;
    castToInstant: (sql: string) => string;
};
export declare const dateTruncTimezoneConversions: Record<SupportedDbtAdapter, DateTruncTimezoneConversion>;
type DateExtractTimezoneConversion = {
    toExtractInputTz: (sql: string, tz: string, sourceTimezone?: string) => string;
};
export declare const dateExtractsTimezoneConversions: Record<SupportedDbtAdapter, DateExtractTimezoneConversion>;
export declare const SUB_DAY_TIME_FRAMES: ReadonlySet<TimeFrames>;
export declare const isSubDayTimeFrame: (tf: TimeFrames) => boolean;
export declare const isTimezoneRoundTripNoOp: (adapterType: SupportedDbtAdapter, timezone: string, sourceTimezone?: string) => boolean;
export declare const getSqlForTruncatedDate: (adapterType: SupportedDbtAdapter, timeFrame: TimeFrames, originalSql: string, type: DimensionType, startOfWeek?: WeekDay | null, timezone?: string, sourceTimezone?: string, castDayOrCoarserToDate?: boolean) => string;
export declare const getSqlForDatePart: (adapterType: SupportedDbtAdapter, timeFrame: TimeFrames, originalSql: string, type: DimensionType, startOfWeek?: WeekDay | null, timezone?: string, sourceTimezone?: string) => string;
export declare const getSqlForDatePartName: (adapterType: SupportedDbtAdapter, timeFrame: TimeFrames, originalSql: string, type: DimensionType, _startOfWeek?: WeekDay | null, timezone?: string, sourceTimezone?: string) => string;
type TimeFrameConfig = {
    getLabel: () => string;
    getDimensionType: (fallback: DimensionType) => DimensionType;
    getSql: (adapterType: SupportedDbtAdapter, timeFrame: TimeFrames, originalSql: string, type: DimensionType, startOfWeek?: WeekDay | null, timezone?: string, sourceTimezone?: string) => string;
    getAxisMinInterval: () => number | null;
    getAxisLabelFormatter: () => Record<string, string> | null;
};
export declare const timeFrameConfigs: Record<TimeFrames, TimeFrameConfig>;
export declare const getDefaultTimeFrames: (type: DimensionType) => TimeFrames[];
export type ResolvedAdditionalTimeIntervals = {
    date: (TimeFrames | string)[];
    timestamp: (TimeFrames | string)[];
};
/**
 * Built-in default time frames for a dimension type, with project-level
 * `additional_time_intervals` appended (de-duplicated, built-ins first).
 */
export declare const getTimeFramesWithProjectDefaults: (type: DimensionType, additionalTimeIntervals?: ResolvedAdditionalTimeIntervals) => (TimeFrames | string)[];
/** Time frames that use DATE_TRUNC (not EXTRACT/DATE_PART). */
export declare const truncatableTimeFrames: ReadonlySet<TimeFrames>;
/** Time frames that use EXTRACT/DATE_PART or format/name functions, not DATE_TRUNC. */
export declare const extractableTimeFrames: ReadonlySet<TimeFrames>;
export declare const isTimeInterval: (value: string) => value is TimeFrames;
export declare const validateTimeFrames: (values: string[]) => TimeFrames[];
export declare const timeFrameOrder: (TimeFrames | undefined)[];
export declare const sortTimeFrames: (a: TimeFrames, b: TimeFrames) => number;
export declare const SUB_DAY_GRANULARITIES: ReadonlySet<string>;
export declare const isSubDayGranularity: (g: string) => boolean;
export declare const getDateDimension: (dimensionId: string) => {
    baseDimensionId: string;
    newTimeFrame: TimeFrames;
} | {
    baseDimensionId?: undefined;
    newTimeFrame?: undefined;
};
export {};
//# sourceMappingURL=timeFrames.d.ts.map