Skip to content

Editor API

hackape edited this page Jul 19, 2017 · 1 revision

Editor

Editor is the data model to be passed to <AnyEditorComponents editor={editor} />

interface EditorProps {
  tabId: string
  filePath: string
  gitBlame: object
  cm: CodeMirror
}

interface Editor {
  id: string
  tabId: string
  filePath: string

  get file(): File
  // return file base on this.filePath

  get content(): string
  // short cut to this.file.content

  gitBlame: {
    show: boolean
    data: Any[]
  }

  update(editorProps: EditorProps): void
}

APIs

Clone this wiki locally