import { UsersChangeEvent, FileNameChangeEvent, ProposedChangesEvent, CloseProposalEvent } from './collaboration-instance.js'; import * as types from 'open-collaboration-protocol'; import * as monaco from 'monaco-editor'; export type MonacoCollabCallbacks = { onUserRequestsAccess: (user: types.User) => Promise; /** * reports the status when joining or creating a room * @param info information about the changed status */ statusReporter?: (info: types.Info) => void; /** * Optional override for the diff display when changes are proposed. * If provided, the default Monaco DiffEditor is not shown and the consuming * app is responsible for presenting the diff and calling `accept()` or `reject()`. */ onProposeChanges?: (path: string, originalText: string, modifiedText: string, accept: () => void, reject: () => void) => void; }; export type MonacoCollabOptions = { serverUrl: string; callbacks: MonacoCollabCallbacks; userToken?: string; roomToken?: string; useCookieAuth?: boolean; loginPageOpener?: (token: string, authenticationMetadata: types.AuthMetadata) => Promise; }; export type OtherUserData = { peer: types.Peer; color: string; }; export type UserData = { me: types.Peer; others: OtherUserData[]; }; export type MonacoCollabApi = { createRoom: () => Promise; joinRoom: (roomToken: string) => Promise; leaveRoom: () => void; login: () => Promise; logout: () => Promise; isLoggedIn: () => Promise; setEditor: (editor: monaco.editor.IStandaloneCodeEditor) => void; getUserData: () => Promise; onUsersChanged: (evt: UsersChangeEvent) => void; onFileNameChange: (callback: FileNameChangeEvent) => void; getCurrentConnection: () => types.ProtocolBroadcastConnection | undefined; followUser: (id?: string) => void; getFollowedUser: () => string | undefined; setFileName: (fileName: string) => void; getFileName: () => string | undefined; setWorkspaceName: (workspaceName: string) => void; getWorkspaceName: () => string | undefined; onProposedChanges: (callback: ProposedChangesEvent) => void; closeProposal: (path: string) => void; cancelProposal: (path: string) => void; onCloseProposal: (callback: CloseProposalEvent) => void; }; export declare function monacoCollab(options: MonacoCollabOptions): MonacoCollabApi; export declare function deactivate(): void; //# sourceMappingURL=monaco-api.d.ts.map