From c5063ebc9c3795b9a129b6f2e942f7c820ad50c4 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sun, 19 Jul 2015 19:07:08 -0700 Subject: [PATCH 1/2] update for Maker.js 0.2.3 --- maker.js/makerjs-tests.ts | 3 ++- maker.js/makerjs.d.ts | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts index 33869213d..f42307f2c 100644 --- a/maker.js/makerjs-tests.ts +++ b/maker.js/makerjs-tests.ts @@ -75,7 +75,8 @@ function test() { ]; } - function testPath() { + function testPath() { + makerjs.path.breakAtPoint(paths.arc, [0,0]).type; makerjs.path.intersection(paths.circle, paths.arc).intersectionPoints; makerjs.path.mirror(paths.arc, true, true); makerjs.path.moveRelative(paths.circle, [0,0]); diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index acea3405b..4afdb455d 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Microsoft/maker.js // Definitions by: Dan Marshall // Definitions: https://github.com/borisyankov/DefinitelyTyped + /** * Root module for Maker.js. * @@ -94,10 +95,6 @@ declare module MakerJs { * The main point of reference for this path. */ origin: IPoint; - /** - * Optional CSS style properties to be emitted into SVG. Useful for creating guidelines and debugging your model. - */ - cssStyle?: string; } /** * Test to see if an object implements the required properties of a path. @@ -425,6 +422,17 @@ declare module MakerJs.path { */ function scale(pathToScale: IPath, scaleValue: number): IPath; } +declare module MakerJs.path { + /** + * Breaks a path in two. The supplied path will end at the supplied pointOfBreak, + * a new path is returned which begins at the pointOfBreak and ends at the supplied path's initial end point. + * For Circle, the original path will be converted in place to an Arc, and null is returned. + * + * @param pathToBreak The path to break. + * @param pointOfBreak The point at which to break the path. + */ + function breakAtPoint(pathToBreak: IPath, pointOfBreak: IPoint): IPath; +} declare module MakerJs.paths { /** * Class for arc path. From 2ae5d73bec90ca4fad2fc2d2de2903ad074735e6 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sun, 19 Jul 2015 20:09:36 -0700 Subject: [PATCH 2/2] added @returns in jsdoc --- maker.js/makerjs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts index 4afdb455d..8e3eaf189 100644 --- a/maker.js/makerjs.d.ts +++ b/maker.js/makerjs.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/Microsoft/maker.js // Definitions by: Dan Marshall // Definitions: https://github.com/borisyankov/DefinitelyTyped - /** * Root module for Maker.js. * @@ -430,6 +429,7 @@ declare module MakerJs.path { * * @param pathToBreak The path to break. * @param pointOfBreak The point at which to break the path. + * @returns A new path of the same type, when path type is line or arc. Returns null for circle. */ function breakAtPoint(pathToBreak: IPath, pointOfBreak: IPoint): IPath; } @@ -669,7 +669,7 @@ declare module MakerJs.path { * * @param path1 First path to find intersection. * @param path2 Second path to find intersection. - * @result IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. + * @returns IPathIntersection object, with points(s) of intersection (and angles, when a path is an arc or circle); or null if the paths did not intersect. */ function intersection(path1: IPath, path2: IPath): IPathIntersection; }