/**
 * Document Editor Module
 * 文档编辑器模块 - 公共 API 导出
 *
 * @example
 * ```tsx
 * import { DocumentEditor, type DocumentEditorRef } from '@/features/document-editor';
 *
 * export default function EditorPage() {
 *   const editorRef = useRef<DocumentEditorRef>(null);
 *
 *   const handleSave = () => {
 *     const json = editorRef.current?.getJSON();
 *     console.log(json);
 *   };
 *
 *   return (
 *     <DocumentEditor
 *       ref={editorRef}
 *       placeholder="开始编写..."
 *       showToolbar
 *       showWordCount
 *     />
 *   );
 * }
 * ```
 */

// 主组件
export { DocumentEditor } from './components/DocumentEditor';

// 类型
export type {
  DocumentEditorProps,
  DocumentEditorRef,
  EditorContent,
  HeadingItem,
  WordCount,
  SlashMenuItem,
  ToolbarItem,
  LinkEditorData,
} from './core/types';

// Hooks
export { useEditor } from './hooks/useEditor';
export type { UseEditorOptions, UseEditorReturn } from './hooks/useEditor';

// Store
export { useEditorStore } from './stores/useEditorStore';

// 扩展基类（用于创建自定义扩展）
export { Extension, NodeExtension, MarkExtension, PluginExtension } from './core/Extension';
export { ExtensionManager, createExtensionManager } from './core/ExtensionManager';

// 内置扩展
export {
  // Nodes
  Doc,
  Text,
  Paragraph,
  Heading,
  ListItem,
  BulletList,
  OrderedList,
  Blockquote,
  CodeBlock,
  HorizontalRule,
  Image,
  Callout,
  Table,
  TableRow,
  TableCell,
  // Marks
  Bold,
  Italic,
  Code,
  Link,
  Underline,
  Strike,
  Highlight,
  // Plugins
  History,
  Placeholder,
  DropCursor,
  GapCursor,
  SlashMenuPlugin,
  CodeHighlight,
} from './extensions';

// 组件
export { SlashMenu, LinkEditor, FloatingToolbar, ImageUploader, Toolbar } from './components';

// 工具函数
export { serializeToMarkdown } from './utils';
export type { MarkdownSerializerOptions } from './utils';
