{"version":3,"file":"index.cjs","names":["createUncompiledMacroError"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @fileoverview Fict Framework - Complete API\n *\n * This is the main entry point for the Fict framework.\n *\n * ## Recommended Import Pattern (v1.0+)\n *\n * ```typescript\n * // Core public API (most users need only this)\n * // Use $state in components (compiler-transformed)\n * // Use $store for cross-component shared state\n * import { $store, render } from 'fict'\n *\n * // Async utilities\n * import { resource, lazy } from 'fict/plus'\n *\n * // Advanced APIs (escape hatches, library authors)\n * import { createSignal, createContext, createScope } from 'fict/advanced'\n * ```\n *\n * ## State Management Guide\n *\n * | Use Case | API |\n * |----------|-----|\n * | Component-local state | `$state` (compiler-transformed) |\n * | Derived values / side effects | JS + auto-derived + `$effect` |\n * | Cross-component (large objects, deep mutation) | `$store` |\n * | Cross-component (scalar/lightweight, library-level) | `createSignal` (advanced) |\n * | Cross-component (subtree scope, SSR isolation) | `Context` (advanced) |\n *\n * @public\n * @packageDocumentation\n */\n\nimport type { AsyncContext } from '@fictjs/runtime/advanced'\n\nimport { createUncompiledMacroError } from './macro-diagnostics'\n\n// Re-export everything from runtime\nexport * from '@fictjs/runtime'\n\n// Re-export commonly used advanced APIs for convenience. Manual reactive getter\n// markers stay in `fict/advanced` so the main entrypoint remains user-facing.\nexport { createSelector, createScope, runInScope } from '@fictjs/runtime/advanced'\n\n// ============================================================================\n// Convenience Aliases\n// ============================================================================\n\n/**\n * Alias for createMemo.\n * Creates a memoized value that only recomputes when dependencies change.\n *\n * @example\n * ```tsx\n * const fullName = $memo(() => firstName + ' ' + lastName)\n * ```\n *\n * @public\n */\nexport { createMemo as $memo } from '@fictjs/runtime'\n\n// ============================================================================\n// Deep Reactive Store (Proxy-based)\n// ============================================================================\n\n/**\n * Create a deep reactive store using Proxy.\n * `$store` is the canonical public deep-store API. Runtime `createStore`\n * is internal compiler/resume infrastructure and should not be imported by\n * application code.\n *\n * @example\n * ```tsx\n * const user = $store({ name: 'Alice', address: { city: 'Beijing' } })\n * user.name = 'Bob'  // Reactive update\n * user.address.city = 'Shanghai'  // Deep reactive\n * ```\n *\n * @public\n */\nexport { $store } from './store'\n\n// ============================================================================\n// Compiler Macros (transformed at compile time)\n// ============================================================================\n\n/**\n * Explicit compiler-owned asynchronous derived value.\n * Read reactive inputs synchronously in the producer; return its Promise or\n * async iterable. The compiler reads the current value in reactive consumers.\n * @public\n */\nexport function $async<T>(\n  _produce: (context: AsyncContext<T>) => T | PromiseLike<T> | AsyncIterable<T>,\n): T {\n  throw createUncompiledMacroError('$async')\n}\n\n/**\n * Compiler macro for reactive state.\n * This is transformed at compile time and should never be called at runtime.\n *\n * @example\n * ```tsx\n * let count = $state(0)\n * count++ // Reactive update\n * ```\n *\n * @public\n */\nexport function $state<T>(_initialValue: T): T {\n  // This function is never called at runtime - the compiler transforms it\n  throw createUncompiledMacroError('$state')\n}\n\n/**\n * Compiler macro for reactive effects.\n * This is transformed at compile time and should never be called at runtime.\n *\n * @example\n * ```tsx\n * $effect(() => {\n *   console.log('count changed:', count)\n * })\n * ```\n *\n * @public\n */\nexport function $effect(_fn: () => void | (() => void)): void {\n  // This function is never called at runtime - the compiler transforms it\n  throw createUncompiledMacroError('$effect')\n}\n"],"mappings":";;;;;;;;;;;;AA6FA,SAAgB,OACd,UACG;CACH,MAAMA,0BAAAA,2BAA2B,QAAQ;AAC3C;;;;;;;;;;;;;AAcA,SAAgB,OAAU,eAAqB;CAE7C,MAAMA,0BAAAA,2BAA2B,QAAQ;AAC3C;;;;;;;;;;;;;;AAeA,SAAgB,QAAQ,KAAsC;CAE5D,MAAMA,0BAAAA,2BAA2B,SAAS;AAC5C"}