-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converts display package to typescript #6261
Conversation
Yes, DisplayObject is meant to be abstract, to separate properties of this element, and properties that depend on children. There're no classes that are DisplayObject but not Container. Originally in Flash there were SimpleButton's and TextFields, and it was hell. I think rule has to be "use DisplayObject if you don't care about children of element". Line 469 : type is DisplayObject. MaskData was introduced by me in 5.2.0, its for users who need more control on masks. |
I've got similar issue as the first one you mentioned but with Edit: And it appears a solution is to add the declare module to |
OK, I've started I think its time to figure out how to generate |
@ivanpopelyshev A temporary solution might be to add the following line to
I'll tag you in a conversation I had on slack. |
Ideally Runner provides typescript types so the import just works. |
…isplay-typescript
Codecov Report
@@ Coverage Diff @@
## dev #6261 +/- ##
==========================================
+ Coverage 76.74% 77.15% +0.41%
==========================================
Files 182 182
Lines 9497 9530 +33
==========================================
+ Hits 7288 7353 +65
+ Misses 2209 2177 -32
Continue to review full report at Codecov.
|
Don't worry about them. One is a simple bugfix (a bug that would be caught by TypeScript btw.), and the other is just something I wanted to get some input for before making it a serious PR (I'm unsure what implications my changes might have). Both are pretty easy to rebase on/rebase on this. I can do the latter. |
Defines a type for the cursor property of IHitArea in global.d.ts
Adds initialization in constructor for Bounds Makes containerUpdateTransform publicly accessible
All resolved, good job. |
@Zyie could you resolve these conflicts? I think we're ready to merge. |
I see problems with _updateID, gonna fix them for you, its my area of expertise anyway. Maybe I'll add a test. |
All sorted |
UPDATE!!
Now that #6311 has fixed the build issues this PR is ready to have its time to shine.
This PR converts the display package to typescript.
CHANGES:
DisplayObject
is now an abstract class.tempDisplayObjectParent
is now a new class calledTemporaryDisplayObject
. This simply extendsDisplayObject
as you cannot instantiate an abstract class.Renderer.js
ive added the systems used in display to bethis.SYSTEM
instead of being dynamically added. @ivanpopelyshev I've added a TODO as a note that this was hacked in since you are converting core.this.rect
fromBounds
as it was not being used._parentID
public inTransform
I've also seen that #6304 and ##6306 has made some changes to display. Not sure whats going to be the best way to navigate this.