# Interface CodeMirrorInstance

interface CodeMirrorInstance {
doc : {
getValue(): string;
markText(
from: number | { ch: number; line: number },
to: number | { ch: number; line: number },
opts: { className: string },
): any;
replaceRange(text: string, from: number, to: number): any;
setSelection(from: number, to: number): any;
};
clearHistory (): any;
focus (): any;
getCursor (): { ch: number; col: number; line: number };
getSelection (): string;
getValue (): string;
lineCount (): number;
on (event: string, callback: () => void): any;
operation (callback: () => void): any;
refresh (): any;
scrollIntoView (pos: number): any;
setCursor (line: number, col: number): any;
setOption (name: string, value: string): any;
setValue (val: string): any;
}

- Defined in src/public/app/types.d.ts:223

##### Index

### Properties

doc

### Methods

clearHistory
focus
getCursor
getSelection
getValue
lineCount
on
operation
refresh
scrollIntoView
setCursor
setOption
setValue

## Properties

### doc

doc: {
getValue(): string;
markText(
from: number | { ch: number; line: number },
to: number | { ch: number; line: number },
opts: { className: string },
): any;
replaceRange(text: string, from: number, to: number): any;
setSelection(from: number, to: number): any;
}

- Defined in src/public/app/types.d.ts:237

## Methods

### clearHistory

- clearHistory(): any

  #### Returns any

  - Defined in src/public/app/types.d.ts:226

### focus

- focus(): any

  #### Returns any

  - Defined in src/public/app/types.d.ts:229

### getCursor

- getCursor(): { ch: number; col: number; line: number }

  #### Returns { ch: number; col: number; line: number }

  - Defined in src/public/app/types.d.ts:230

### getSelection

- getSelection(): string

  #### Returns string

  - Defined in src/public/app/types.d.ts:232

### getValue

- getValue(): string

  #### Returns string

  - Defined in src/public/app/types.d.ts:224

### lineCount

- lineCount(): number

  #### Returns number

  - Defined in src/public/app/types.d.ts:233

### on

- on(event: string, callback: () => void): any

  #### Parameters

  - event: string
  - callback: () => void

  #### Returns any

  - Defined in src/public/app/types.d.ts:234

### operation

- operation(callback: () => void): any

  #### Parameters

  - callback: () => void

  #### Returns any

  - Defined in src/public/app/types.d.ts:235

### refresh

- refresh(): any

  #### Returns any

  - Defined in src/public/app/types.d.ts:228

### scrollIntoView

- scrollIntoView(pos: number): any

  #### Parameters

  - pos: number

  #### Returns any

  - Defined in src/public/app/types.d.ts:236

### setCursor

- setCursor(line: number, col: number): any

  #### Parameters

  - line: number
  - col: number

  #### Returns any

  - Defined in src/public/app/types.d.ts:231

### setOption

- setOption(name: string, value: string): any

  #### Parameters

  - name: string
  - value: string

  #### Returns any

  - Defined in src/public/app/types.d.ts:227

### setValue

- setValue(val: string): any

  #### Parameters

  - val: string

  #### Returns any

  - Defined in src/public/app/types.d.ts:225