Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | /** * Coherent.js Framework Types * Complete TypeScript definitions for the entire Coherent.js framework * * @version 1.1.1 */ // ============================================================================ // Core Framework Re-exports // ============================================================================ export * from '../packages/core/types/index.js'; export * from '../packages/api/types/index.js'; export * from '../packages/database/types/index.js'; export * from '../packages/client/types/index.js'; // ============================================================================ // Framework Integrations Re-exports // ============================================================================ export * as Express from '../packages/express/types/index.js'; export * as Koa from '../packages/koa/types/index.js'; export * as NextJS from '../packages/nextjs/types/index.js'; // ============================================================================ // CLI Tools Re-exports // ============================================================================ export * as CLI from '../packages/cli/types/index.js'; // ============================================================================ // Framework-wide Types // ============================================================================ /** Framework configuration */ export interface CoherentFrameworkConfig { // Core settings core?: { version?: string; development?: boolean; strict?: boolean; }; // Rendering settings rendering?: { cache?: boolean; pretty?: boolean; streaming?: boolean; }; // State management state?: { persistent?: boolean; serializable?: boolean; devtools?: boolean; }; // Client-side settings client?: { hydration?: boolean; hmr?: boolean; serviceWorker?: boolean; }; // API settings api?: { validation?: boolean; authentication?: boolean; rateLimit?: boolean; cors?: boolean; }; // Database settings database?: { enabled?: boolean; type?: 'postgresql' | 'mysql' | 'sqlite' | 'mongodb' | 'memory'; migrations?: boolean; seeding?: boolean; }; // Performance settings performance?: { monitoring?: boolean; caching?: boolean; compression?: boolean; bundleAnalysis?: boolean; }; // Security settings security?: { csrf?: boolean; helmet?: boolean; sanitization?: boolean; audit?: boolean; }; // Logging settings logging?: { level?: 'debug' | 'info' | 'warn' | 'error'; format?: 'json' | 'text'; destination?: string; }; } /** Application metadata */ export interface ApplicationMetadata { name: string; version: string; description?: string; author?: string; license?: string; repository?: string; homepage?: string; keywords?: string[]; coherentVersion: string; createdAt: Date; lastModified: Date; } /** Framework runtime information */ export interface RuntimeInfo { version: string; node: string; platform: string; arch: string; memory: { used: number; total: number; free: number; }; uptime: number; pid: number; } /** Plugin interface for framework extensions */ export interface CoherentPlugin { name: string; version: string; description?: string; dependencies?: string[]; // Lifecycle hooks install?(framework: any): void | Promise<void>; uninstall?(framework: any): void | Promise<void>; configure?(config: CoherentFrameworkConfig): CoherentFrameworkConfig; // Component system extensions components?: { [name: string]: any; }; // Middleware extensions middleware?: { [name: string]: any; }; // CLI extensions commands?: { [name: string]: any; }; // Custom hooks hooks?: { [event: string]: (...args: any[]) => any; }; } // ============================================================================ // Global Framework Interface // ============================================================================ /** Main Coherent.js framework interface */ export interface CoherentFramework { // Version information readonly version: string; readonly metadata: ApplicationMetadata; // Configuration config: CoherentFrameworkConfig; configure(config: Partial<CoherentFrameworkConfig>): void; // Core modules core: typeof import('../packages/core/types/index.js'); api: typeof import('../packages/api/types/index.js'); database: typeof import('../packages/database/types/index.js'); client: typeof import('../packages/client/types/index.js'); // Framework integrations integrations: { express: typeof import('../packages/express/types/index.js'); koa: typeof import('../packages/koa/types/index.js'); nextjs: typeof import('../packages/nextjs/types/index.js'); }; // Plugin system plugins: { install(plugin: CoherentPlugin): Promise<void>; uninstall(name: string): Promise<void>; get(name: string): CoherentPlugin | undefined; list(): CoherentPlugin[]; }; // Utilities utils: { getRuntimeInfo(): RuntimeInfo; validateConfig(config: CoherentFrameworkConfig): boolean; createLogger(name?: string): any; createPerformanceMonitor(): any; }; // Event system events: { on(event: string, listener: (...args: any[]) => void): void; off(event: string, listener?: (...args: any[]) => void): void; emit(event: string, ...args: any[]): void; once(event: string, listener: (...args: any[]) => void): void; }; } // ============================================================================ // Global Constants and Utilities // ============================================================================ /** Framework version */ export const VERSION: string; /** Default framework configuration */ export const DEFAULT_CONFIG: CoherentFrameworkConfig; /** Environment detection utilities */ export const Environment: { readonly isNode: boolean; readonly isBrowser: boolean; readonly isProduction: boolean; readonly isDevelopment: boolean; readonly isTest: boolean; }; /** Feature detection utilities */ export const Features: { hasAsyncIteration: boolean; hasProxies: boolean; hasWeakMaps: boolean; hasSymbols: boolean; hasPromises: boolean; }; // ============================================================================ // Framework Factory Functions // ============================================================================ /** Create a new Coherent.js application instance */ export function createCoherentApp(config?: Partial<CoherentFrameworkConfig>): CoherentFramework; /** Initialize framework with configuration */ export function initializeFramework(config?: Partial<CoherentFrameworkConfig>): Promise<CoherentFramework>; /** Create framework plugin */ export function createPlugin(plugin: Omit<CoherentPlugin, 'version'>): CoherentPlugin; // ============================================================================ // Type Guards and Utilities // ============================================================================ /** Check if object is a Coherent component */ export function isCoherentComponent(obj: any): obj is import('../packages/core/types/index.js').CoherentComponent; /** Check if object is a Coherent element */ export function isCoherentElement(obj: any): obj is import('../packages/core/types/index.js').CoherentElement; /** Check if value is a lazy wrapper */ export function isLazy<T>(value: any): value is import('../packages/core/types/index.js').LazyWrapper<T>; /** Validate framework configuration */ export function validateFrameworkConfig(config: CoherentFrameworkConfig): { valid: boolean; errors: string[]; warnings: string[]; }; // ============================================================================ // Module Declarations for Package Resolution // ============================================================================ declare module '@coherent/core' { export * from '../packages/core/types/index.js'; } declare module '@coherent/api' { export * from '../packages/api/types/index.js'; } declare module '@coherent/database' { export * from '../packages/database/types/index.js'; } declare module '@coherent/client' { export * from '../packages/client/types/index.js'; } declare module '@coherent/express' { export * from '../packages/express/types/index.js'; } declare module '@coherent/koa' { export * from '../packages/koa/types/index.js'; } declare module '@coherent/nextjs' { export * from '../packages/nextjs/types/index.js'; } declare module '@coherent/cli' { export * from '../packages/cli/types/index.js'; } declare module 'coherent.js' { export * from './index.js'; } // ============================================================================ // Default Export // ============================================================================ declare const coherent: CoherentFramework; export default coherent; |