export interface ConnectionInfo { id: string; version: string; route: string; ip?: string; } export interface ConnectionStats { total: number; versions: Record; routes: Record; connections: ConnectionInfo[]; yourId?: string; } /** * Subscribe to real-time connection statistics. * * Requires: * - `connectionTracking: true` in module config * - Server-side `skew:authorize-stats` hook to authorize the subscription * * @example * ```ts * // server/plugins/stats-auth.ts * export default defineNitroPlugin((nitroApp) => { * nitroApp.hooks.hook('skew:authorize-stats', async ({ event, authorize }) => { * const session = await getUserSession(event) * if (session.user?.role === 'admin') { * authorize() * } * }) * }) * ``` */ export declare function useActiveConnections(): { /** Whether the subscription is authorized (null while pending) */ authorized: import("vue").ComputedRef; /** Total active connections */ total: import("vue").ComputedRef; /** Users per build version */ versions: import("vue").ComputedRef>; /** Users per route (requires routeTracking: true) */ routes: import("vue").ComputedRef>; /** Individual connections with id, version, route */ connections: import("vue").ComputedRef; /** Your connection ID (to identify yourself in the list) */ yourId: import("vue").ComputedRef; };