Skip to content

Commit

Permalink
- Docs: Use jsdoc modules
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed May 5, 2019
1 parent d7dce27 commit b6bd40e
Show file tree
Hide file tree
Showing 10 changed files with 842 additions and 745 deletions.
510 changes: 263 additions & 247 deletions dist/index-esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index-esm.min.js.map

Large diffs are not rendered by default.

510 changes: 263 additions & 247 deletions dist/index-umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index-umd.min.js.map

Large diffs are not rendered by default.

61 changes: 59 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,66 @@
/**
* @module kld-intersections
*/
// expose module classes

export {default as Intersection} from "./lib/Intersection.js";

export {default as IntersectionArgs} from "./lib/IntersectionArgs.js";

/**
* @namespace Shapes
* @implements {module:Shapes~Shapes}
*/
export {default as Shapes} from "./lib/Shapes.js";

/**
* @namespace AffineShapes
* @implements {module:AffineShapes~AffineShapes}
*/
export {default as AffineShapes} from "./lib/AffineShapes.js";

/**
* @namespace IntersectionQuery
* @implements {module:IntersectionQuery~IntersectionQuery}
*/
export {default as IntersectionQuery} from "./lib/IntersectionQuery.js";

// expose affine module classes
export {Point2D, Vector2D, Matrix2D} from "kld-affine";
// Expose affine module classes

/**
* @external Point2D
*/

/**
* @external Vector2D
*/

/**
* @external Matrix2D
*/

/**
* @class Point2D
* @memberof module:kld-intersections
* @implements {external:Point2D}
*/
export {Point2D} from "kld-affine";

/**
* @class Vector2D
* @memberof module:kld-intersections
* @implements {external:Vector2D}
*/
export {Vector2D} from "kld-affine";

/**
* @class Matrix2D
* @memberof module:kld-intersections
* @implements {external:Matrix2D}
*/
export {Matrix2D} from "kld-affine";


/**
* @external Polynomial
*/
55 changes: 29 additions & 26 deletions lib/AffineShapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
* AffineShapes
*
* @copyright 2017, Kevin Lindsey
* @module AffineShapes
*/

import IntersectionArgs from "./IntersectionArgs.js";

/**
* @namespace
*/
const AffineShapes = {};

/**
* quadraticBezier
*
* @param {Point2D} p1
* @param {Point2D} p2
* @param {Point2D} p3
* @returns {IntersectionArgs}
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @param {module:kld-intersections.Point2D} p3
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.quadraticBezier = function(p1, p2, p3) {
return new IntersectionArgs("Bezier2", [p1, p2, p3]);
Expand All @@ -24,11 +27,11 @@ AffineShapes.quadraticBezier = function(p1, p2, p3) {
/**
* cubicBezier
*
* @param {Point2D} p1
* @param {Point2D} p2
* @param {Point2D} p3
* @param {Point2D} p4
* @returns {IntersectionArgs}
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @param {module:kld-intersections.Point2D} p3
* @param {module:kld-intersections.Point2D} p4
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.cubicBezier = function(p1, p2, p3, p4) {
return new IntersectionArgs("Bezier3", [p1, p2, p3, p4]);
Expand All @@ -38,9 +41,9 @@ AffineShapes.cubicBezier = function(p1, p2, p3, p4) {
/**
* circle
*
* @param {Point2D} center
* @param {module:kld-intersections.Point2D} center
* @param {number} radius
* @returns {IntersectionArgs}
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.circle = function(center, radius) {
return new IntersectionArgs("Circle", [center, radius]);
Expand All @@ -50,10 +53,10 @@ AffineShapes.circle = function(center, radius) {
/**
* ellipse
*
* @param {Point2D} center
* @param {module:kld-intersections.Point2D} center
* @param {number} radiusX
* @param {number} radiusY
* @returns {IntersectionArgs}
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.ellipse = function(center, radiusX, radiusY) {
return new IntersectionArgs("Ellipse", [center, radiusX, radiusY]);
Expand All @@ -63,9 +66,9 @@ AffineShapes.ellipse = function(center, radiusX, radiusY) {
/**
* line
*
* @param {Point2D} p1
* @param {Point2D} p2
* @returns {IntersectionArgs}
* @param {module:kld-intersections.Point2D} p1
* @param {module:kld-intersections.Point2D} p2
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.line = function(p1, p2) {
return new IntersectionArgs("Line", [p1, p2]);
Expand All @@ -75,8 +78,8 @@ AffineShapes.line = function(p1, p2) {
/**
* path
*
* @param {Array<AffineShapes>} segments
* @returns {IntersectionArgs}
* @param {Array<module:kld-intersections.AffineShapes>} segments
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.path = function(segments) {
return new IntersectionArgs("Path", [segments]);
Expand All @@ -86,8 +89,8 @@ AffineShapes.path = function(segments) {
/**
* polygon
*
* @param {Array<Point2D>} points
* @returns {IntersectionArgs}
* @param {Array<module:kld-intersections.Point2D>} points
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.polygon = function(points) {
return new IntersectionArgs("Polygon", [points]);
Expand All @@ -97,8 +100,8 @@ AffineShapes.polygon = function(points) {
/**
* polyline
*
* @param {Array<Point2D>} points
* @returns {IntersectionArgs}
* @param {Array<module:kld-intersections.Point2D>} points
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.polyline = function(points) {
return new IntersectionArgs("Polyline", [points]);
Expand All @@ -108,9 +111,9 @@ AffineShapes.polyline = function(points) {
/**
* rectangle
*
* @param {Point2D} topLeft
* @param {Vector2D} size
* @returns {IntersectionArgs}
* @param {module:kld-intersections.Point2D} topLeft
* @param {module:kld-intersections.Vector2D} size
* @returns {module:kld-intersections.IntersectionArgs}
*/
AffineShapes.rectangle = function(topLeft, size) {
return new IntersectionArgs("Rectangle", [topLeft, topLeft.add(size)]);
Expand Down
Loading

0 comments on commit b6bd40e

Please sign in to comment.