/*!
 * name: nuget-server
 * version: 0.19.0
 * description: NuGet server on Node.js
 * author: Kouji Matsui (@kekyo@mi.kekyo.net)
 * license: MIT
 * repository.url: https://github.com/kekyo/nuget-server.git
 * git.commit.hash: 5b9501882b352a0490b3091210ed1740cfb81389
 */

import { FastifyReply } from 'fastify';
import { Logger } from '../types';
import { ReaderWriterLock } from 'async-primitives';
/**
 * Options for file streaming
 */
export interface StreamFileOptions {
    /** Override Content-Type header */
    contentType?: string;
    /** Set Content-Disposition header */
    contentDisposition?: string;
    /** Set Cache-Control header */
    cacheControl?: string;
}
/**
 * Stream a file to the client using createReadStream
 *
 * This function provides a unified way to send files that works correctly
 * in both regular HTTP environments and fastify.inject() environments (like Vite dev server).
 *
 * Features:
 * - Memory efficient streaming (no loading entire file into memory)
 * - Works with fastify.inject() method used by Vite plugin
 * - Automatic Content-Type detection based on file extension
 * - Proper error handling for missing files
 * - Support for optional headers (cache control, content disposition)
 *
 * @param logger - Logger instance
 * @param locker - Reader lock for file streaming
 * @param filePath - Absolute path to the file to stream
 * @param reply - Fastify reply object
 * @param options - Optional headers and configuration
 * @param signal - Optional AbortSignal for cancellation support
 * @returns Promise that resolves to the FastifyReply
 */
export declare const streamFile: (logger: Logger, locker: ReaderWriterLock, filePath: string, reply: FastifyReply, options?: StreamFileOptions, signal?: AbortSignal) => Promise<void>;
//# sourceMappingURL=fileStreaming.d.ts.map