import type { AppConfig } from '../config.js';
import type { FileVersion } from '../../shared/protocol.js';
export interface FileRootTokenPayload {
    version: 1;
    terminalId: string;
    rootPath: string;
    issuedAt: string;
    nonce: string;
}
export interface SignFileRootTokenOptions {
    terminalId: string;
    rootPath: string;
    now?: () => Date;
    nonce?: () => string;
}
export interface SignedFileRootToken {
    rootToken: string;
    issuedAt: string;
}
interface FileDeletePreviewTokenPayload {
    version: 1;
    rootTokenHash: string;
    path: string;
    kind: string;
    descendantCount: number;
    entryVersion: FileVersion;
    issuedAt: string;
    nonce: string;
}
export interface SignFileDeletePreviewTokenOptions {
    rootToken: string;
    path: string;
    kind: string;
    descendantCount: number;
    entryVersion: FileVersion;
    now?: () => Date;
    nonce?: () => string;
}
export declare class FileRootTokenError extends Error {
    readonly code = "invalid_root_token";
    constructor();
}
export declare class FileDeletePreviewTokenError extends Error {
    readonly code = "invalid_delete_preview_token";
    constructor();
}
export declare function signFileRootToken(config: Pick<AppConfig, 'sessionSecret'>, options: SignFileRootTokenOptions): SignedFileRootToken;
export declare function verifyFileRootToken(config: Pick<AppConfig, 'sessionSecret'>, token: string): FileRootTokenPayload;
export declare function signFileDeletePreviewToken(config: Pick<AppConfig, 'sessionSecret'>, options: SignFileDeletePreviewTokenOptions): string;
export declare function verifyFileDeletePreviewToken(config: Pick<AppConfig, 'sessionSecret'>, token: string, rootToken: string, expected: Pick<FileDeletePreviewTokenPayload, 'path' | 'kind' | 'descendantCount' | 'entryVersion'>): void;
export {};
