Skip to content

Conversation

@Khandakar227
Copy link

What this PR does

  • Adds TypeScript declaration (index.d.ts) for the public API
  • Enables type safety and IntelliSense for TypeScript users
  • No runtime or breaking changes
  • Documentation fix

Why

Many Node.js projects use TypeScript. This PR improves developer experience without affecting existing JavaScript users.

Checklist

  • No breaking changes
  • Backward compatible
  • Tested with a TS project

Changes made

  • I created a comprehensive TypeScript declaration file that defines the SSLCommerzPayment class, its methods, and the data structures for initialization, validation, and refund operations. This ensures that users will get full autocompletion and type checking when using the package in a TypeScript project.
  • I added the "types": "index.d.ts" field to the package.json file so that TypeScript can automatically find and use the new type definitions.
  • I fixed several syntax errors in the JavaScript examples where string values were missing quotes. I also improved some descriptions for better clarity.
app.get('/validate', (req, res) => {
     const data = {
-        val_id:ADGAHHGDAKJ456454 //that you go from sslcommerz response
+        val_id: 'ADGAHHGDAKJ456454' //that you got from sslcommerz response
     };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant