refactor: auto ordered imports (#9163)
All checks were successful
Tests / test (push) Successful in 4m38s

This commit is contained in:
Marcel Mraz 2025-03-12 15:23:31 +01:00 committed by GitHub
parent 82b9a6b464
commit 21ffaf4d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
421 changed files with 3532 additions and 2763 deletions

View file

@ -1,3 +1,5 @@
import { PRECISION } from "./utils";
import type {
Degrees,
GlobalPoint,
@ -5,7 +7,6 @@ import type {
PolarCoords,
Radians,
} from "./types";
import { PRECISION } from "./utils";
// TODO: Simplify with modulo and fix for angles beyond 4*Math.PI and - 4*Math.PI
export const normalizeRadians = (angle: Radians): Radians => {

View file

@ -1,4 +1,5 @@
import "../utils/test-utils";
import {
curve,
curveClosestPoint,

View file

@ -1,7 +1,8 @@
import type { Bounds } from "../excalidraw/element/bounds";
import { isPoint, pointDistance, pointFrom } from "./point";
import { rectangle, rectangleIntersectLineSegment } from "./rectangle";
import type { Curve, GlobalPoint, LineSegment, LocalPoint } from "./types";
import type { Bounds } from "../excalidraw/element/bounds";
/**
*

View file

@ -8,6 +8,7 @@ import {
import { line } from "./line";
import { pointFrom } from "./point";
import { lineSegment } from "./segment";
import type { Ellipse, GlobalPoint } from "./types";
describe("point and ellipse", () => {

View file

@ -4,13 +4,6 @@ import {
pointFromVector,
pointsEqual,
} from "./point";
import type {
Ellipse,
GlobalPoint,
Line,
LineSegment,
LocalPoint,
} from "./types";
import { PRECISION } from "./utils";
import {
vector,
@ -20,6 +13,14 @@ import {
vectorScale,
} from "./vector";
import type {
Ellipse,
GlobalPoint,
Line,
LineSegment,
LocalPoint,
} from "./types";
/**
* Construct an Ellipse object from the parameters
*

View file

@ -1,4 +1,5 @@
import { pointFrom } from "./point";
import type { GlobalPoint, Line, LocalPoint } from "./types";
/**

View file

@ -1,4 +1,5 @@
import { pointFrom, pointRotateRads } from "./point";
import type { Radians } from "./types";
describe("rotate", () => {

View file

@ -1,4 +1,7 @@
import { degreesToRadians } from "./angle";
import { PRECISION } from "./utils";
import { vectorFromPoint, vectorScale } from "./vector";
import type {
LocalPoint,
GlobalPoint,
@ -6,8 +9,6 @@ import type {
Degrees,
Vector,
} from "./types";
import { PRECISION } from "./utils";
import { vectorFromPoint, vectorScale } from "./vector";
/**
* Create a properly typed Point instance from the X and Y coordinates.

View file

@ -1,8 +1,9 @@
import { pointsEqual } from "./point";
import { lineSegment, pointOnLineSegment } from "./segment";
import type { GlobalPoint, LocalPoint, Polygon } from "./types";
import { PRECISION } from "./utils";
import type { GlobalPoint, LocalPoint, Polygon } from "./types";
export function polygon<Point extends GlobalPoint | LocalPoint>(
...points: Point[]
) {

View file

@ -1,4 +1,5 @@
import { toBrandedType } from "@excalidraw/excalidraw/utils";
import type { InclusiveRange } from "./types";
/**

View file

@ -1,5 +1,6 @@
import { pointFrom } from "./point";
import { lineSegment, lineSegmentIntersectionPoints } from "./segment";
import type { GlobalPoint, LineSegment, LocalPoint, Rectangle } from "./types";
export function rectangle<P extends GlobalPoint | LocalPoint>(

View file

@ -5,7 +5,6 @@ import {
pointFromVector,
pointRotateRads,
} from "./point";
import type { GlobalPoint, LineSegment, LocalPoint, Radians } from "./types";
import { PRECISION } from "./utils";
import {
vectorAdd,
@ -15,6 +14,8 @@ import {
vectorSubtract,
} from "./vector";
import type { GlobalPoint, LineSegment, LocalPoint, Radians } from "./types";
/**
* Create a line segment from two points.
*