Skip to content

Commit

Permalink
refactor: Use explicty type for type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Undistraction committed Sep 22, 2024
1 parent e1a3e50 commit a04d616
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
5 changes: 2 additions & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ import {
} from './interpolate/curves/straight'
import interpolatePointOnCurveEvenlySpacedEasedFactory from './interpolate/pointOnCurve/interpolatePointOnCurveEvenlySpacedEasedFactory'
import interpolatePointOnCurveLinearEasedFactory from './interpolate/pointOnCurve/interpolatePointOnCurveLinearEasedFactory'
import {
import type {
BezierEasing,
BoundingCurves,
GridDefinition,
GridDefinitionWithDefaults,
InterpolateLineU,
InterpolateLineV,
InterpolatePointOnCurveFactory,
InterpolationStrategy,
LineStrategy,
WarpGrid,
} from './types'
import { InterpolationStrategy, LineStrategy } from './types'
import { isArray, isFunction, isNumber } from './utils/is'
import { processSteps } from './utils/steps'
import { validateBoundingCurves, validateGrid } from './validation'
Expand Down
2 changes: 1 addition & 1 deletion src/getGridApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import coonsPatch, { interpolatePointOnSurfaceBilinear } from 'coons-patch'
import memoize from 'fast-memoize'

import {
import type {
BoundingCurves,
GridApi,
InterpolateLineU,
Expand Down
6 changes: 5 additions & 1 deletion src/interpolate/curves/curved.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { interpolatePointOnSurfaceBilinear } from 'coons-patch'

import { BoundingCurves, Curve, InterpolatePointOnCurve } from '../../types'
import type {
BoundingCurves,
Curve,
InterpolatePointOnCurve,
} from '../../types'
import { fitCubicBezierToPoints } from '../../utils/bezier'
import { interpolateStraightLineU, interpolateStraightLineV } from './straight'

Expand Down
6 changes: 5 additions & 1 deletion src/interpolate/curves/straight.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { interpolatePointOnSurfaceBilinear } from 'coons-patch'

import { BoundingCurves, Curve, InterpolatePointOnCurve } from '../../types'
import type {
BoundingCurves,
Curve,
InterpolatePointOnCurve,
} from '../../types'

// -----------------------------------------------------------------------------
// Exports
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
BoundingCurves,
Curve,
InterpolatePointOnCurve,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bezier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import matrix from 'matrix-js'

import { Curve, Points } from '../types'
import type { Curve, Points } from '../types'
import { getBasisMatrix, getRatioMatrix } from './matrix'

// -----------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion src/utils/easing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import BezierEasing from 'bezier-easing'
import { Curve } from 'coons-patch'

import { BezierEasingParams, InterpolatePointOnCurveFactory } from '../types'
import type {
BezierEasingParams,
InterpolatePointOnCurveFactory,
} from '../types'

// -----------------------------------------------------------------------------
// Exports
Expand Down
2 changes: 1 addition & 1 deletion src/utils/functional.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// These are very general-purpose functions, so any is appropriate here.

import { ObjectWithStringKeys } from '../types'
import type { ObjectWithStringKeys } from '../types'

// -----------------------------------------------------------------------------
// Exports
Expand Down
2 changes: 1 addition & 1 deletion src/utils/steps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
ExpandedSteps,
Step,
Steps,
Expand Down
5 changes: 2 additions & 3 deletions src/validation.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {
import type {
BoundingCurves,
GridDefinitionWithDefaults,
InterpolatePointOnCurve,
InterpolationStrategy,
LineStrategy,
Point,
Steps,
UnprocessedSteps,
} from './types'
import { InterpolationStrategy, LineStrategy } from './types'
import { mapObj } from './utils/functional'
import {
isArray,
Expand Down

0 comments on commit a04d616

Please sign in to comment.