import type { ControlPlaneStore, JsonValue } from '../control-plane';
import type { CreatePreviewDefinitionInput, PreviewDefinition, PreviewInstance, PreviewResource, PreviewStatus, UpsertPreviewInput } from './types';
export declare class PreviewEnvironmentStore {
    readonly controlPlane: ControlPlaneStore;
    private readonly now;
    private readonly id;
    constructor(controlPlane: ControlPlaneStore, options?: {
        now?: () => Date;
        id?: () => string;
    });
    createDefinition(input: CreatePreviewDefinitionInput): PreviewDefinition;
    getDefinition(id: string): PreviewDefinition | undefined;
    getDefinitionForResource(resourceId: string): PreviewDefinition | undefined;
    listDefinitions(projectId: string): PreviewDefinition[];
    listInstances(input?: {
        projectId?: string;
        definitionId?: string;
        status?: PreviewStatus;
    }): PreviewInstance[];
    getInstance(id: string): PreviewInstance | undefined;
    findForPullRequest(definitionId: string, repository: string, pullRequestNumber: number): PreviewInstance | undefined;
    findForBranch(definitionId: string, repository: string, branch: string): PreviewInstance | undefined;
    upsert(input: UpsertPreviewInput): {
        preview: PreviewInstance;
        created: boolean;
        changed: boolean;
        inheritedSecrets: string[];
    };
    transition(id: string, status: PreviewStatus, input?: {
        operationId?: string;
        observedState?: JsonValue;
        teardownError?: string;
        costEstimate?: number;
    }): PreviewInstance;
    extend(id: string, hours: number): PreviewInstance;
    expired(now?: Date): PreviewInstance[];
    recordResource(input: {
        previewId: string;
        provider: string;
        providerResourceId: string;
        kind: string;
        tags: Record<string, string>;
        observedState?: JsonValue;
    }): PreviewResource;
    listResources(previewId: string): PreviewResource[];
    markResourcesDeleted(previewId: string): number;
}
