/**
 * @fileoverview Path resolution and sandboxing for canvas exports. Path
 * targets are resolved against `CANVAS_EXPORT_PATH`; absolute paths and `..`
 * traversal are rejected. Stream targets write a sandboxed temp file, pipe to
 * the caller's `WritableStream`, then unlink.
 * @module src/services/canvas/providers/duckdb/exportWriter
 */
import type { ExportFormat, ExportTarget } from '../../types.js';
/**
 * Resolve a relative path against the sandbox root. Refuses absolute inputs
 * and traversal. Returns an absolute path inside `rootPath` and creates the
 * root directory if missing.
 */
export declare function resolveExportPath(rootPath: string, requested: string): Promise<string>;
/** Map an export format to a DuckDB `COPY ... TO ... (FORMAT ...)` clause. */
export declare function copyFormatClause(format: ExportFormat): string;
/**
 * Pipe a sandbox file into a caller-supplied `WritableStream`, unlinking the
 * file in `finally`. Owns the file's lifecycle from the moment of invocation.
 */
export declare function pipeFileToStream(filePath: string, stream: WritableStream<Uint8Array>): Promise<{
    sizeBytes: number;
}>;
/**
 * Generate a unique temp file path inside the sandbox. Creates the root if
 * missing so the caller can write immediately.
 */
export declare function tempFilePathFor(rootPath: string, format: ExportFormat): Promise<string>;
/** Best-effort file size lookup. Returns 0 on failure. */
export declare function safeSizeBytes(path: string): Promise<number>;
/** Discriminator for {@link ExportTarget}. */
export declare function isPathTarget(target: ExportTarget): target is {
    format: ExportFormat;
    path: string;
};
//# sourceMappingURL=exportWriter.d.ts.map