| 1 |
import { Editor, EditorConfiguration } from 'codemirror' |
| 2 |
|
| 3 |
export interface EditorOption { |
| 4 |
name: string |
| 5 |
type: 'checkbox' | 'number' | 'select' |
| 6 |
codemirror: keyof EditorConfiguration |
| 7 |
} |
| 8 |
|
| 9 |
export interface CodeEditorInstance { |
| 10 |
codemirror: Editor |
| 11 |
settings: CodeEditorSettings |
| 12 |
} |
| 13 |
|
| 14 |
export interface CodeEditorSettings { |
| 15 |
codemirror: EditorConfiguration |
| 16 |
csslint: Record<string, unknown> |
| 17 |
htmlhint: Record<string, unknown> |
| 18 |
jshint: Record<string, unknown> |
| 19 |
onTabNext: () => void |
| 20 |
onTabPrevious: () => void |
| 21 |
onChangeLintingErrors: () => void |
| 22 |
onUpdateErrorNotice: () => void |
| 23 |
} |
| 24 |
|
| 25 |
export interface WordPressUtils { |
| 26 |
codeEditor: { |
| 27 |
initialize: (textarea: Element, options?: Partial<CodeEditorSettings>) => CodeEditorInstance |
| 28 |
defaultSettings: CodeEditorSettings |
| 29 |
} |
| 30 |
} |
| 31 |
|