-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Introduce API to create graphics shapes
As a first step towards a more type-safe API, this commit introduces a set of functions to create graphics shapes. Using these functions helps to create shapes with less code and better tool support. One advantage of using these functions is that they return the correct type without having to specify it explicitly. For example, the following line of code ```ts let r1: Rect = { type: 'rect', x: 10, y: 10, width: 200, height: 50, fillColor: 'red' }; ``` can now be replaced with: ```ts let r1 = rect(10, 10, 200, 50, { fillColor: 'red' }); ```
- Loading branch information
Showing
2 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters