import { type InsightsSummary, type InsightsDateRange } from '@n8n/api-types';
import { LicenseState, Logger } from '@n8n/backend-common';
import { InstanceSettings } from 'n8n-core';
import type { PeriodUnit } from './database/entities/insights-shared';
import { InsightsByPeriodRepository } from './database/repositories/insights-by-period.repository';
import { InsightsCollectionService } from './insights-collection.service';
import { InsightsCompactionService } from './insights-compaction.service';
import { InsightsPruningService } from './insights-pruning.service';
export declare class InsightsService {
    private readonly insightsByPeriodRepository;
    private readonly compactionService;
    private readonly collectionService;
    private readonly pruningService;
    private readonly licenseState;
    private readonly instanceSettings;
    private readonly logger;
    constructor(insightsByPeriodRepository: InsightsByPeriodRepository, compactionService: InsightsCompactionService, collectionService: InsightsCollectionService, pruningService: InsightsPruningService, licenseState: LicenseState, instanceSettings: InstanceSettings, logger: Logger);
    settings(): {
        summary: boolean;
        dashboard: boolean;
        dateRanges: DateRange[];
    };
    startTimers(): void;
    startCompactionAndPruningTimers(): void;
    stopCompactionAndPruningTimers(): void;
    shutdown(): Promise<void>;
    getInsightsSummary({ periodLengthInDays, }: {
        periodLengthInDays: number;
    }): Promise<InsightsSummary>;
    getInsightsByWorkflow({ maxAgeInDays, skip, take, sortBy, }: {
        maxAgeInDays: number;
        skip?: number;
        take?: number;
        sortBy?: string;
    }): Promise<{
        count: number;
        data: {
            workflowId: string;
            projectId: string;
            failed: number;
            workflowName: string;
            succeeded: number;
            total: number;
            projectName: string;
            failureRate: number;
            runTime: number;
            averageRunTime: number;
            timeSaved: number;
        }[];
    }>;
    getInsightsByTime({ maxAgeInDays, periodUnit, }: {
        maxAgeInDays: number;
        periodUnit: PeriodUnit;
    }): Promise<{
        date: string;
        values: {
            total: number;
            succeeded: number;
            failed: number;
            failureRate: number;
            averageRunTime: number;
            timeSaved: number;
        };
    }[]>;
    getMaxAgeInDaysAndGranularity(dateRangeKey: InsightsDateRange['key']): InsightsDateRange & {
        maxAgeInDays: number;
    };
    getAvailableDateRanges(): DateRange[];
}
type DateRange = {
    key: 'day' | 'week' | '2weeks' | 'month' | 'quarter' | '6months' | 'year';
    licensed: boolean;
    granularity: 'hour' | 'day' | 'week';
};
export {};
