import { Disposable } from "./utils/disposable";
import { SandboxClient } from "./sandbox-client";
interface BasePreviewTokenInfo {
    expiresAt: Date | null;
    tokenId: string;
    lastUsedAt: Date | null;
}
export interface PreviewTokenInfo extends BasePreviewTokenInfo {
    tokenPrefix: string;
}
export interface PreviewToken extends BasePreviewTokenInfo {
    token: string;
}
/**
 * Provider for generating preview tokens that can be used to access
 * private sandbox previews. This provider is only available in environments
 * with an authenticated API client (like Node.js).
 */
export declare class PreviewTokens extends Disposable {
    private sandboxId;
    private sandboxClient;
    constructor(sandboxId: string, sandboxClient: SandboxClient);
    /**
     * Generate a new preview token that can be used to access private sandbox previews.
     *
     * @param opts - Options
     * @param opts.expiresAt - Optional expiration date for the preview token
     * @returns A preview token that can be used with Ports.getSignedPreviewUrl
     */
    create(opts?: {
        expiresAt?: Date;
    }): Promise<PreviewToken>;
    /**
     * List all active preview tokens for this sandbox.
     *
     * @returns A list of preview tokens
     */
    list(): Promise<PreviewTokenInfo[]>;
    /**
     * Revoke a single preview token for this sandbox.
     *
     * @param tokenId - The ID of the token to revoke
     */
    revoke(tokenId: string): Promise<void>;
    /**
     * Revoke all active preview tokens for this sandbox.
     * This will immediately invalidate all tokens, and they can no longer be used
     * to access the sandbox preview.
     */
    revokeAll(): Promise<void>;
    /**
     * Update a preview token's expiration date.
     *
     * @param tokenId - The ID of the token to update
     * @param expiresAt - The new expiration date for the token (null for no expiration)
     * @returns The updated preview token info
     */
    update(tokenId: string, expiresAt: Date | null): Promise<PreviewTokenInfo>;
}
export {};
