Skip to content

Commit

Permalink
Revert "Omit extra properties from InteractiveGraph onChange arg (#1654
Browse files Browse the repository at this point in the history
…)"

This reverts commit c04d275.
  • Loading branch information
benchristel committed Sep 24, 2024
1 parent 3dcb1fd commit 5ab3962
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 358 deletions.
5 changes: 0 additions & 5 deletions .changeset/eleven-elephants-trade.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/perseus/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type {Item} from "./multi-items/item-types";
import type {
Hint,
PerseusAnswerArea,
PerseusGraphType,
PerseusWidget,
PerseusWidgetsMap,
} from "./perseus-types";
import type {PerseusStrings} from "./strings";
import type {SizeClass} from "./util/sizing-utils";
import type {InteractiveGraphState} from "./widgets/interactive-graphs/types";
import type {KeypadAPI} from "@khanacademy/math-input";
import type {AnalyticsEventHandlerFn} from "@khanacademy/perseus-core";
import type {LinterContextProps} from "@khanacademy/perseus-linter";
Expand Down Expand Up @@ -90,7 +90,7 @@ export type ChangeHandler = (
// perseus-all-package/widgets/grapher.jsx
plot?: any;
// Interactive Graph callback (see legacy: interactive-graph.tsx)
graph?: PerseusGraphType;
graph?: InteractiveGraphState;
},
callback?: () => unknown | null | undefined,
silent?: boolean,
Expand Down
1 change: 1 addition & 0 deletions packages/perseus/src/widgets/interactive-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ class LegacyInteractiveGraph extends React.Component<Props, State> {

$(this.angle).on("move", () => {
this.onChange({
// @ts-expect-error Type '{ coords: any; type: "angle"; showAngles?: boolean | undefined; allowReflexAngles?: boolean | undefined; angleOffsetDeg?: number | undefined; snapDegrees?: number | undefined; match?: "congruent" | undefined; }' is not assignable to type 'InteractiveGraphState | undefined'.
graph: {...graph, coords: this.angle?.getClockwiseCoords()},
});
});
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5ab3962

Please sign in to comment.