Type Definitions
TypeScript type reference for Editu.
Overview
Editu provides TypeScript types organized into the following categories:
| Category | Description |
|---|---|
| Editor Types | Core editor options, content, and state types |
| Feature Options | Configuration types for all editor features |
Quick Reference
Most Used Types
typescript
// Editu types from @editu/core
import type {
// Editor
EdituEditorOptions,
EdituEditorState,
// Features
EdituFeatureOptions,
// Auto-Save
EdituAutoSaveOptions,
EdituSaveStatus,
// Theme
EdituTheme,
EdituResolvedTheme,
} from '@editu/core';
// Tiptap types from @tiptap/core
import type { JSONContent } from '@tiptap/core';Example Usage
typescript
import type { EdituEditorOptions } from '@editu/core';
import type { JSONContent } from '@tiptap/core';
const options: EdituEditorOptions = {
initialContent: {
type: 'doc',
content: [
{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }
],
},
features: {
slashCommand: true,
markdown: true,
dragHandle: true,
},
onUpdate: ({ editor }) => {
const content: JSONContent = editor.getJSON();
console.log(content);
},
};Next Steps
- Editor Types - EdituEditorOptions, JSONContent, EdituEditorState
- Feature Options - All feature configuration types