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

Add type definitions #22

Open
JonathanXDR opened this issue Dec 18, 2024 · 0 comments · May be fixed by #23
Open

Add type definitions #22

JonathanXDR opened this issue Dec 18, 2024 · 0 comments · May be fixed by #23

Comments

@JonathanXDR
Copy link

JonathanXDR commented Dec 18, 2024

The package currently lacks type definitions, which makes it challenging to use in TypeScript projects without relying on custom typings or any types. It would be beneficial to include those type definitions either within the package itself or by providing a separate @types/pdf-signatures package. This enhancement would improve developer experience and integration in TypeScript environments.

JonathanXDR added a commit to JonathanXDR/pdf-signatures that referenced this issue Dec 19, 2024
Fixes Advanon#22

Add TypeScript type definitions to the `pdf-signatures` package.

* **Add `src/main/js/index.d.ts` file:**
  - Define TypeScript types for `addSignaturePlaceholderToPdf`, `pdfDigest`, `signPdf`, and `addLtvToPdf` functions.
  - Define TypeScript types for `CertificationLevels` and `HashAlgorithms` enums.
  - Add JSDoc comments to the type definitions for better documentation.
  - Add detailed comments for each function and interface to provide better context and usage examples.
  - Add interfaces for the return types of the functions for better type safety.
  - Create separate interfaces for different types of errors that can be thrown by the functions, such as `PdfSignaturesError`.

* **Update `package.json`:**
  - Add `types` field pointing to `src/main/js/index.d.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Advanon/pdf-signatures/issues/22?shareId=XXXX-XXXX-XXXX-XXXX).
@JonathanXDR JonathanXDR linked a pull request Dec 19, 2024 that will close this issue
@JonathanXDR JonathanXDR changed the title Add TypeScript Type Definitions Add type definitions Dec 19, 2024
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 a pull request may close this issue.

1 participant