/*!
 * 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 { FastifyInstance } from 'fastify';
import { Logger, ServerConfig } from './types';
import { ReaderWriterLock } from 'async-primitives';
/**
 * Server instance with cleanup functionality
 */
export interface FastifyServerInstance {
    close: () => Promise<void>;
}
/**
 * Creates and configures a Fastify instance without starting the server
 * @param config - Server configuration including port, baseUrl, and trusted proxies
 * @param logger - Logger instance for logging server events
 * @param locker - WriterLock for safe shutdown
 * @returns Promise that resolves to configured Fastify instance
 * @remarks When shutting down Fastify using close(), conflicts may occur with stream completion if file transfers are in progress via the stream. To safely avoid this, it uses a ReaderWriterLock. When shutting down Fastify, you must first acquire the WriterLock. This enables exclusive handling with stream transfers, preventing the above issue.
 */
export declare const createFastifyInstance: (config: ServerConfig, logger: Logger, locker: ReaderWriterLock) => Promise<FastifyInstance>;
/**
 * Starts the NuGet server with Fastify framework
 * @param config - Server configuration including port, baseUrl, and trusted proxies
 * @param logger - Logger instance for logging server events
 * @returns Promise that resolves to server instance when server is started
 */
export declare const startFastifyServer: (config: ServerConfig, logger: Logger) => Promise<FastifyServerInstance>;
//# sourceMappingURL=server.d.ts.map