/** * Subscribe to one exported property on a local or remote resource. The * component re-renders whenever the property changes — locally via * `Instance.propertyModified`, or remotely via a `PropertyModified` * notification pushed by the peer and applied to the `EpResource` proxy. * * `resource` may be `undefined` (e.g. while a remote attach is still in * flight); the hook simply returns `undefined` until it's supplied. * * @example * ```tsx * function StatusBadge({ device }: { device: unknown }) { * const status = useProperty(device, "status"); * return {status ?? "…"}; * } * ``` */ declare function useProperty(resource: unknown, propertyName: string): T | undefined; /** * Subscribe to *every* exported property on a local or remote resource at * once, re-rendering on any change and returning a plain snapshot object * (`{ [propertyName]: value }`) — handy for spreading/destructuring several * properties without a `useProperty` call each. * * @example * ```tsx * function DeviceCard({ device }: { device: unknown }) { * const { status, level } = useResource<{ status: string; level: number }>(device); * return
{status} — {level}%
; * } * ``` */ declare function useResource = Record>(resource: unknown): T; /** * Run `handler` whenever a named exported event occurs on a local or remote * resource — e.g. a server-pushed toast/log line rather than a stored * property. Unlike {@link useProperty}/{@link useResource} this doesn't * cause a re-render by itself; call `setState` (or similar) inside * `handler` if the event should update the UI. * * @example * ```tsx * function Log({ device }: { device: unknown }) { * const [lines, setLines] = useState([]); * useResourceEvent(device, "message", (line) => * setLines((prev) => [...prev, line]), * ); * return
    {lines.map((l, i) =>
  • {l}
  • )}
; * } * ``` */ declare function useResourceEvent(resource: unknown, eventName: string, handler: (value: T) => void): void; export { useProperty, useResource, useResourceEvent };