/**
 * API Versioning Module
 *
 * Provides URL-based API versioning with fallback to Accept header negotiation.
 * Supports deprecation warnings and version-specific error responses.
 *
 * @packageDocumentation
 */
import type { FastifyRequest, FastifyPluginAsync } from 'fastify';
/**
 * Supported API versions
 */
export declare const API_VERSIONS: readonly ["v1"];
export type ApiVersion = (typeof API_VERSIONS)[number];
/**
 * Current (latest) API version
 */
export declare const CURRENT_VERSION: ApiVersion;
/**
 * Deprecated API versions with sunset dates
 */
export declare const DEPRECATED_VERSIONS: Record<string, {
    sunsetDate: string;
    message: string;
}>;
/**
 * Version extraction result
 */
export interface VersionInfo {
    version: ApiVersion;
    source: 'url' | 'header' | 'default';
    isDeprecated: boolean;
    deprecationMessage?: string;
    sunsetDate?: string;
}
/**
 * Versioning plugin options
 */
export interface VersioningOptions {
    /** Default version when none specified (defaults to CURRENT_VERSION) */
    defaultVersion?: ApiVersion;
    /** Whether to add deprecation warning headers (defaults to true) */
    includeDeprecationHeaders?: boolean;
    /** Custom header name for version negotiation (defaults to Accept) */
    versionHeader?: string;
    /** Base path prefix (defaults to /api) */
    basePath?: string;
}
/**
 * Extract API version from request URL path
 *
 * Looks for /api/v{N}/ pattern in the URL
 */
export declare function extractVersionFromUrl(url: string): ApiVersion | null;
/**
 * Extract API version from Accept header
 *
 * Supports formats:
 * - application/vnd.vorion.v1+json
 * - application/json; version=v1
 */
export declare function extractVersionFromAcceptHeader(acceptHeader: string | undefined): ApiVersion | null;
/**
 * Extract version from request using URL-first, then Accept header fallback
 */
export declare function extractVersion(request: FastifyRequest, defaultVersion?: ApiVersion): VersionInfo;
/**
 * Check if a version is supported
 */
export declare function isVersionSupported(version: string): version is ApiVersion;
/**
 * Get deprecation warning message for default version usage
 */
export declare function getDefaultVersionWarning(): string;
declare module 'fastify' {
    interface FastifyRequest {
        apiVersion?: VersionInfo;
    }
}
/**
 * API Versioning Plugin (wrapped with fastify-plugin for proper encapsulation)
 */
export declare const versioningPlugin: FastifyPluginAsync<VersioningOptions>;
/**
 * Version-specific error response generator
 */
export interface VersionedError {
    error: {
        code: string;
        message: string;
        version?: string;
        deprecationNotice?: string;
    };
}
/**
 * Create a version-specific error response
 */
export declare function createVersionedError(code: string, message: string, versionInfo?: VersionInfo): VersionedError;
/**
 * Create unsupported version error response
 */
export declare function createUnsupportedVersionError(requestedVersion: string): VersionedError;
/**
 * Route prefix generator for versioned routes
 */
export declare function getVersionedPrefix(version: ApiVersion): string;
/**
 * Check if request is for versioned API
 */
export declare function isVersionedRequest(request: FastifyRequest): boolean;
export default versioningPlugin;
//# sourceMappingURL=index.d.ts.map