on-codemerge
Version:
A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product
46 lines (45 loc) • 1.29 kB
TypeScript
import { HTMLEditor } from '../../app';
import { Plugin } from '../../core/Plugin';
interface CollaborationPluginOptions {
serverUrl?: string;
autoStart?: boolean;
}
export declare class CollaborationPlugin implements Plugin {
name: string;
hotkeys: {
keys: string;
description: string;
command: string;
icon: string;
}[];
private editor;
private ws;
private docId;
private popup;
private options;
private toolbarButton;
private isExternalUpdate;
private contentVersion;
private lastContent;
private unsubscribeFromContentChange;
private status;
private userId;
constructor(options?: CollaborationPluginOptions);
initialize(editor: HTMLEditor): void;
private addToolbarButton;
private updateConnectionStatus;
private setupCollaboration;
private debounce;
private debouncedSendUpdate;
private handleContentChange;
/**
* Нормализует HTML, удаляя лишние пробелы и переносы строк
* @param html Исходный HTML
* @returns Нормализованный HTML
*/
private normalizeHtml;
private createCollaborationContent;
private startCollaboration;
destroy(): void;
}
export {};