import type { PublishDef, PublishRecordBase, PublishStatsRecordBase } from './index.ts';
import type { ReportXmlOptions } from '../../../common/report.ts';
export interface ReportPublishDef extends PublishDef<"report"> {
    publish: ReportPublishRecord;
    stats: ReportPublishStatsRecord;
}
export type ReportPublishFormat = "csv" | "json" | "xml" | "rss";
export declare const isReportPublishFormat: (input: unknown) => input is ReportPublishFormat;
export type ReportPublishExpandType = "published" | "deadlines" | "recurrence_date_range";
export declare const isReportPublishExpandType: (input: unknown) => input is ReportPublishExpandType;
/**
 * A report can be downloaded from `/report/${publishId}[/${route}]/report.${format}`.
 *
 * Search query parameters:
 * - `start`: Date string parsable by `new Date()`. Overrides expand.start.
 * - `end`: Date string parsable by `new Date()`. Overrides expand.end.
 * - `token`: Unique identifier used to track report progress.
 */
export interface ReportPublishRecord extends PublishRecordBase {
    type?: "report";
    searchId?: string;
    /**
     * If specified, for each search hit, additional rows will be added to the
     * report, based on the expand type.
     *
     * If type: "published", the report will expand with one row per :published
     * record that refers to the search hit and is within the date range.
     * The expression context passed to the panel's computed fields
     * will be extended with a `published` object containing data from the
     * corresponding :published record. NOTE: By default it will only expand
     * :published records of type: "event", unless a `filter` expression is
     * specified on the panel.
     *
     * If type: "deadlines", the report will expand with one row per deadline
     * provided by a search hit's :asset.deadline#value array. The expression
     * context passed to the panel's computed fields will be extended with a
     * `deadline` being a Date object corresponding to the deadline value.
     *
     * If type: "recurrence_date_range", the report will expand with one row
     * per date specified by a search hit's :calendarevent record (which could
     * be a recurrence expression evaluating to multiple dates) that falls within
     * the specified date range. The expression context passed to the panel's
     * computed fields will be extended with a `calendarevent` object with
     * a `start` and `end` Date object.
     */
    expand?: {
        type?: ReportPublishExpandType | "";
        start?: string;
        end?: string;
    };
    /** Asset ID */
    panel?: string;
    /** The report can be downloaded from `/report/${publishId}[/${route}]`. */
    route?: string;
    /** Field name to sort by */
    sort?: string;
    /** Sort order */
    order?: "asc" | "desc";
    /** Used by the hub, which passes it as filename extension to the download URL */
    format?: ReportPublishFormat;
    xml?: ReportXmlOptions;
}
export declare const isReportPublishRecord: (input: unknown) => input is ReportPublishRecord;
export declare const assertReportPublishRecord: (input: unknown) => ReportPublishRecord;
export interface ReportPublishStatsRecord extends PublishStatsRecordBase {
    retrieved?: {
        total?: number;
        count?: number;
    };
}
