Skip to content
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

Adding typescript to the project #401

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

linspw
Copy link

@linspw linspw commented Jan 29, 2024

Hello everything is fine?

I would like to thank you for the library, it is fantastic!

My suggestion with this PR is to contribute to improving the typing in the project

I thank the attention

This closes:
#294

OBS:
[X] All tests passed
[X] Build process working fine
[X] Exporting types

image

Type autocomplete
image

@@ -1,6 +1,6 @@
{
"name": "vue-draggable-resizable",
"version": "3.0.0-beta.2",
"version": "3.0.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating current version

parseInt(rect.width),
parseInt(rect.height)
// @ts-ignore
parseInt(rect.width, 10),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe parseInt is not necessary

Comment on lines +326 to +348
bounds: {
minLeft: null,
maxLeft: null,
minRight: null,
maxRight: null,
minTop: null,
maxTop: null,
minBottom: null,
maxBottom: null,
},

mouseClickPosition: {
mouseX: 0,
mouseY: 0,
x: 0,
y: 0,
w: 0,
h: 0,
left: 0,
bottom: 0,
top: 0,
right: 0,
},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding default values


let eventsFor = events.mouse;

interface State {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating typing interface

Comment on lines -29 to -30
parseFloat(style.getPropertyValue('width'), 10),
parseFloat(style.getPropertyValue('height'), 10)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10: Not necessary

@linspw
Copy link
Author

linspw commented Feb 7, 2024

Do you think @mauricius that PR makes sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant