@tbib-image-viewer/react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,175 @@
1
+ import { GalleryItem, InteractionMode, SlideAnnotations, AnnotationStroke, DrawTool, NormalizedPoint, TransformState } from '@tbib-image-viewer/core';
2
+ export { AnnotationStroke, DrawTool, ExportOptions, GalleryItem, InteractionMode, SlideAnnotations, TransformState } from '@tbib-image-viewer/core';
3
+ import * as React$1 from 'react';
4
+ import React__default, { HTMLAttributes } from 'react';
5
+
6
+ interface ImageViewerProps {
7
+ /** Source image URL */
8
+ src: string;
9
+ alt?: string;
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ /** Theme: 'dark' (default Midnight Ocean) or 'light' (Warm Parchment) */
13
+ theme?: "dark" | "light";
14
+ /** Initial tool selected */
15
+ initialTool?: InteractionMode;
16
+ /** Initial stroke color */
17
+ initialColor?: string;
18
+ /** Initial stroke width */
19
+ initialStrokeWidth?: number;
20
+ /** Show top toolbar */
21
+ showToolbar?: boolean;
22
+ /** Allow hand-free drawings (pen, highlighter, eraser) */
23
+ enableAnnotations?: boolean;
24
+ /** Allow laser pointer mode */
25
+ enableLaser?: boolean;
26
+ /** Unique ID for storing strokes (defaults to src URL) */
27
+ slideId?: string;
28
+ /** Initial annotations */
29
+ initialAnnotations?: AnnotationStroke[];
30
+ /** Callback fired whenever annotations change */
31
+ onAnnotationsChange?: (strokes: AnnotationStroke[]) => void;
32
+ /** Custom children to render on top of viewer */
33
+ children?: React.ReactNode;
34
+ }
35
+ interface ImageGalleryLightboxProps {
36
+ /** Array of gallery images */
37
+ items: GalleryItem[];
38
+ /** Index of currently active slide (0-based) */
39
+ activeIndex?: number;
40
+ /** Whether the modal is open */
41
+ isOpen: boolean;
42
+ /** Called when the user closes the lightbox */
43
+ onClose: () => void;
44
+ /** Called when the active index changes */
45
+ onIndexChange?: (newIndex: number) => void;
46
+ /** Theme */
47
+ theme?: "dark" | "light";
48
+ /** Initial tool */
49
+ initialTool?: InteractionMode;
50
+ /** Initial color */
51
+ initialColor?: string;
52
+ /** Enable bottom thumbnail strip */
53
+ showThumbnails?: boolean;
54
+ /** Initial annotations for all slides */
55
+ initialAnnotations?: SlideAnnotations[];
56
+ /** Callback fired whenever any slide's annotations update */
57
+ onAnnotationsChange?: (slideId: string, strokes: AnnotationStroke[]) => void;
58
+ }
59
+
60
+ declare const ImageViewer: React__default.FC<ImageViewerProps>;
61
+
62
+ declare const ImageGalleryLightbox: React__default.FC<ImageGalleryLightboxProps>;
63
+
64
+ interface ImageToolbarProps {
65
+ activeTool: InteractionMode;
66
+ onToolChange: (tool: InteractionMode) => void;
67
+ color: string;
68
+ onColorChange: (color: string) => void;
69
+ strokeWidth: number;
70
+ onStrokeWidthChange: (width: number) => void;
71
+ canUndo: boolean;
72
+ canRedo: boolean;
73
+ onUndo: () => void;
74
+ onRedo: () => void;
75
+ onClear: () => void;
76
+ zoomScale: number;
77
+ onZoomIn: () => void;
78
+ onZoomOut: () => void;
79
+ onZoomReset: () => void;
80
+ onRotate: () => void;
81
+ onDownloadAnnotated: () => Promise<void>;
82
+ onDownloadClean: () => Promise<void>;
83
+ onExportJson?: () => void;
84
+ onClose?: () => void;
85
+ isFullscreen?: boolean;
86
+ onToggleFullscreen?: () => void;
87
+ currentIndex?: number;
88
+ totalImages?: number;
89
+ }
90
+ declare const ImageToolbar: React__default.FC<ImageToolbarProps>;
91
+
92
+ interface AnnotationCanvasProps {
93
+ width: number;
94
+ height: number;
95
+ strokes: AnnotationStroke[];
96
+ activeTool: DrawTool | "hand";
97
+ color: string;
98
+ strokeWidth: number;
99
+ onStrokeComplete: (stroke: AnnotationStroke) => void;
100
+ onEraseStroke: (point: NormalizedPoint) => void;
101
+ }
102
+ declare const AnnotationCanvas: React__default.FC<AnnotationCanvasProps>;
103
+
104
+ interface LaserCursorLayerProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
105
+ color?: string;
106
+ secondaryColor?: string;
107
+ trailLength?: number;
108
+ trailWidth?: number;
109
+ trailTaper?: number;
110
+ followSpeed?: number;
111
+ glowIntensity?: number;
112
+ glowSpread?: number;
113
+ hotspot?: number;
114
+ brightness?: number;
115
+ opacity?: number;
116
+ pulseSpeed?: number;
117
+ noiseStrength?: number;
118
+ idleFade?: boolean;
119
+ idleTimeout?: number;
120
+ fadeDuration?: number;
121
+ enabled?: boolean;
122
+ }
123
+ declare const LaserCursorLayer: React__default.FC<LaserCursorLayerProps>;
124
+
125
+ interface ColorPickerProps {
126
+ color: string;
127
+ onChange: (color: string) => void;
128
+ }
129
+ declare const ColorPicker: React__default.FC<ColorPickerProps>;
130
+
131
+ interface StrokeWidthPickerProps {
132
+ strokeWidth: number;
133
+ onChange: (width: number) => void;
134
+ }
135
+ declare const StrokeWidthPicker: React__default.FC<StrokeWidthPickerProps>;
136
+
137
+ interface DownloadMenuProps {
138
+ onDownloadAnnotated: () => Promise<void>;
139
+ onDownloadClean: () => Promise<void>;
140
+ onExportJson?: () => void;
141
+ }
142
+ declare const DownloadMenu: React__default.FC<DownloadMenuProps>;
143
+
144
+ interface ThumbnailStripProps {
145
+ items: GalleryItem[];
146
+ activeIndex: number;
147
+ onSelect: (index: number) => void;
148
+ }
149
+ declare const ThumbnailStrip: React__default.FC<ThumbnailStripProps>;
150
+
151
+ declare function useImageTransform(): {
152
+ transform: TransformState;
153
+ setTransform: React$1.Dispatch<React$1.SetStateAction<TransformState>>;
154
+ zoomIn: () => void;
155
+ zoomOut: () => void;
156
+ resetTransform: () => void;
157
+ rotateClockwise: () => void;
158
+ panBy: (dx: number, dy: number) => void;
159
+ handleWheel: (e: React.WheelEvent) => void;
160
+ handleTouchStart: (e: React.TouchEvent) => void;
161
+ handleTouchMove: (e: React.TouchEvent) => void;
162
+ handleTouchEnd: () => void;
163
+ };
164
+
165
+ interface SwipeHandlers {
166
+ onSwipeLeft: () => void;
167
+ onSwipeRight: () => void;
168
+ enabled?: boolean;
169
+ }
170
+ declare function useSwipeGesture({ onSwipeLeft, onSwipeRight, enabled }: SwipeHandlers): {
171
+ onTouchStart: (e: React.TouchEvent) => void;
172
+ onTouchEnd: (e: React.TouchEvent) => void;
173
+ };
174
+
175
+ export { AnnotationCanvas, type AnnotationCanvasProps, ColorPicker, type ColorPickerProps, DownloadMenu, type DownloadMenuProps, ImageGalleryLightbox, type ImageGalleryLightboxProps, ImageToolbar, type ImageToolbarProps, ImageViewer, type ImageViewerProps, LaserCursorLayer, type LaserCursorLayerProps, StrokeWidthPicker, type StrokeWidthPickerProps, type SwipeHandlers, ThumbnailStrip, type ThumbnailStripProps, useImageTransform, useSwipeGesture };