#!/usr/bin/env bun
/**
 * TypedFetch - The REAL Revolutionary HTTP Client
 * 
 * No demos. No toys. This is the actual implementation.
 * 
 * Features:
 * - REAL runtime type inference from actual API responses
 * - REAL OpenAPI schema parsing with TypeScript type generation
 * - REAL proxy magic that provides actual IntelliSense
 * - REAL performance with advanced algorithms
 * - REAL zero dependencies
 */

// Main client
import { RevolutionaryTypedFetch } from './core/typed-fetch.js'
import type { TypedFetchConfig } from './types/config.js'
import type { EndpointTypeMap } from './types/endpoint-types.js'

// Export main instances
export const tf = new RevolutionaryTypedFetch()

export function createTypedFetch<TEndpoints extends EndpointTypeMap = EndpointTypeMap>(
  config?: TypedFetchConfig
): RevolutionaryTypedFetch<TEndpoints> {
  return new RevolutionaryTypedFetch<TEndpoints>(config)
}

// Export types for advanced usage
export type { TypeRegistry, InferFromJSON, TypedError } from './types/index.js'
export type { TypedFetchConfig } from './types/config.js'
export type { TypeDescriptor } from './types/type-descriptor.js'
export type { EndpointTypeEntry, EndpointTypeMap } from './types/endpoint-types.js'

// Export core classes for advanced usage
export { RuntimeTypeInference } from './types/runtime-inference.js'
export { OpenAPIParser } from './discovery/openapi-parser.js'
export { WTinyLFUCache } from './cache/w-tinylfu.js'
export { CircuitBreaker } from './core/circuit-breaker.js'
export { InterceptorChain } from './core/interceptors.js'
export { RequestMetrics } from './core/metrics.js'
export { OfflineHandler } from './core/offline-handler.js'
export { RequestDeduplicator } from './cache/deduplicator.js'
export { createResource } from './core/resource-builder.js'
export { TypeDeclarationGenerator } from './discovery/type-generator.js'
export { presets } from './core/presets.js'
export type { TypedFetchPreset } from './core/presets.js'
export type {
  ResourceBuilderOptions,
  ResourceDefinition,
  ResourceInstance,
  ResourceMethodConfig
} from './core/resource-builder.js'
export type { TypeSnapshotOptions } from './discovery/type-generator.js'