respira/src/formats/import
Jan-Henrik Bruhn ba380723c0 feature: Refactor PEN parser to decoder with coherent types
Renamed and restructured PEN parsing to match encoder pattern:

Changes:
- Renamed pen/parser.ts → pen/decoder.ts (consistent with encoder.ts)
- Created pen/types.ts for PEN-specific type definitions
- Moved types out of machine.ts (they're format-specific, not machine-specific)
- Unified decoder with encoder test helpers (encoder.test.ts now uses decoder)

New structure:
- decodePenStitch() - decode single 4-byte stitch
- decodeAllPenStitches() - decode all stitches from bytes
- decodePenData() - full decode with color blocks and bounds
- getStitchColor() - helper to get color for a stitch index

Type definitions:
- DecodedPenStitch - individual stitch with coordinates and flags
- PenColorBlock - color block (stitch range for one thread)
- DecodedPenData - complete decoded pattern data

Backward compatibility:
- Added compatibility aliases (isJump, flags, startStitch, endStitch)
- Maintains API compatibility with existing UI code

Also added dist-electron to eslint ignore list.

All tests passing (27/27), build successful, lint clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 12:27:24 +01:00
..
client.ts feature: Refactor PEN parser to decoder with coherent types 2025-12-14 12:27:24 +01:00
constants.ts feature: Reorganize code into formats folder structure 2025-12-14 12:19:21 +01:00
pesImporter.ts feature: Reorganize code into formats folder structure 2025-12-14 12:19:21 +01:00
pyodideLoader.ts feature: Reorganize code into formats folder structure 2025-12-14 12:19:21 +01:00
worker.ts feature: Reorganize code into formats folder structure 2025-12-14 12:19:21 +01:00