import { CursorContext, MathInputI18nContext } from "@khanacademy/math-input"; import * as React from "react"; import { PerseusI18nContext } from "./i18n-context"; import type { MathFieldInterface } from "@khanacademy/math-input"; import type { AnalyticsEventHandlerFn, KeypadKey, LegacyButtonSets } from "@khanacademy/perseus-core"; type ButtonsVisibleType = "always" | "never" | "focused"; export type KeypadButtonSets = { advancedRelations?: boolean; basicRelations?: boolean; divisionKey?: boolean; logarithms?: boolean; preAlgebra?: boolean; trigonometry?: boolean; scientific?: boolean; }; type Props = { className?: string; value: string; onChange: any; convertDotToTimes: boolean; /** * @deprecated Use `keypadButtonSets` instead. Maps to `keypadButtonSets`. * @see keypadButtonSets */ buttonSets?: LegacyButtonSets; /** * Overrides deprecated `buttonSets` prop. */ keypadButtonSets?: KeypadButtonSets; ariaLabel: string; onFocus?: () => void; onBlur?: () => void; extraKeys?: ReadonlyArray; /** * Whether to show the keypad buttons. * The strings now misleading, but we keep them for backwards compatibility. * - `focused` means that the keypad **appears on toggle, *off* by default**. * - `always` means that the keypad **appears on toggle, *on* by default.** * - `never` means that the keypad is **never shown**. */ buttonsVisible?: ButtonsVisibleType; onAnalyticsEvent: AnalyticsEventHandlerFn; }; type InnerProps = Props & { mathInputStrings: any; }; type DefaultProps = { value: Props["value"]; convertDotToTimes: Props["convertDotToTimes"]; }; type State = { focused: boolean; keypadOpen: boolean; cursorContext: (typeof CursorContext)[keyof typeof CursorContext]; openedWithEventType?: string; }; declare class InnerMathInput extends React.Component { static contextType: React.Context; context: React.ContextType; mouseDown: boolean; __mathFieldWrapperRef: HTMLSpanElement | null; __mathField: MathFieldInterface | null; static defaultProps: DefaultProps; state: State; componentDidMount(): void; componentDidUpdate(prevProps: Readonly): void; openKeypad(): void; closeKeypad(): void; insert: (value: any) => void; mathField: () => MathFieldInterface | null; focus: () => void; blur: () => void; handleKeypadPress: (key: KeypadKey, e: any) => void; render(): React.ReactNode; } declare class MathInput extends React.Component { static contextType: React.Context<{ strings: import("../../../math-input/src/strings").MathInputStrings; locale: string; }>; context: React.ContextType; inputRef: React.RefObject; static defaultProps: Pick; blur(): void; focus(): void; insert(value: any): void; render(): React.JSX.Element; } export default MathInput;