import { Template } from './Templates.d.js';
import { ChildReportExecutionData } from './ExecutionData.d.js';
import { QuerySummaryItem } from '../components/_async/request-details/types.d.js';

import Dict = NodeJS.Dict;

interface StoredReportData {
    reportId: string;
    variantId?: string;
    id: string;
    executionId?: string | undefined;
    tableId?: string | undefined;
    reportName: string;
    variantName?: string;
    name: string;
    description: string;
    status?: RequestStatus;
    timestamp: AsyncReportsTimestamp;
    dataProductDefinitionsPath?: string;
    dpdPathFromQuery?: boolean;
    query?: AsyncReportQueryData;
    interactiveQuery?: AsyncReportQueryData;
    url?: AsyncReportUrlData;
    type: ReportType;
    loadType?: LoadType;
    childExecutionData?: Array<ChildReportExecutionData>;
}
interface RequestedReport extends StoredReportData {
    template: Template;
    errorMessage?: string;
    filters: ParamsConfig;
    sortBy: ParamsConfig;
}
interface RequestedDashboard extends StoredReportData {
    metrics: {
        name: string;
    }[];
}
type RecentlyViewedReport = StoredReportData;
type UserReportData = RequestedReport | RecentlyViewedReport | StoredReportData | RequestedDashboard;
interface AsyncReportUrlData {
    origin: string;
    request?: AsyncReportUrlItemData;
    report?: AsyncReportUrlItemData;
    polling?: AsyncReportUrlItemData;
}
interface AsyncReportUrlItemData {
    pathname?: string | undefined;
    fullUrl?: string | undefined;
    search?: string;
    default?: string;
}
interface AsyncReportQueryData {
    data: Dict<string | string[]>;
    summary: QuerySummaryItem[];
}
interface ParamsConfig {
    data: Dict<string>;
    queryString: string;
}
declare enum RequestStatus {
    SUBMITTED = "SUBMITTED",
    STARTED = "STARTED",
    PICKED = "PICKED",
    FINISHED = "FINISHED",
    FAILED = "FAILED",
    ABORTED = "ABORTED",
    EXPIRED = "EXPIRED",
    READY = "READY",
    ALL = "ALL"
}
declare enum ReportType {
    REPORT = "report",
    DASHBOARD = "dashboard",
    UNAVAILABLE = "unavailable"
}
interface AsyncReportsTimestamp {
    lastViewed?: Date;
    requested?: Date;
    completed?: Date;
    expired?: Date;
    failed?: Date;
    retried?: Date;
    aborted?: Date;
    refresh?: Date;
}
declare enum LoadType {
    SYNC = "sync",
    ASYNC = "async",
    SCHEDULED = "scheduled"
}

export { LoadType, ReportType, RequestStatus };
export type { AsyncReportQueryData, AsyncReportUrlData, AsyncReportUrlItemData, AsyncReportsTimestamp, ParamsConfig, RecentlyViewedReport, RequestedDashboard, RequestedReport, StoredReportData, UserReportData };
