-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(modeling): use modern typescript imports
- Loading branch information
Showing
697 changed files
with
1,881 additions
and
1,889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// global types | ||
declare type Geom2 = import('./src/geometries/geom2/type.d.ts').Geom2 | ||
declare type Geom3 = import('./src/geometries/geom3/type.d.ts').Geom3 | ||
declare type Path2 = import('./src/geometries/path2/type.d.ts').Path2 | ||
declare type Poly2 = import('./src/geometries/poly2/type.d.ts').Poly2 | ||
declare type Poly3 = import('./src/geometries/poly3/type.d.ts').Poly3 | ||
declare type Slice = import('./src/geometries/slice/type.d.ts').Slice | ||
|
||
declare type Line2 = import('./src/maths/line2/type.d.ts').Line2 | ||
declare type Line3 = import('./src/maths/line3/type.d.ts').Line3 | ||
declare type Mat4 = import('./src/maths/mat4/type.d.ts').Mat4 | ||
declare type Plane = import('./src/maths/plane/type.d.ts').Plane | ||
declare type Vec2 = import('./src/maths/vec2/type.d.ts').Vec2 | ||
declare type Vec3 = import('./src/maths/vec3/type.d.ts').Vec3 | ||
declare type Vec4 = import('./src/maths/vec4/type.d.ts').Vec4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { RGB } from './types' | ||
import type { RGB } from './types.d.ts' | ||
|
||
export function colorNameToRgb(s: string): RGB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { RGB, RGBA } from './types' | ||
import type { RGB, RGBA } from './types.d.ts' | ||
|
||
export function hexToRgb(hex: string): RGB | RGBA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
export { colorize } from './colorize' | ||
export { colorNameToRgb } from './colorNameToRgb' | ||
export * as cssColors from './cssColors' | ||
export { hexToRgb } from './hexToRgb' | ||
export { hslToRgb } from './hslToRgb' | ||
export { hsvToRgb } from './hsvToRgb' | ||
export { hueToColorComponent } from './hueToColorComponent' | ||
export { rgbToHex } from './rgbToHex' | ||
export { rgbToHsl } from './rgbToHsl' | ||
export { rgbToHsv } from './rgbToHsv' | ||
export { colorize } from './colorize.js' | ||
export { colorNameToRgb } from './colorNameToRgb.js' | ||
export * as cssColors from './cssColors.js' | ||
export { hexToRgb } from './hexToRgb.js' | ||
export { hslToRgb } from './hslToRgb.js' | ||
export { hsvToRgb } from './hsvToRgb.js' | ||
export { hueToColorComponent } from './hueToColorComponent.js' | ||
export { rgbToHex } from './rgbToHex.js' | ||
export { rgbToHsl } from './rgbToHsl.js' | ||
export { rgbToHsv } from './rgbToHsv.js' | ||
|
||
export * from './types' | ||
export as namespace colors | ||
export type * from './types.d.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { RGB, RGBA } from './types' | ||
import type { RGB, RGBA } from './types.d.ts' | ||
|
||
export function rgbToHex(rgb: RGB | RGBA): string | ||
export function rgbToHex(...rgb: RGB | RGBA): string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Bezier from './type' | ||
import type { Bezier } from './type.d.ts' | ||
|
||
export function create(points: Array<number> | Array<Array<number>>): Bezier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
export { create } from './create' | ||
export { tangentAt } from './tangentAt' | ||
export { valueAt } from './valueAt' | ||
export { lengths } from './lengths' | ||
export { length } from './length' | ||
export { arcLengthToT } from './arcLengthToT' | ||
export { create } from './create.js' | ||
export { tangentAt } from './tangentAt.js' | ||
export { valueAt } from './valueAt.js' | ||
export { lengths } from './lengths.js' | ||
export { length } from './length.js' | ||
export { arcLengthToT } from './arcLengthToT.js' | ||
|
||
export { Bezier } from './type' | ||
export as namespace bezier | ||
export type { Bezier } from './type.d.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Bezier from './type' | ||
import type { Bezier } from './type.d.ts' | ||
|
||
export function length(segments: number, bezier: Bezier): number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Bezier from './type' | ||
import type { Bezier } from './type.d.ts' | ||
|
||
export function lengths(segments: number, bezier: Bezier): Array<number> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Bezier from './type' | ||
import type { Bezier } from './type.d.ts' | ||
|
||
export function tangentAt(t: number, bezier: Bezier): Array<number> | number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
export default Bezier | ||
|
||
export interface Bezier { | ||
points: Array<number> | Array<Array<number>> | ||
pointType: string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Bezier from './type' | ||
import type { Bezier } from './type.d.ts' | ||
|
||
export function valueAt(t: number, bezier: Bezier): Array<number> | number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export * as bezier from './bezier' | ||
|
||
export as namespace curves | ||
export * as bezier from './bezier/index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { Geom2 } from './type' | ||
import type { Geom2 } from './type.d.ts' | ||
|
||
export function clone(geometry: Geom2): Geom2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* Performs a shallow clone of the given geometry. | ||
* @param {geom2} geometry - the geometry to clone | ||
* @returns {geom2} new geometry | ||
* @param {Geom2} geometry - the geometry to clone | ||
* @returns {Geom2} new geometry | ||
* @alias module:modeling/geometries/geom2.clone | ||
*/ | ||
export const clone = (geometry) => Object.assign({}, geometry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Geom2 } from './type' | ||
import { Vec2 } from '../../maths/vec2/type' | ||
import type { Geom2 } from './type.d.ts' | ||
import type { Vec2 } from '../../maths/vec2/type.d.ts' | ||
|
||
export function create(outlines?: Array<Array<Vec2>>): Geom2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { Geom2 } from './type' | ||
import type { Geom2 } from './type.d.ts' | ||
|
||
export function fromCompactBinary(data: Array<number> | Float32Array | Float64Array): Geom2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Geom2 } from './type' | ||
import { Vec2 } from '../../maths/vec2/type' | ||
import type { Geom2 } from './type.d.ts' | ||
import type { Vec2 } from '../../maths/vec2/type.d.ts' | ||
|
||
export function fromSides(sides: Array<[Vec2, Vec2]>): Geom2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.