Skip to content

AI-native design editor. Open-source Figma alternative.

test(canvas): share oracle pixel image type

Danila Poyarkovb6570d7a0347
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
+}