- Updated function parameters and return types in `page-preview.ts`, `pdf-decrypt.ts`, and `pymupdf-loader.ts` for improved type safety.
- Introduced type definitions for `CpdfInstance`, `PyMuPDFInstance`, and other related types to ensure better type checking.
- Enhanced error handling in `sanitize.ts` by creating a utility function for error messages.
- Removed unnecessary type assertions and improved type inference in `editor.ts`, `serialization.ts`, and `tools.test.ts`.
- Added type definitions for markdown-it plugins to improve compatibility and type safety.
- Enforced stricter TypeScript settings by enabling `noImplicitAny` in `tsconfig.json`.
- Cleaned up test files by refining type assertions and ensuring consistency in type usage.
cropperjs ignores attempts to modify the data before ready. This change
migrates setup to a one-time 'ready' callback.
Steps:
1. Change the cropping bounds of page 1
2. Change to page 2
3. Change to page 1
4. Change to page 2
5. Download cropped PDF
Observed behavior:
* (3) shows the default (autocrop) bounds
* (5) results in a download without the set bounds
Expected behavior:
* (3) should restore the bounds already set
* (4) should not override the set bounds with the autocrop
Tested:
* Local builds using the docker dev config