973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 1 | // Backend-agnostic API surface. Every call forwards to whichever transport |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 2 | // this build was compiled for, hosted (fetch + SSE) or on-device (worker). |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 3 | import { parseEventContextPage, parseEventContextSession } from './types'; |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 4 | import type { EventContextPage, EventContextSession, MemberSummary, RoomSummary } from './types'; |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 5 | import type { Emote } from './emotes'; |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 6 | import type { MentionKey, MentionsBoundary, MentionsPage, SavedMentionContext } from './mentions-model'; |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 7 | export { mentionKey, parseMentionsPage, parseSavedMentionContext, parseMentionsUpdate } from './mentions-model'; |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 8 | export type { MentionKey, MentionReason, MentionCaptureState, MentionEntry, MentionCoverage, MentionGap, MentionsBoundary, MentionsPage, SavedMentionContext, MentionsUpdate } from './mentions-model'; |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 9 | import { formatBody } from './markdown'; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 10 | import { mentionedUserIds, type Mention } from './mentions'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 11 | import { HttpTransport } from './transport-http'; |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 12 | import { parseSearchPage, parseSearchSession, scopeWire, type SearchPage, type SearchScope, type SearchSession } from './search-model'; |
7cca1d5628d1 | atagen | 2026-10-24 07:36 UTC | 13 | import type { CommandRequest, SendKind, SessionInfo, Transport, VerifyAction } from './transport'; |
c51e1fe62291 | atagen | 2026-10-25 07:58 UTC | 14 | export type { HistoryRequest } from './transport'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 15 | import { createDeviceTransport } from 'malice:device-transport'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 16 | |
ba90983cec2e | atagen | 2026-10-25 10:51 UTC | 17 | import { ApiError } from './transport'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 18 | export { ApiError } from './transport'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 19 | export type { SessionInfo, SoftLogout, VerifyAction } from './transport'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 20 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 21 | function createTransport(): Transport { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 22 | if (import.meta.env.VITE_MALICE_TARGET === 'device') return createDeviceTransport(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 23 | return new HttpTransport(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 24 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 25 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 26 | const transport: Transport = createTransport(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 27 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 28 | export function getSession(): Promise<SessionInfo> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 29 | return transport.getSession(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 30 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 31 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 32 | export function login(homeserver: string, username: string, password: string): Promise<{ user_id: string }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 33 | return transport.login(homeserver, username, password); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 34 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 35 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 36 | export function logout(): Promise<void> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 37 | return transport.logout(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 38 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 39 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 40 | export function getRooms(): Promise<{ rooms: RoomSummary[] }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 41 | return transport.getRooms(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 42 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 43 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 44 | export const openRoom = (room_id: string) => transport.openRoom(room_id); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 45 | export const closeRoom = (room_id: string) => transport.closeRoom(room_id); |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 46 | export const sendMessage = ( |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 47 | room_id: string, |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 48 | body: string, |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 49 | reply_to: string | null = null, |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 50 | mentions: Mention[] = [], |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 51 | kind: SendKind = 'text', |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 52 | emotes: Emote[] = [], |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 53 | thread_root: string | null = null |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 54 | ) => transport.sendMessage(room_id, body, formatBody(body, mentions, true, emotes), reply_to, mentionedUserIds(mentions), kind, thread_root); |
e4c64c36f105 | atagen | 2026-10-24 07:09 UTC | 55 | export const runCommand = (request: CommandRequest) => transport.command(request); |
e4c64c36f105 | atagen | 2026-10-24 07:09 UTC | 56 | export const uploadAvatar = (file: File) => transport.uploadAvatar(file); |
7cca1d5628d1 | atagen | 2026-10-24 07:36 UTC | 57 | export const uploadRoomAvatar = (room_id: string, file: File) => transport.uploadRoomAvatar(room_id, file); |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 58 | export const uploadMedia = (file: File) => transport.uploadMedia(file); |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 59 | export const paginateRoom = (room_id: string, thread_root: string | null = null) => transport.paginateRoom(room_id, thread_root); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 60 | export async function eventContext(room_id: string, event_id: string, limit = 20): Promise<EventContextSession> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 61 | const parsed = parseEventContextSession( |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 62 | await transport.command({ op: 'event_context', room_id, event_id, before_limit: limit, after_limit: limit }) |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 63 | ); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 64 | if (!parsed) throw new ApiError(502, 'Invalid event context response'); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 65 | return parsed; |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 66 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 67 | async function eventContextPage(op: 'event_context_before' | 'event_context_after', context_id: string, token: string, limit: number): Promise<EventContextPage> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 68 | const parsed = parseEventContextPage(await transport.command({ op, context_id, token, limit })); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 69 | if (!parsed) throw new ApiError(502, 'Invalid event context page response'); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 70 | return parsed; |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 71 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 72 | export const eventContextBefore = (context_id: string, token: string, limit = 20): Promise<EventContextPage> => |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 73 | eventContextPage('event_context_before', context_id, token, limit); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 74 | export const eventContextAfter = (context_id: string, token: string, limit = 20): Promise<EventContextPage> => |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 75 | eventContextPage('event_context_after', context_id, token, limit); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 76 | export async function closeEventContext(context_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 77 | await transport.command({ op: 'close_event_context', context_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 78 | } |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 79 | export const mentionsPage = (cursor: string | null = null, limit = 50): Promise<MentionsPage> => transport.mentionsPage(cursor, limit); |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 80 | export const mentionContext = (room_id: string, event_id: string): Promise<SavedMentionContext> => transport.mentionContext(room_id, event_id); |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 81 | export const retryMentionContext = (room_id: string, event_id: string): Promise<SavedMentionContext> => transport.retryMentionContext(room_id, event_id); |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 82 | export const setMentionsRead = (keys: MentionKey[], read: boolean) => transport.setMentionsRead(keys, read); |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 83 | export const markMentionsReadThrough = (boundary: MentionsBoundary) => transport.markMentionsReadThrough(boundary); |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 84 | export const recoverMentions = () => transport.recoverMentions(); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 85 | export async function searchMessages(query: string, scope: SearchScope, limit = 30): Promise<SearchSession> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 86 | const session = parseSearchSession(await transport.command({ op: 'search', query, scope: scopeWire(scope), limit })); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 87 | if (!session) throw new ApiError(502, 'Invalid search response'); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 88 | return session; |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 89 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 90 | export async function searchMore(search_id: string, cursor: string, limit = 30): Promise<SearchPage> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 91 | const page = parseSearchPage(await transport.command({ op: 'search_more', search_id, cursor, limit })); |
ba90983cec2e | atagen | 2026-10-25 10:51 UTC | 92 | if (!page) throw new ApiError(502, 'Invalid search response'); |
ba90983cec2e | atagen | 2026-10-25 10:51 UTC | 93 | return page; |
ba90983cec2e | atagen | 2026-10-25 10:51 UTC | 94 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 95 | export async function closeSearch(search_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 96 | await transport.command({ op: 'close_search', search_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 97 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 98 | export async function retryRecentHistory(room_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 99 | await transport.command({ op: 'retry_recent_history', room_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 100 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 101 | export async function fillHistoryGap(room_id: string, gap_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 102 | await transport.command({ op: 'fill_history_gap', room_id, gap_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 103 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 104 | export async function openThreadList(room_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 105 | await transport.command({ op: 'open_thread_list', room_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 106 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 107 | export async function paginateThreadList(room_id: string, limit = 20): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 108 | await transport.command({ op: 'paginate_thread_list', room_id, limit }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 109 | } |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 110 | export async function closeThreadList(room_id: string): Promise<void> { |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 111 | await transport.command({ op: 'close_thread_list', room_id }); |
249e439c27e5 | atagen | 2026-10-25 13:26 UTC | 112 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 113 | export const setTyping = (room_id: string, typing: boolean) => transport.setTyping(room_id, typing); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 114 | export const getAccountData = (eventType: string) => transport.getAccountData(eventType); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 115 | export const getUrlPreview = (room_id: string, url: string) => transport.getUrlPreview(room_id, url); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 116 | export const setAccountData = (eventType: string, content: Record<string, unknown>) => |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 117 | transport.setAccountData(eventType, content); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 118 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 119 | export function joinRoom(room: string): Promise<{ room_id: string }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 120 | return transport.joinRoom(room); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 121 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 122 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 123 | export function createRoom(name: string, topic?: string): Promise<{ room_id: string }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 124 | return transport.createRoom(name, topic); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 125 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 126 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 127 | export const leaveRoom = (room_id: string) => transport.leaveRoom(room_id); |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 128 | export const reactToMessage = (room_id: string, event_id: string, key: string, shortcode?: string, thread_root: string | null = null) => |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 129 | transport.reactToMessage(room_id, event_id, key, shortcode, thread_root); |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 130 | export const editMessage = (room_id: string, event_id: string, body: string, mentions: Mention[] = [], emotes: Emote[] = [], thread_root: string | null = null) => |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 131 | transport.editMessage(room_id, event_id, body, formatBody(body, mentions, true, emotes), mentionedUserIds(mentions), thread_root); |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 132 | export const markRead = (room_id: string, event_id: string, thread_root: string | null = null) => transport.markRead(room_id, event_id, thread_root); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 133 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 134 | export function getMembers(room_id: string): Promise<{ members: MemberSummary[] }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 135 | return transport.getMembers(room_id); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 136 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 137 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 138 | /** Same URL shape in both builds: the hosted server and the device service worker both answer it. */ |
7643577c76bb | atagen | 2026-10-25 07:37 UTC | 139 | export function mediaUrl(mxc: string | null, size = 256): string | null { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 140 | if (!mxc) return null; |
7643577c76bb | atagen | 2026-10-25 07:37 UTC | 141 | return `/api/media?mxc=${encodeURIComponent(mxc)}&size=${Math.max(16, Math.min(512, Math.round(size)))}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 142 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 143 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 144 | export function messageMediaUrl(mediaId: string, size: 'Thumbnail' | 'Full'): string { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 145 | return `/api/message-media?media_id=${encodeURIComponent(mediaId)}&size=${size}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 146 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 147 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 148 | export function getProfile(): Promise<{ display_name: string | null; avatar_url: string | null }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 149 | return transport.getProfile(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 150 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 151 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 152 | export function getSpaceChildren(room_id: string): Promise<{ room_ids: string[] }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 153 | return transport.getSpaceChildren(room_id); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 154 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 155 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 156 | export function getEncryption(): Promise<{ state: unknown; verification: unknown }> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 157 | return transport.getEncryption(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 158 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 159 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 160 | export function recoverEncryption(recovery_key: string): Promise<void> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 161 | return transport.recoverEncryption(recovery_key); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 162 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 163 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 164 | export function startVerification(): Promise<void> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 165 | return transport.startVerification(); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 166 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 167 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 168 | export function verifyEncryption(action: VerifyAction): Promise<void> { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 169 | return transport.verifyEncryption(action); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 170 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 171 | |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 172 | export function uploadAttachment( |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 173 | room_id: string, |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 174 | file: File, |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 175 | caption: string | null = null, |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 176 | reply_to: string | null = null, |
6d6a4c34bdc1 | atagen | 2026-10-24 06:51 UTC | 177 | mentions: Mention[] = [], |
dda384a360e0 | atagen | 2026-10-25 10:27 UTC | 178 | emotes: Emote[] = [], |
dda384a360e0 | atagen | 2026-10-25 10:27 UTC | 179 | thread_root: string | null = null |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 180 | ): Promise<void> { |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 181 | return transport.uploadAttachment(room_id, file, { |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 182 | caption, |
e822c659890f | atagen | 2026-10-25 02:37 UTC | 183 | formatted_caption: caption ? formatBody(caption, mentions, true, emotes) : null, |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 184 | reply_to, |
dda384a360e0 | atagen | 2026-10-25 10:27 UTC | 185 | mentions: mentionedUserIds(mentions), |
dda384a360e0 | atagen | 2026-10-25 10:27 UTC | 186 | thread_root |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 187 | }); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 188 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 189 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 190 | export function subscribeEvents(onEvent: (data: string) => void, onDisconnect: () => void): () => void { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 191 | return transport.subscribeEvents(onEvent, onDisconnect); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 192 | } |