respira/src/formats/import/constants.ts
Jan-Henrik Bruhn 11b710eb17 feature: Reorganize code into formats folder structure
Moved embroidery format-related code from utils to new formats folder:

Structure:
- src/formats/pen/ - PEN format encoding and parsing
  - encoder.ts (was utils/penEncoder.ts)
  - encoder.test.ts (was utils/penEncoder.test.ts)
  - parser.ts (was utils/penParser.ts)
  - PEN constants moved inline to encoder.ts

- src/formats/import/ - Pattern import/conversion (currently PES)
  - worker.ts (was workers/patternConverter.worker.ts)
  - client.ts (was utils/patternConverterClient.ts)
  - pesImporter.ts (was utils/pystitchConverter.ts)
  - pyodideLoader.ts (was utils/pyodideLoader.ts)
  - constants.ts (PyStitch/pyembroidery constants)

Benefits:
- Better separation of concerns
- PEN encoder is co-located with PEN parser
- Import logic is in one place and extensible for other formats
- Removed utils/embroideryConstants.ts - split into appropriate locations
- Updated all 18 import references across the codebase

All tests passing, build successful.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 12:19:21 +01:00

17 lines
817 B
TypeScript

/**
* Embroidery command constants
* These are bitmask flags used to identify stitch types in parsed embroidery files
*
* Note: PyStitch may use sequential values (0, 1, 2, etc.) internally,
* but pyembroidery (which PyStitch is based on) uses these bitmask values
* for compatibility with the embroidery format specifications.
*/
// Stitch type flags (bitmasks - can be combined)
export const STITCH = 0x00; // Regular stitch (no flags)
export const MOVE = 0x10; // Jump/move stitch (move without stitching)
export const JUMP = MOVE; // Alias: JUMP is the same as MOVE
export const TRIM = 0x20; // Trim thread command
export const COLOR_CHANGE = 0x40; // Color change command
export const STOP = 0x80; // Stop command
export const END = 0x100; // End of pattern