import { type PerseusRadioRubric, type PerseusRadioUserInput } from "@khanacademy/perseus-core"; import * as React from "react"; import { PerseusI18nContext } from "../../components/i18n-context"; import type { RadioProps, RadioWidgetHandle } from "./multiple-choice-widget"; import type { ChoiceState, Widget, WidgetProps } from "../../types"; import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils"; type Props = WidgetProps; type ChoiceStateWithoutSelected = Omit; type State = { choiceStates: ChoiceStateWithoutSelected[]; }; /** * This is a wrapper around the old radio widget that allows us to * conditionally render the new radio widget when the feature flag is on. * * This is necessary to ensure that we do not interrupt the assessment studies * that are currently running. * * TODO(LEMS-2994): Clean up this file. State, initChoiceStates, the * constructor, and UNSAFE_componentWillUpdate are all now only providing * static defaults that never update on user interaction. */ declare class Radio extends React.Component implements Widget { static contextType: React.Context; context: React.ContextType; radioRef: React.RefObject; state: State; constructor(props: Props); UNSAFE_componentWillUpdate(nextProps: Props): void; /** * @deprecated and likely very broken API * [LEMS-3185] do not trust serializedState */ getSerializedState(): { hasNoneOfTheAbove: boolean; numCorrect: number; multipleSelect?: boolean; countChoices?: boolean; deselectEnabled?: boolean; choices: import("./multiple-choice-widget").RadioChoiceWithMetadata[]; choiceStates?: ChoiceState[]; editMode?: boolean; labelWrap?: boolean; trackInteraction: (extraData?: PerseusRadioRubric | undefined) => void; widgetId: string; widgetIndex: number; alignment: string | null | undefined; problemNum: number | null | undefined; apiOptions: Readonly unknown; showAlignmentOptions?: boolean; readOnly?: boolean; editingDisabled?: boolean; answerableCallback?: (arg1: boolean) => unknown; getAnotherHint?: () => unknown; interactionCallback?: (widgetData: { [widgetId: string]: any; }) => void; imagePlaceholder?: React.ReactNode; widgetPlaceholder?: React.ReactNode; baseElements?: { Link: React.ComponentType; }; imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode; trackInteraction?: (args: { type: string; id: string; correct?: boolean; } & Partial & Partial<{ visible: number; }>) => void; customKeypad?: boolean; nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI; isMobile?: boolean; isMobileApp?: boolean; setDrawingAreaAvailable?: (arg1: boolean) => unknown; hintProgressColor?: string; canScrollPage?: boolean; editorChangeDelay?: number; flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale", boolean>; }> & { baseElements: NonNullable; canScrollPage: NonNullable; editorChangeDelay: NonNullable; isArticle: NonNullable; isMobile: NonNullable; isMobileApp: NonNullable; editingDisabled: NonNullable; onFocusChange: NonNullable; readOnly: NonNullable; setDrawingAreaAvailable: NonNullable; showAlignmentOptions: NonNullable; }>; keypadElement?: any; questionCompleted?: boolean; onFocus: (blurPath: import("../..").FocusPath) => void; onBlur: (blurPath: import("../..").FocusPath) => void; findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray; reviewMode: boolean; showSolutions?: import("@khanacademy/perseus-core").ShowSolutions; handleUserInput: (newUserInput: PerseusRadioUserInput, cb?: () => void, silent?: boolean) => void; linterContext: import("@khanacademy/perseus-linter").LinterContextProps; containerSizeClass: import("../../util/sizing-utils").SizeClass; }; getPromptJSON(): RadioPromptJSON; _mergePropsAndState(): Props & { numCorrect: number; }; render(): React.ReactNode; } export default Radio;