qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
823 stars 266 forks source link

Add TypeScript File for Improved Type Safety #1235

Closed tomashlavac closed 2 months ago

tomashlavac commented 4 months ago

This pull request introduces a new TypeScript file to enhance the type safety of this project. TypeScript offers static typing, enabling early detection of potential bugs and improved developer productivity. The new file includes type definitions for all functions, ensuring better code maintainability and readability.

All types are based on documentation from qz.io/api/ and manually rewritten to TS. Feel free to code review and leave comments.

Cheers

tresf commented 4 months ago

Thanks! We've been asked for this is the past, but we have no interest in maintaining such a file. For that reason we've chosen to mark such requests as wontfix. At one point we attempted to automatically convert the JSDoc to a typescript definition file and were unsuccessful in doing so. We may change our stance on this in the future if we can find a way to automate it.

tresf commented 4 months ago

Sorry, I did not mean to close this prior to conversation. 😅

tomashlavac commented 4 months ago

Hi @tresf ,

thank you for your prompt response. I genuinely appreciate your concern regarding this matter.

Given the circumstances, I will take the necessary steps to address the issue by contributing the TypeScript file to the DefinitelyTyped repository.

tresf commented 4 months ago

Hi @tresf ,

thank you for your prompt response. I genuinely appreciate your concern regarding this matter.

Given the circumstances, I will take the necessary steps to address the issue by contributing the TypeScript file to the DefinitelyTyped repository.

Thank you. I will leave this open until the PR has been merged there.

tomashlavac commented 4 months ago

I have created pull request in DefinitelyTyped repository

tomashlavac commented 4 months ago

🎉 Great news! This pull request has been merged into the master branch of DefinitelyTyped. Now you can easily install types for qz-tray by running npm install --save-dev @types/qz-tray 🎉

tresf commented 2 months ago

Closing in favor of the DefinitelyTyped project contribution (thanks!)