-
Notifications
You must be signed in to change notification settings - Fork 38
/
index.d.ts
71 lines (63 loc) · 2.03 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
declare module 'react-mathquill' {
import * as React from 'react'
export function addStyles(): void
export interface StaticMathFieldProps
extends React.HTMLAttributes<HTMLSpanElement> {
children?: string
mathquillDidMount?: (mathField: MathField) => void
}
export interface EditableMathFieldProps
extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onChange'> {
onChange?: (mathField: MathField) => void
latex?: string
config?: MathFieldConfig
mathquillDidMount?: (mathField: MathField) => void
}
export const EditableMathField: React.FunctionComponent<EditableMathFieldProps>
export const StaticMathField: React.FunctionComponent<StaticMathFieldProps>
export interface MathFieldConfig {
spaceBehavesLikeTab?: boolean
leftRightIntoCmdGoes?: 'up' | 'down'
restrictMismatchedBrackets?: boolean
sumStartsWithNEquals?: boolean
supSubsRequireOperand?: boolean
charsThatBreakOutOfSupSub?: string
autoSubscriptNumerals?: boolean
autoCommands?: string
autoOperatorNames?: string
substituteTextarea?: () => void
handlers?: {
deleteOutOf?: (direction: Direction, mathField: MathField) => void
moveOutOf?: (direction: Direction, mathField: MathField) => void
selectOutOf?: (direction: Direction, mathField: MathField) => void
downOutOf?: (mathField: MathField) => void
upOutOf?: (mathField: MathField) => void
edit?: (mathField: MathField) => void
enter?: (mathField: MathField) => void
}
maxDepth?: number
}
export enum Direction {
R,
L,
}
export interface MathField {
revert(): void
reflow(): void
el(): HTMLElement
latex(): string
latex(latexString: string): void
text(): string
focus(): void
blur(): void
write(latex: string): void
cmd(latexString: string): void
select(): void
clearSelection(): void
moveToLeftEnd(): void
moveToRightEnd(): void
keystroke(keys: string): void
typedText(text: string): void
config(newConfig: MathFieldConfig): void
}
}