Skip to content

Add type definitions#23

Open
JonathanXDR wants to merge 1 commit into
Advanon:masterfrom
JonathanXDR:add-typescript-definitions
Open

Add type definitions#23
JonathanXDR wants to merge 1 commit into
Advanon:masterfrom
JonathanXDR:add-typescript-definitions

Conversation

@JonathanXDR
Copy link
Copy Markdown

@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