From b6570d7a034739fde6d3e1e58649a0cdc5490fa2 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Thu, 28 May 2026 16:11:53 +0300 Subject: [PATCH] test(canvas): share oracle pixel image type --- scripts/analyze-pattern-oracle.ts | 6 +----- scripts/analyze-text-decoration-oracle.ts | 6 +----- scripts/pixel-image.ts | 5 +++++ 3 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 scripts/pixel-image.ts diff --git a/scripts/analyze-pattern-oracle.ts b/scripts/analyze-pattern-oracle.ts index 63c83dadb..bf09908a9 100644 --- a/scripts/analyze-pattern-oracle.ts +++ b/scripts/analyze-pattern-oracle.ts @@ -4,11 +4,7 @@ import { parseArgs } from 'node:util' import { initCanvasKit } from '@open-pencil/core/io' -interface PixelImage { - width: number - height: number - pixels: Uint8Array -} +import type { PixelImage } from './pixel-image' interface Component { count: number diff --git a/scripts/analyze-text-decoration-oracle.ts b/scripts/analyze-text-decoration-oracle.ts index 654ac0a34..e8e333459 100644 --- a/scripts/analyze-text-decoration-oracle.ts +++ b/scripts/analyze-text-decoration-oracle.ts @@ -4,11 +4,7 @@ import { parseArgs } from 'node:util' import { initCanvasKit } from '@open-pencil/core/io' -interface PixelImage { - width: number - height: number - pixels: Uint8Array -} +import type { PixelImage } from './pixel-image' interface ChannelSummary { rows: Array<{ y: number; count: number; minX: number; maxX: number }> diff --git a/scripts/pixel-image.ts b/scripts/pixel-image.ts new file mode 100644 index 000000000..f5a785dba --- /dev/null +++ b/scripts/pixel-image.ts @@ -0,0 +1,5 @@ +export interface PixelImage { + width: number + height: number + pixels: Uint8Array +}