/** * vapor-chamber - minimal signal abstraction. * * Standalone module with NO module-load side effects. Imported by transports, * plugins, form - modules that need a `signal` API but should not drag the * full Vue feature-detection registry from `chamber.ts` into ESM consumer * bundles. * * Detection / fallback chain (first match wins on each `signal()` call): * 1. `configureSignal(fn)` - explicit override; `chamber.ts` pushes Vue's * `shallowRef()` here once its async dynamic import resolves (shallow because * the library replaces signal values wholesale and never mutates nested * fields - skipping ref()'s deep-Proxy wrap on object/array values). * 2. Plain `{ value }` object - zero-overhead fallback for non-Vue, non-reactive * contexts. For push-pull reactivity without Vue, call * `configureAlienSignals` from `vapor-chamber/alien-signals` once at boot. * * Consumers needing full Vue auto-detection (async probe, Vapor detection, * lifecycle hooks) import from `chamber.ts`, which calls into this module. */ /** * A cell: `value`. An interface, so an entry that wires a reactive backing * extends it with its cell's type: `vapor-chamber/vapor` wires `shallowRef` at * import and declares `Signal` a Vue `ShallowRef`, so a template * unwraps it. A named interface stays `Signal` in every emitted * declaration, so a consumer without that entry never reads `vue`. * Types only. tests/vapor-signal-types.test-d.ts. */ export interface Signal { value: T; } export type CreateSignal = (initial: T) => Signal; /** * Configure the signal factory. Called once by `chamber.ts` after its async * Vue probe completes; also available to consumers who want a custom signal * implementation. * * Dev note: if any signals were created BEFORE this call resolved a reactive * backing, those signals are plain `{ value }` objects forever - writes to them * will not trigger Vue reactivity, while signals created after this call will. * A one-shot dev warning fires in that case; to guarantee a uniform backing, * `await waitForVueDetection()` before the first `signal()` call. * * @example * import { ref } from 'vue'; * import { configureSignal } from 'vapor-chamber'; * configureSignal(ref); */ export declare function configureSignal(fn: CreateSignal): void; export declare const signal: CreateSignal; //# sourceMappingURL=signal.d.ts.map