import type { BezierParams, BounceParams, OvershootParams, SpringParams, WiggleParams } from "../validations/params"; import type { AnimationTypeKey, BezierCurveKey, BezierStyleKey, BounceCurveKey, EasingTypeKey, LinearEasingAccuracyKey, OvershootCurveKey, PreviewPlayModeKey, SpringCurveKey, WiggleCurveKey } from "./enums"; export type Point = { x: number; y: number; }; export type EasingStateValue = string | number | boolean | Point[]; export type EasingStateShareKey = keyof EasingState & ("easingType" | "previewDuration" | "previewAnimationType" | "editorAccuracy" | "bezierStyle" | "bezierCurve" | "bezierX1" | "bezierY1" | "bezierX2" | "bezierY2" | "springCurve" | "springMass" | "springStiffness" | "springDamping" | "bounceCurve" | "bounceBounces" | "bounceDamping" | "wiggleCurve" | "wiggleWiggles" | "wiggleDamping" | "overshootStyle" | "overshootCurve" | "overshootMass" | "overshootDamping"); export type EasingStateShare = Partial>; export type EasingStateBlock = { [Key in keyof EasingState as Key extends `${Prefix}${string}` ? Key : never]: EasingState[Key]; }; export type EasingState = { easingType: EasingTypeKey; bezierStyle: BezierStyleKey; bezierCurve: BezierCurveKey; bezierX1: BezierParams["x1"]; bezierY1: BezierParams["y1"]; bezierX2: BezierParams["x2"]; bezierY2: BezierParams["y2"]; bezierValue: string; bezierIsCustom: boolean; springCurve: SpringCurveKey; springMass: SpringParams["mass"]; springStiffness: SpringParams["stiffness"]; springDamping: SpringParams["damping"]; springValue: string; springPoints: Point[]; springIsCustom: boolean; bounceCurve: BounceCurveKey; bounceBounces: BounceParams["bounces"]; bounceDamping: BounceParams["damping"]; bounceValue: string; bouncePoints: Point[]; bounceIsCustom: boolean; wiggleCurve: WiggleCurveKey; wiggleWiggles: WiggleParams["wiggles"]; wiggleDamping: WiggleParams["damping"]; wiggleValue: string; wigglePoints: Point[]; wiggleIsCustom: boolean; overshootStyle: OvershootParams["style"]; overshootCurve: OvershootCurveKey; overshootMass: OvershootParams["mass"]; overshootDamping: OvershootParams["damping"]; overshootValue: string; overshootPoints: Point[]; overshootIsCustom: boolean; previewDuration: number; previewPlayMode: PreviewPlayModeKey; previewAnimationType: AnimationTypeKey; previewShowLinear: boolean; editorExtraSpaceTop: boolean; editorExtraSpaceBottom: boolean; editorAccuracy: LinearEasingAccuracyKey; foundEasterEgg: boolean; };