import { S as Setter } from '../use-BBBnQAPp.js'; /** * @internal * * `_createOwnedSignal` — compile-time escape hatch emitted by Phase 7 of * vite-plugin-flexium (`use-substitution` pass). Never call from handwritten * application code; use `use(initialValue)` instead. This module is exposed * at the package sub-path `flexium/core/owned-signal` so the compiler-emitted * import does not depend on `flexium`'s public surface. * * Semantics: * 1. Creates a V2 signal directly via `createSignalV2` — no hook bookkeeping. * 2. If invoked inside a component render, registers a cleanup hook with the * Phase 4 componentRegistry so the signal's subscriber list is cleared on * unmount (or via FinalizationRegistry GC as a backstop). * 3. Returns `[getter, setter]` — same tuple shape as `createSignal()`. The * compiler emits an immediate `[0]()` call to recover the value form: * * const __sig0 = _createOwnedSignal(0); * const count = __sig0[0](); * const setCount = __sig0[1]; * * 4. Outside a component context (top-level module, SSR top-level, raw * tests) the signal is unowned — same fallback as `createSignal()`. * * V1/V2 compatibility: * Always uses `createSignalV2` regardless of the `FLEXIUM_REACTIVITY_V2` * flag. The compile-time substitution path is intentionally V2-only; when * V1 mode is active, the vite-plugin-flexium optimizer is typically off * and userland code stays on the runtime `use()` fallback path. */ /** * @internal — called only by vite-plugin-flexium Phase 7 compile output. * * Creates a component-owned signal whose effect subscribers are cleared when * the owning component unmounts. Outside a component, behaves like * `createSignal()`. */ declare function _createOwnedSignal(initialValue: T): [() => T, Setter]; /** @internal — test helper to reset the per-signal counter between tests. */ declare function __resetOwnedSignalCounterForTest(): void; export { __resetOwnedSignalCounterForTest, _createOwnedSignal };