modulo-editor
Version:
A flexible and extensible block-based editor for React applications
28 lines (27 loc) • 863 B
TypeScript
import { IconComponent } from "./icon";
export type BooleanFormatKey = "bold" | "italic" | "underline" | "strikethrough" | "code" | "marker";
export type ValueFormatKey = "color" | "fontSize" | "backgroundColor" | "link";
export type FormatKey = BooleanFormatKey | ValueFormatKey;
export interface RichTextFormat {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
code?: boolean;
marker?: boolean;
link?: string;
color?: string;
backgroundColor?: string;
fontSize?: string;
}
export interface ToolbarItem {
type: "dropdown";
icon: IconComponent;
title: string;
options: Array<{
value: string;
label: string;
icon: IconComponent;
}>;
onChange: (value: string, data: Record<string, any>, onChange: (data: Record<string, any>) => void) => void;
}