Skip to content

Adding typescript to the project#401

Open
linspw wants to merge 2 commits intomauricius:mainfrom
linspw:main
Open

Adding typescript to the project#401
linspw wants to merge 2 commits intomauricius:mainfrom
linspw:main

Conversation

@linspw
Copy link
Copy Markdown

@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

Comment thread package.json
{
"name": "vue-draggable-resizable",
"version": "3.0.0-beta.2",
"version": "3.0.0",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updating current version

Comment thread src/utils/fns.ts
parseInt(rect.width),
parseInt(rect.height)
// @ts-ignore
parseInt(rect.width, 10),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread src/utils/dom.ts
Comment on lines -29 to -30
parseFloat(style.getPropertyValue('width'), 10),
parseFloat(style.getPropertyValue('height'), 10)
Copy link
Copy Markdown
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
Copy Markdown
Author

linspw commented Feb 7, 2024

Do you think @mauricius that PR makes sense?

@stefancodebeez
Copy link
Copy Markdown

@mauricius it would be great to add TS support to the project!

@n0099
Copy link
Copy Markdown

n0099 commented May 21, 2025

LGTM

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.

3 participants