import type { MaybeRefOrGetter } from 'vue'; import type { Resource } from '@opencloud-eu/web-client'; /** A write to the open file that did not come from this tab. */ export interface ExternalFileEvent { /** The etag the file carries after the write, as announced by the server. */ etag: string; } export interface ExternalFileUpdatesOptions { resource: MaybeRefOrGetter; /** The etag this client believes is on disk. */ currentETag: MaybeRefOrGetter; /** Whether an event may be handled right now. Events arriving while false are dropped. */ isActive: MaybeRefOrGetter; /** * Handles one event. Runs one at a time; an event arriving meanwhile runs * afterwards, and a newer one replaces it. */ onExternalEvent: (event: ExternalFileEvent) => Promise; } /** * Listens for server-sent file events about one resource and hands the ones * that mean "someone else wrote this file" to the caller, one at a time. * * Only a signed-in user has an SSE stream. */ export declare function useExternalFileUpdates({ resource, currentETag, isActive, onExternalEvent }: ExternalFileUpdatesOptions): void;