import type { InteractiveGraphAction } from "./reducer/interactive-graph-action";
import type { Coord } from "../../interactive2/types";
import type { WidgetProps } from "../../types";
import type { QuadraticCoords } from "@khanacademy/kmath";
import type { PerseusInteractiveGraphUserInput, PerseusInteractiveGraphWidgetOptions } from "@khanacademy/perseus-core";
import type { Interval, vec } from "mafs";
import type { ReactNode } from "react";
export type InteractiveGraphProps = WidgetProps<PerseusInteractiveGraphWidgetOptions, PerseusInteractiveGraphUserInput>;
export type Dispatch = (action: InteractiveGraphAction) => unknown;
export type MafsGraphProps<T extends InteractiveGraphState> = {
    graphState: T;
    dispatch: Dispatch;
};
export type InteractiveGraphElementSuite = {
    graph: ReactNode;
    interactiveElementsDescription: ReactNode;
};
export type InteractiveGraphState = AbsoluteValueGraphState | AngleGraphState | SegmentGraphState | LinearSystemGraphState | LinearGraphState | RayGraphState | NoneGraphState | PolygonGraphState | PointGraphState | CircleGraphState | QuadraticGraphState | SinusoidGraphState | ExponentialGraphState | TangentGraphState | LogarithmGraphState | VectorGraphState;
export type UnlimitedGraphState = PointGraphState | PolygonGraphState;
type MovePointAnnouncement = {
    type: "move-point";
    pointLabel: string;
    x: number;
    y: number;
};
type MoveRadiusPointAnnouncement = {
    type: "move-radius-point";
    x: number;
    y: number;
    centerX: number;
    radius: number;
};
type MoveCenterAnnouncement = {
    type: "move-center";
    x: number;
    y: number;
};
type MoveVectorPointAnnouncement = {
    type: "move-vector-point";
    pointIndex: number;
    x: number;
    y: number;
};
type MoveSegmentPointAnnouncement = {
    type: "move-segment-point";
    segmentIndex: number;
    pointIndex: number;
    pointLabel: string | number;
    x: number;
    y: number;
    totalSegments: number;
};
type MoveSegmentLineAnnouncement = {
    type: "move-segment-line";
    coords: PairOfPoints;
};
type MoveLinearSystemPointAnnouncement = {
    type: "move-linear-system-point";
    lineIndex: number;
    pointIndex: number;
    pointLabel: string | number;
    x: number;
    y: number;
};
type MoveRayPointAnnouncement = {
    type: "move-ray-point";
    pointIndex: number;
    pointLabel: string | number;
    x: number;
    y: number;
};
type MoveVectorLineAnnouncement = {
    type: "move-vector-line";
    coords: PairOfPoints;
};
type MoveLinearSystemLineAnnouncement = {
    type: "move-linear-system-line";
    lineIndex: number;
    coords: PairOfPoints;
};
type MoveRayLineAnnouncement = {
    type: "move-ray-line";
    coords: PairOfPoints;
};
type MoveLinearLineAnnouncement = {
    type: "move-linear-line";
    coords: PairOfPoints;
};
type MoveSinusoidPointAnnouncement = {
    type: "move-sinusoid-point";
    pointIndex: number;
    pointLabel: string | number;
    x: number;
    y: number;
    otherY: number;
};
type MoveAnglePointAnnouncement = {
    type: "move-angle-point";
    pointIndex: number;
    pointLabel: string | number;
    x: number;
    y: number;
    angleMeasure: number;
};
type MovePolygonAnnouncement = {
    type: "move-polygon";
    coords: ReadonlyArray<Coord>;
    pointLabels?: ReadonlyArray<string>;
};
export type InteractiveGraphStateAnnouncement = MovePointAnnouncement | MoveRadiusPointAnnouncement | MoveCenterAnnouncement | MoveVectorPointAnnouncement | MoveVectorLineAnnouncement | MoveSegmentPointAnnouncement | MoveSegmentLineAnnouncement | MoveLinearSystemPointAnnouncement | MoveLinearSystemLineAnnouncement | MoveRayPointAnnouncement | MoveRayLineAnnouncement | MoveLinearLineAnnouncement | MoveSinusoidPointAnnouncement | MoveAnglePointAnnouncement | MovePolygonAnnouncement;
export interface InteractiveGraphStateCommon {
    hasBeenInteractedWith: boolean;
    pointLabels?: string[];
    range: [xRange: Interval, yRange: Interval];
    snapStep: vec.Vector2;
    stateAnnouncement?: InteractiveGraphStateAnnouncement;
}
export interface SegmentGraphState extends InteractiveGraphStateCommon {
    type: "segment";
    coords: PairOfPoints[];
}
export interface LinearGraphState extends InteractiveGraphStateCommon {
    type: "linear";
    coords: PairOfPoints;
}
export interface LinearSystemGraphState extends InteractiveGraphStateCommon {
    type: "linear-system";
    coords: PairOfPoints[];
}
export type InteractionMode = "mouse" | "keyboard";
export interface NoneGraphState extends InteractiveGraphStateCommon {
    type: "none";
}
export interface PointGraphState extends InteractiveGraphStateCommon {
    type: "point";
    coords: Coord[];
    numPoints?: number | "unlimited";
    focusedPointIndex: number | null;
    showRemovePointButton: boolean;
    interactionMode: InteractionMode;
    showKeyboardInteractionInvitation: boolean;
}
export interface RayGraphState extends InteractiveGraphStateCommon {
    type: "ray";
    coords: PairOfPoints;
}
export interface VectorGraphState extends InteractiveGraphStateCommon {
    type: "vector";
    coords: PairOfPoints;
}
export interface PolygonGraphState extends InteractiveGraphStateCommon {
    type: "polygon";
    showAngles: boolean;
    showSides: boolean;
    snapTo: SnapTo;
    coords: Coord[];
    numSides?: number | "unlimited";
    focusedPointIndex: number | null;
    showRemovePointButton: boolean;
    interactionMode: InteractionMode;
    showKeyboardInteractionInvitation: boolean;
    closedPolygon: boolean;
}
export interface CircleGraphState extends InteractiveGraphStateCommon {
    type: "circle";
    center: Coord;
    radiusPoint: Coord;
}
export interface QuadraticGraphState extends InteractiveGraphStateCommon {
    type: "quadratic";
    coords: QuadraticCoords;
}
export interface SinusoidGraphState extends InteractiveGraphStateCommon {
    type: "sinusoid";
    coords: [vec.Vector2, vec.Vector2];
}
export interface ExponentialGraphState extends InteractiveGraphStateCommon {
    type: "exponential";
    coords: [vec.Vector2, vec.Vector2];
    /** The y-value of the horizontal asymptote (y = asymptote). */
    asymptote: number;
}
export interface AbsoluteValueGraphState extends InteractiveGraphStateCommon {
    type: "absolute-value";
    coords: [vec.Vector2, vec.Vector2];
}
export interface TangentGraphState extends InteractiveGraphStateCommon {
    type: "tangent";
    coords: [vec.Vector2, vec.Vector2];
}
export interface LogarithmGraphState extends InteractiveGraphStateCommon {
    type: "logarithm";
    coords: [vec.Vector2, vec.Vector2];
    /** The x-value of the vertical asymptote (x = asymptote). */
    asymptote: number;
}
export interface AngleGraphState extends InteractiveGraphStateCommon {
    type: "angle";
    showAngles?: boolean;
    allowReflexAngles?: boolean;
    angleOffsetDeg?: number | null;
    snapDegrees?: number;
    coords: [Coord, Coord, Coord];
}
export type PairOfPoints = [Coord, Coord];
export type GraphDimensions = {
    range: [Interval, Interval];
    width: number;
    height: number;
};
export type AriaLive = "off" | "assertive" | "polite" | undefined;
export type SnapTo = "grid" | "angles" | "sides";
export {};
