mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 14:07:40 +00:00
* [d3-collection] Linted * Added and completed linting * Replaced `Object` with `any` adding TODO to change to proper `object` type when publishing the definitions to use TS 2.2+ * [d3-color] Linted * [d3-dispatch] Linted * [d3-hsv] Linted * [d3-interpolate] Linted. `Object` to `any` * Replace use of `Object` as extension basis with `any` for now. Added TODO to change it to use the `object` type, when updating the definitions to formally use TS2.2+ * [d3-path] Linted. * [d3-polygon] Linted. * [d3-quadtree] Linted. * [d3-queue] Linted. * [d3-request] Linted. * [d3-scale-chromatic] Linted. * [d3-time-format] Linted. * [d3-time] Linted. * [d3-timer] Linted. * [d3-voronoi] Linted. * [d3-scale] Move callable-type lint deactivation to tslint.json * line level deactivation was ignored.
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
/**
|
|
* Typescript definition tests for d3/d3-path module
|
|
*
|
|
* Note: These tests are intended to test the definitions only
|
|
* in the sense of typing and call signature consistency. They
|
|
* are not intended as functional tests.
|
|
*/
|
|
|
|
import * as d3Path from 'd3-path';
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
// Test create new path serializer
|
|
// -----------------------------------------------------------------------------------------
|
|
|
|
let context: d3Path.Path = d3Path.path();
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
// Test path serializer methods
|
|
// -----------------------------------------------------------------------------------------
|
|
|
|
context.moveTo(50, 50);
|
|
|
|
context.lineTo(100, 100);
|
|
|
|
context.quadraticCurveTo(150, 200, 200, 100);
|
|
|
|
context.bezierCurveTo(300, 50, 400, 200, 500, 100);
|
|
|
|
context.arcTo(250, 250, 300, 300, 60);
|
|
|
|
context.arc(400, 400, 50, 0, Math.PI / 2);
|
|
context.arc(400, 400, 50, 0, Math.PI / 2, true);
|
|
|
|
context.rect(60, 60, 100, 200);
|
|
|
|
context.closePath();
|
|
|
|
let pathString: string = context.toString();
|