sourabhrealtime
Version:
ROBUST RICH TEXT EDITOR: Single-pane contentEditable with direct text selection formatting, speech features, undo/redo, professional UI - Perfect TipTap alternative
77 lines (66 loc) • 2.02 kB
TypeScript
// SourabhRealtime v2.6.5 - Type Definitions
import * as React from 'react';
export declare enum UserRole {
SUPER_ADMIN = 'super_admin',
ADMIN = 'admin',
EDITOR = 'editor',
VIEWER = 'viewer'
}
export interface User {
id: string;
name: string;
email?: string;
role?: UserRole;
color?: string;
}
export interface UseRealtimeCursorOptions {
apiUrl?: string;
projectId: string;
user: User;
debug?: boolean;
}
export interface UseRealtimeCursorReturn {
socket: any;
connected: boolean;
collaborators: User[];
cursors: Record<string, any>;
mouseCursors: Record<string, any>;
typingStatus: Record<string, any>;
invitations: any[];
joinRequests: any[];
userRole: UserRole;
projectSettings: any;
connect: () => void;
disconnect: () => void;
updateContent: (content: string, cursorPosition?: any) => void;
sendJoinRequest: (message?: string) => void;
approveJoinRequest: (requestId: string, role?: UserRole) => void;
rejectJoinRequest: (requestId: string, reason?: string) => void;
inviteUser: (email: string, role: UserRole) => void;
}
export declare function useRealtimeCursor(options: UseRealtimeCursorOptions): UseRealtimeCursorReturn;
export interface RealtimeAppProps {
apiUrl?: string;
supabaseUrl?: string;
supabaseKey?: string;
supabaseAnonKey?: string;
}
export interface EnhancedRealtimeEditorProps {
apiUrl?: string;
projectId: string;
user: User;
onContentChange?: (content: string) => void;
onCollaboratorsChange?: (collaborators: User[]) => void;
onConnectionChange?: (connected: boolean) => void;
height?: number | string;
width?: number | string;
showToolbar?: boolean;
showCollaborators?: boolean;
showMouseCursors?: boolean;
className?: string;
placeholder?: string;
}
export declare const EnhancedRealtimeEditor: React.FC<EnhancedRealtimeEditorProps>;
export declare const RealtimeEditor: React.FC<EnhancedRealtimeEditorProps>;
declare const RealtimeApp: React.FC<RealtimeAppProps>;
export default RealtimeApp;