import type { CloudConfig, EnvironmentType } from '@ts-cloud/core';
import type { ControlPlaneStore } from '../control-plane';
import type { AppendTelemetryInput, TelemetryCollectionStatus, TelemetryPolicy } from '../telemetry';
export declare class TelemetryCollectionCache<T> {
    private readonly now;
    private readonly entries;
    constructor(now?: () => number);
    getOrCreate(key: string, ttlMs: number, force: boolean, loader: () => Promise<T>): Promise<{
        value: T;
        cached: boolean;
    }>;
    invalidate(prefix: string): void;
}
export interface TelemetryCollectionResult {
    collected: number;
    cached: boolean;
    generatedAt: string;
    statuses: TelemetryCollectionStatus[];
    errors: Array<{
        source: string;
        message: string;
    }>;
    policy: TelemetryPolicy;
}
export interface TelemetryCollectionContext {
    controlPlane: ControlPlaneStore;
    projectId: string;
    environmentId?: string;
    config: CloudConfig;
    environment: EnvironmentType;
    force?: boolean;
}
export declare function telemetryRecordsFromLog(input: {
    projectId: string;
    environmentId?: string;
    resourceId?: string;
    source: string;
    name: string;
    timestamp?: string;
    message: string;
    workloadId?: string;
}): AppendTelemetryInput[];
export declare function collectDashboardTelemetry(context: TelemetryCollectionContext): Promise<TelemetryCollectionResult>;
export declare function invalidateDashboardTelemetryCache(projectId: string): void;
