From abf7b9a67fa22b64d14a96fff71654e2352aa4e6 Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 13 Dec 2025 23:38:13 +0100 Subject: [PATCH] fix: Resolve TypeScript build errors in PatternCanvas and imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix PenData import to use correct source (types/machine instead of penParser) - Add explicit return type annotations for map callbacks in PatternCanvas - Add parentheses around arrow function parameters to satisfy linter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/components/PatternCanvas.tsx | 8 ++++---- src/utils/patternConverterClient.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/PatternCanvas.tsx b/src/components/PatternCanvas.tsx index c9ab905..c7cdbdb 100644 --- a/src/components/PatternCanvas.tsx +++ b/src/components/PatternCanvas.tsx @@ -292,11 +292,11 @@ export function PatternCanvas() { }} > { + stitches={pesData.penStitches.stitches.map((s, i): [number, number, number, number] => { // Convert PEN stitch format {x, y, flags, isJump} to PES format [x, y, cmd, colorIndex] const cmd = s.isJump ? 0x10 : 0; // MOVE flag if jump const colorIndex = pesData.penStitches.colorBlocks.find( - b => i >= b.startStitch && i <= b.endStitch + (b) => i >= b.startStitch && i <= b.endStitch )?.colorIndex ?? 0; return [s.x, s.y, cmd, colorIndex]; })} @@ -315,10 +315,10 @@ export function PatternCanvas() { { + stitches={pesData.penStitches.stitches.map((s, i): [number, number, number, number] => { const cmd = s.isJump ? 0x10 : 0; const colorIndex = pesData.penStitches.colorBlocks.find( - b => i >= b.startStitch && i <= b.endStitch + (b) => i >= b.startStitch && i <= b.endStitch )?.colorIndex ?? 0; return [s.x, s.y, cmd, colorIndex]; })} diff --git a/src/utils/patternConverterClient.ts b/src/utils/patternConverterClient.ts index 30496c8..2ac46ec 100644 --- a/src/utils/patternConverterClient.ts +++ b/src/utils/patternConverterClient.ts @@ -1,6 +1,7 @@ import type { WorkerMessage, WorkerResponse } from '../workers/patternConverter.worker'; import PatternConverterWorker from '../workers/patternConverter.worker?worker'; -import { parsePenData, type PenData } from './penParser'; +import { parsePenData } from './penParser'; +import type { PenData } from '../types/machine'; export type PyodideState = 'not_loaded' | 'loading' | 'ready' | 'error';