Skip to content

Commit

Permalink
Rename 'Type Aliases' in typec with just 'Types'
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed Feb 14, 2024
1 parent eb2447d commit 26796b2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ See the full documentation on [API](./api)
- [Circle](./api/modules/Circle): The functions for handling circles.
- [Line](./api/modules/Line): The functions for handling lines.
- [Rect](./api/modules/Rect): The functions for handling rects.
- [Type Aliases](./api#type-aliases)
- [Type Aliases](./api#types)

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion src/Circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {vec2} from 'linearly'

/**
* A circle represented as a tuple of a center and a radius.
* @category Type Aliases
* @category Types
*/
export type Circle = readonly [center: vec2, radius: number]

Expand Down
14 changes: 7 additions & 7 deletions src/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ paper.setup(document.createElement('canvas'))

/**
* Line-to command.
* @category Type Aliases
* @category Types
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#line_commands
*/
export type CommandL = readonly [code: 'L']

/**
* Cubic Bézier curve command.
* @category Type Aliases
* @category Types
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands
*/
export type CommandC = readonly [code: 'C', control1: vec2, control2: vec2]

/**
* Arc command
* @category Type Aliases
* @category Types
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#arcs
*/
export type CommandA = readonly [
Expand All @@ -51,19 +51,19 @@ export type CommandA = readonly [

/**
* A command of a path, which only supports line-to, cubic Bézier curve, and arc commands.
* @category Type Aliases
* @category Types
* */
export type Command = CommandL | CommandC | CommandA

/**
* A vertex of a path. It consists of a end point and a command.
* @category Type Aliases
* @category Types
*/
export type Vertex<C extends Command = Command> = {point: vec2; command: C}

/**
* A single open or closed path represented as an array of . All of the points are represented as tuple of vector `[x: number, y: number]` and the commands are represented in absolute form.
* @category Type Aliases
* @category Types
*/
export interface Curve<C extends Command = Command> {
vertices: Vertex<C>[]
Expand All @@ -72,7 +72,7 @@ export interface Curve<C extends Command = Command> {

/**
* A path that consists of multiple curves.
* @category Type Aliases
* @category Types
*/
export interface Path<C extends Command = Command> {
curves: Curve<C>[]
Expand Down
2 changes: 1 addition & 1 deletion src/Rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {vec2} from 'linearly'

/**
* A rect represented as a tuple of two diagonal points. The first point always must be always the minimum coordinates and the second point must be the maximum coordinates.
* @category Type Aliases
* @category Types
*/
export type Rect = readonly [min: vec2, max: vec2]

Expand Down
2 changes: 1 addition & 1 deletion src/Segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Command} from './Path'

/**
* A segment of a path, which consists of a starting point, end point, and an interpolation command.
* @category Type Aliases
* @category Types
*/
export interface Segment<C extends Command = Command> {
start: vec2
Expand Down
3 changes: 2 additions & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"Boolean Operations",
"Converters",
"Draw Functions",
"Utilities"
"Utilities",
"*"
]
}

0 comments on commit 26796b2

Please sign in to comment.