forked from kazzkiq/CodeFlask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
44 lines (35 loc) · 1.06 KB
/
index.d.ts
File metadata and controls
44 lines (35 loc) · 1.06 KB
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
34
35
36
37
38
39
40
41
42
43
44
import * as prism from 'prismjs';
export as namespace codeflask
export type LanguageDefinition = {
[token: string]: prism.LanguageDefinition | RegExp
}
export type EventListeners = Partial<{
[K in keyof WindowEventMap]: (e: WindowEventMap[K]) => void
}>
export interface CodeFlaskOptions {
language?: string
rtl?: boolean
tabSize?: number
enableAutocorrect?: boolean
lineNumbers?: boolean
defaultTheme?: boolean
areaId?: string
ariaLabelledby?: string
readonly?: boolean
selfClosingCharacters: string[]
customEventListeners?: EventListeners
}
export default class CodeFlask {
constructor(selectorOrElement: Element | string, Prism: any, 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
removeEventListeners(): void
blur(): void
highlight(): void
highlightLines(lineSpec: string): void
}