/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { type Dayjs } from 'dayjs';
import React from 'react';
/**
 * Value shape used by NocoBase's `$date*` filter operators. Two flavours:
 *
 * - For "Exact day" mode: a **formatted string** at the granularity of the picker — `"2026-02-15"` (date), `"2026-02"` (month), `"2026"` (year), `"2026-Q1"` (quarter). For `$dateBetween` (`isRange`), a `[string, string]` tuple. Strings (not Dayjs) so the value serializes verbatim into the query string the same way v1 does (`filter=%7B%22$and%22:[%7B%22lockedTs%22:%7B%22$dateOn%22:%222026-02%22%7D%7D]%7D`).
 * - For relative modes (Today / Past 3 days / This Week / …): a `{ type, number?, unit? }` descriptor that the server resolves to a concrete range at query time.
 */
export type DateFilterValue = string | [string, string] | {
    type: string;
    number?: number;
    unit?: 'day' | 'week' | 'month' | 'year';
} | null | undefined;
export interface DateFilterDynamicComponentProps {
    value?: DateFilterValue;
    onChange?: (value: DateFilterValue) => void;
    /** `true` for `$dateBetween`; renders a `DatePicker.RangePicker`. */
    isRange?: boolean;
    /**
     * Translator. Defaults to identity so callers can omit it when running outside a translation context (tests, storybook).
     */
    t?: (key: string) => string;
}
type PickerMode = 'date' | 'month' | 'quarter' | 'year';
/**
 * The exact format strings NocoBase's `$date*` server operators expect per picker granularity. Mirrors v1's `getPickerFormat` output under `underFilter=true`, so the URL-encoded query stays identical.
 *
 * Exported for unit tests and for downstream callers that need to parse / format `$date*` values outside this component.
 */
export declare const FORMAT_BY_PICKER: Record<PickerMode, string>;
/**
 * Parse a granularity-formatted string back into a `Dayjs`. Returns `null` on missing or unparseable input so the DatePicker's controlled-value contract stays clean.
 */
export declare const parseDateFilterValue: (value: string | undefined, picker: PickerMode) => Dayjs | null;
/**
 * Format a `Dayjs` (typically from `DatePicker.onChange`) into the server-facing string at the active picker's granularity. Returns `undefined` for empty input so callers can drop the value entirely.
 */
export declare const formatDateFilterValue: (value: Dayjs | null | undefined, picker: PickerMode) => string | undefined;
/**
 * v2 port of v1's `DateFilterDynamicComponent` — a multi-mode value input for the `$date*` operator family. Three sub-controls glued in a `Space.Compact` row:
 *
 * 1. Mode select — `Exact day` / `Past` / `Next` / `Today` / `This Week` / … Picking a relative mode emits a `{ type, number?, unit? }` descriptor that the server resolves at query time; picking `Exact day` emits a raw `Dayjs` instead.
 * 2. Picker granularity — only when mode is `Exact day`: `Date` / `Month` / `Quarter` / `Year`. Controls the antd `DatePicker`'s `picker` mode so admins can filter to e.g. "any day in 2026-03".
 * 3. Date input — antd `DatePicker` for single dates, or `DatePicker.RangePicker` when `isRange` is true (used by `$dateBetween`).
 *
 * v1 wired its own `<DatePicker.FilterWithPicker>` for the third slot; v2 inlines the picker-granularity selector here so we don't have to fork antd's DatePicker. Drops v1's `@emotion/css` (uses antd token spacing) and the `useCompile` schema-template chain (call sites pass a plain `t` translator).
 */
export declare const DateFilterDynamicComponent: React.FC<DateFilterDynamicComponentProps>;
export default DateFilterDynamicComponent;
