/** * A signal-shaped live view over a single property of a reactive object. * Reads and writes delegate to the source, so reactivity is preserved. */ export type PropertySignal = { value: T; }; /** * Property keys eligible for toSignal/toSignals: string keys excluding * `$set` (the object-signal's replace method injected by the proxy — not * data). Note that `toSignals()` additionally only creates views for keys * `Object.keys` yields at runtime (own enumerable keys). */ type SignalKey = Exclude, '$set'>; /** * Create a signal-shaped view over one property of a reactive object. * Unlike destructuring (which snapshots the value), the returned object * reads and writes through to the source, so tracking and triggering work. * * @example * ```ts * const state = signal({ count: 0 }); * const count = toSignal(state, 'count'); * count.value++; // triggers effects watching state.count * ``` */ export declare function toSignal>(source: T, key: K): PropertySignal; /** * Per-key views of a reactive object. The homomorphic key-remapped map * preserves optional property markers from T; at runtime, views exist only * for keys Object.keys yields (own enumerable string keys). */ export type ToSignals = { [K in keyof T as K extends SignalKey ? K : never]: PropertySignal; }; /** * Create signal-shaped views for every own enumerable property of a reactive * object, so it can be destructured without losing reactivity. * * @example * ```ts * const state = signal({ count: 0, name: 'Ada' }); * const { count, name } = toSignals(state); * count.value++; // still reactive * ``` */ export declare function toSignals(source: T): ToSignals; export {}; //# sourceMappingURL=toSignal.d.ts.map