headintheclouddev / typings-suitescript-2.0

TypeScript typings for SuiteScript version 2.0
MIT License
142 stars 89 forks source link

Added the export keyword in front of the IEmail interface #263

Closed emrekupcuoglu closed 5 months ago

emrekupcuoglu commented 6 months ago

I had problems using the EmailCapturePlugin so I have added the export keyword and imported it like this import { IEmail } from "@hitc/netsuite-types/EmailCapturePlugin"; This is my first pull request ever and I am fairly new to TypeScript, any feedback or guidance on best practices would be greatly appreciated. Thank you for creating this project!

MrRob commented 6 months ago

@emrekupcuoglu Can you share with me how you intend to use that interface as exported? I am just curious if it is necessary since the Email Capture plugins only work in SSV1.

Also, I think maybe your IDE may have automatically removed some spacing padding we had, if you could undo that change please.

Thanks!

emrekupcuoglu commented 6 months ago

@MrRob I used it with SSV1, but because all the type definitions were there and there is no alternative I know of for email capture, for that reason I assumed it was supposed to be exported. If it is preferable to export, I can add the padding. Additionally, I can adjust the folder structure to place it under plugins/v1/EmailCapturePlugin open to your suggestions on this.

Thanks!

MrRob commented 6 months ago

@emrekupcuoglu I think exporting the interface is fine if it truly helps, but please undo the spacing changes in your PR. In other words, I think line 22 is the only one that should change here. Thanks!

emrekupcuoglu commented 5 months ago

With newer TypeScript versions, configuring it to exclude the export keyword, such as the line Object.defineProperty(exports, "__esModule", { value: true });, has become challenging. Due to restrictions in SSV1, which disallows modification or usage of the export keyword in the script's context, the script fails.

I've made adjustments to address this issue, but it involves more effort than it's worth. Therefore, I've decided not to include this in the current changes. For future reference, if anyone needs this functionality, they can add the email capture plugin into their types.ts