react-latex-editor
Version:
A professional React rich text editor with mathematical equation support, built on TipTap with MathLive integration. Production-ready with TypeScript support, accessibility features, and industrial-grade error handling.
71 lines • 1.44 kB
TypeScript
/**
* Common types and interfaces for the React LaTeX Editor
*/
/**
* Editor content format
*/
export type EditorContent = string | Record<string, any>;
/**
* Editor theme configuration
*/
export interface EditorTheme {
primaryColor?: string;
backgroundColor?: string;
textColor?: string;
borderColor?: string;
focusColor?: string;
}
/**
* Math equation format
*/
export interface MathEquation {
latex: string;
displayMode?: boolean;
}
/**
* Image configuration
*/
export interface ImageConfig {
src: string;
alt?: string;
width?: string;
height?: string;
align?: "left" | "center" | "right";
}
/**
* Editor state
*/
export interface EditorState {
content: string;
isEmpty: boolean;
isFocused: boolean;
characterCount?: number;
wordCount?: number;
}
/**
* Editor event handlers
*/
export interface EditorEventHandlers {
onChange?: (content: string) => void;
onFocus?: () => void;
onBlur?: () => void;
onImageSelectionRequest?: () => void;
onError?: (error: Error) => void;
}
/**
* Export options for editor content
*/
export interface ExportOptions {
format: "html" | "json" | "text" | "markdown";
includeStyles?: boolean;
prettyPrint?: boolean;
}
/**
* Editor validation result
*/
export interface ValidationResult {
isValid: boolean;
errors?: string[];
warnings?: string[];
}
//# sourceMappingURL=editor.d.ts.map