forked from kazzkiq/CodeFlask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
33 lines (26 loc) · 782 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as prism from 'prismjs';
export as namespace codeflask
export type LanguageDefinition = {
[token: string]: prism.LanguageDefinition | RegExp
}
export interface CodeFlaskOptions {
language?: string
rtl?: boolean
tabSize?: number
enableAutocorrect?: boolean
lineNumbers?: boolean
defaultTheme?: boolean
areaId?: string
ariaLabelledby?: string
readonly?: boolean
}
export default class CodeFlask {
constructor(selectorOrElement: Element | string, opts: CodeFlaskOptions)
updateCode(newCode: string): void
updateLanguage(newLanguage: string): void
addLanguage(name: string, options: LanguageDefinition): void
getCode(): string
onUpdate(callback: (code: string) => void): void
disableReadonlyMode(): void
enableReadonlyMode(): void
}