import { FetchEventSourceInit } from '@microsoft/fetch-event-source'; export declare enum MESSAGE_TYPE { NOTIFICATION = "userlog-notification", POSTPROCESSING_FINISHED = "postprocessing-finished", FILE_LOCKED = "file-locked", FILE_UNLOCKED = "file-unlocked", FILE_TOUCHED = "file-touched", ITEM_RENAMED = "item-renamed", ITEM_TRASHED = "item-trashed", ITEM_RESTORED = "item-restored", ITEM_MOVED = "item-moved", ITEM_FAVORITE_ADDED = "item-favorite-added", ITEM_FAVORITE_REMOVED = "item-favorite-removed", FOLDER_CREATED = "folder-created", SPACE_CREATED = "space-created", SPACE_DISABLED = "space-disabled", SPACE_ENABLED = "space-enabled", SPACE_DELETED = "space-deleted", SPACE_MEMBER_ADDED = "space-member-added", SPACE_MEMBER_REMOVED = "space-member-removed", SPACE_SHARE_UPDATED = "space-share-updated", SHARE_CREATED = "share-created", SHARE_REMOVED = "share-removed", SHARE_UPDATED = "share-updated", LINK_CREATED = "link-created", LINK_REMOVED = "link-removed", LINK_UPDATED = "link-updated", BACKCHANNEL_LOGOUT = "backchannel-logout" } export declare class RetriableError extends Error { name: string; } export declare class SSEAdapter implements EventSource { url: string; fetchOptions: FetchEventSourceInit; private abortController; private eventListenerMap; readyState: number; readonly withCredentials: boolean; readonly CONNECTING: 0; readonly OPEN: 1; readonly CLOSED: 2; onerror: ((this: EventSource, ev: Event) => any) | null; onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; onopen: ((this: EventSource, ev: Event) => any) | null; constructor(url: string, fetchOptions: FetchEventSourceInit); private connect; fetchProvider(...args: [RequestInfo | URL, RequestInit]): Promise; close(): void; addEventListener(type: string, listener: (this: EventSource, event: EventSourceEventMap[K]) => any): void; removeEventListener(type: string, listener: (this: EventSource, event: EventSourceEventMap[K]) => any): void; dispatchEvent(): boolean; updateAccessToken(token: string): void; updateLanguage(language: string): void; } export declare const sse: (baseURI: string, fetchOptions: FetchEventSourceInit) => SSEAdapter; /** * Closes the current SSE connection and clears the singleton, so the next `sse()` * call creates a fresh connection. Used on logout to stop the stream from * reconnecting with a stale (removed) access token. */ export declare const resetSSE: () => void;