Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

feat(screenshot): add edits metadata types

Luis Ortiz8edb1cfb692e
diff --git a/src/core/guides/types.ts b/src/core/guides/types.ts
index 84d1711..15f9d76 100644
--- a/src/core/guides/types.ts
+++ b/src/core/guides/types.ts
@@ -1,3 +1,5 @@
+import type { ScreenshotEdits } from '@/core/screenshot/types';
+
export interface Guide {
id: string;
title: string;
@@ -37,6 +39,7 @@ export interface Screenshot {
height: number;
bounds?: ScreenshotBounds;
pixelRatio?: number;
+ edits?: ScreenshotEdits;
}
export interface Settings {
diff --git a/src/core/screenshot/types.ts b/src/core/screenshot/types.ts
new file mode 100644
index 0000000..28d1aac
--- /dev/null
+++ b/src/core/screenshot/types.ts
@@ -0,0 +1,15 @@
+import type { ScreenshotBounds } from '@/core/guides/types';
+
+export type Annotation =
+ | { id: string; type: 'box'; x: number; y: number; w: number; h: number; color: string }
+ | { id: string; type: 'arrow'; x1: number; y1: number; x2: number; y2: number; color: string }
+ | { id: string; type: 'text'; x: number; y: number; text: string; color: string; size: number }
+ | { id: string; type: 'freehand'; points: number[]; color: string }
+ | { id: string; type: 'redact'; x: number; y: number; w: number; h: number; style: 'blur' | 'solid' };
+
+export interface ScreenshotEdits {
+ viewport?: ScreenshotBounds;
+ target?: ScreenshotBounds | null;
+ annotations?: Annotation[];
+ alt?: string;
+}