/** * Trellis Vue — Realtime / Signal bindings * * Framework adapter that binds the framework-agnostic {@link Signal} reactive * primitive and {@link RealtimeRoom} presence/broadcast engine into Vue 3's * reactivity system. * * A `Signal` is bridged into a `shallowRef`; subscriptions are torn down via * `onScopeDispose`, so these composables are safe inside `setup()` and any * effect scope. * * import { useRoom } from 'trellis/vue'; * import { RealtimeRoom, WebSocketRelayTransport } from 'trellis/realtime'; * * const { presence, others, room } = useRoom(() => * RealtimeRoom.join({ * transport: new WebSocketRelayTransport({ id, url: 'ws://localhost:8231/rt' }), * initialPresence: { name: 'Ada', color: '#6d5bfa' }, * }), * ); * * @module trellis/vue */ import { type ComputedRef, type Ref } from 'vue'; import type { Signal } from '../client/reactive.js'; import type { RealtimeRoom } from '../realtime/room.js'; import type { PresencePeer, PresenceState } from '../realtime/types.js'; /** * Mirror a {@link Signal} into a read-only Vue ref. The subscription is * disposed automatically when the surrounding scope is torn down. * * ```ts * const peers = useSignal(room.presenceSignal); * ``` */ export declare function useSignal(signal: Signal): Readonly>; export interface RoomHandle

{ /** The live room. Created eagerly in `setup()`. */ room: RealtimeRoom

; /** All peers including self (self first), reactive. */ presence: Readonly[]>>; /** Peers excluding self, reactive. */ others: ComputedRef[]>; } /** * Create and own a {@link RealtimeRoom} for the current effect scope. * * `create` runs once (during `setup()`); the room is torn down (`room.leave()`) * on scope dispose. * * ```ts * const { presence, others, room } = useRoom(() => * RealtimeRoom.join({ transport, initialPresence: { name } }), * ); * room.broadcast('chat', 'message', { text }); * ``` */ export declare function useRoom

(create: () => RealtimeRoom

): RoomHandle

; /** * Stream presence from a room you already own into a read-only ref. Use * {@link useRoom} unless you manage the room's lifecycle yourself. */ export declare function usePresence

(room: RealtimeRoom

): Readonly[]>>; //# sourceMappingURL=hooks.d.ts.map