Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.15 KB

INSTRUCTIONS.md

File metadata and controls

26 lines (20 loc) · 1.15 KB

TypeScript Types Declaration Build Instructions

  1. Remove all @extends commands from /src and /extras
  2. Run npm run types

In output code types.d.ts do:

  1. Remove all Two.* references — e.g: Two.Vector -> Vector
  2. Remove all typeof references except for static properties of Two — e.g: Two.Group
  3. Remove all '.js' import references
  4. Change "src/two" to two.js
  5. Change all "src/ references to "two.js/src/
  6. Change all "extras/" references to "two.js/extras/
  7. Fix all constructor methods to have proper argument ingestion
  • Includes: Two.Rectangle, Two.Circle, Two.Ellipse, Two.Line, and Two.Polygon
  1. Fix private property assignment on Two.Group. e.g: _stroke -> stroke
  • Includes Two.Text
  1. Add optional overloaded functions to Two.makeCurve and Two.makePath for closed attribute
  • And other functions with ... argument syntax

Things to do to improve TypeScript Types:

  1. Add default values to all methods (including constructors) to clarify what is mandatory and what is optional.
  2. Figure out how to handle both ingestion of single argument Array's and full arguments as arrays.