/** * TypedFetch - Type System and Core Types */ // Advanced TypeScript utilities for runtime type inference export type InferFromJSON = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends null ? null : T extends Array ? Array> : T extends Record ? { [K in keyof T]: InferFromJSON } : unknown export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P] } // Runtime type storage for discovered APIs export interface TypeRegistry { [endpoint: string]: { request: any response: any method: string lastSeen: number samples: any[] } } // Enhanced error types export interface TypedError extends Error { type: 'network' | 'http' | 'timeout' | 'circuit' | 'offline' status?: number retryable: boolean retryAfter?: number suggestions: string[] debug: () => void }