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 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonathanXDR
Copy link

@JonathanXDR JonathanXDR commented Dec 19, 2024

Fixes #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.

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 changed the title Add TypeScript type definitions with detailed comments 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 this pull request may close these issues.

Add type definitions
1 participant