import type { MaybeRefOrGetter, Ref } from 'vue'; import type { Resource } from '@opencloud-eu/web-client'; import type { AppFileHandlingResult, FileContentOptions, FileContext } from '../../composables'; import type { YjsOptions } from './types'; export interface AppWrapperYjsOptions { /** Null when the app did not opt into collaborative editing. */ yjs: YjsOptions | null; applicationId: string; resource: Ref; isReadOnly: Ref; /** Whether the wrapper holds edits that are not on disk yet. */ isDirty: Ref; loading: Ref; loadingError: Ref; contentResourceId: Ref; currentContent: Ref; serverContent: Ref; currentETag: Ref; currentFileContext: Ref; fileContentOptions: FileContentOptions | null; getFileContents: AppFileHandlingResult['getFileContents']; putFileContents: AppFileHandlingResult['putFileContents']; /** AppWrapper's landing point for a successful write. */ applySavedResource: (etag: string, saved?: Resource | null) => void; /** Hands content that landed on disk to the wrapped app. */ runSaveCallback: (content: unknown) => Promise; /** The file changed outside this window and the session gave up the room. */ onConflict: () => void; /** Whether a PUT of this wrapper is in flight. External events wait for it. */ isSaving: MaybeRefOrGetter; /** The file changed outside this window and the editor now shows that version. */ onExternalUpdateApplied: () => void; } /** * Everything Yjs-specific that AppWrapper owns on behalf of collaborative * apps: the session with its wiring into the wrapper's save state, the * collaboration error toast, and the save-conflict reconciliation. */ export declare function useAppWrapperYjs(options: AppWrapperYjsOptions): { session: import("../..").YjsSession; isSessionReady: import("vue").ComputedRef; effectiveReadOnly: import("vue").ComputedRef; isConflicted: import("vue").ComputedRef; reconcileConflict: (newContent: unknown) => Generator; };