Motivation
The PhotoViewer refactor (#7, PR #13) produced a set of well-scoped hooks in src/hooks/photo-viewer/, but none are exported.
Consumers who want a custom viewer UI with the same zoom/gesture behavior currently have to reimplement them.
Proposed change
Export a curated subset from src/index.ts, the ones that are generally reusable:
useTransform
useWheelZoom
useTouchGestures
useKeyboardShortcuts
Deliberately keep the viewer-internal glue private (useImageNavigation, useImagePreloader, useMouseDrag, useClickOutsideToClose, usePhotoViewerSettings) to preserve refactoring freedom; they can graduate later if there is demand.
Each exported hook gets:
- TSDoc comments on the hook and its options/return types.
- A "Hooks" section in the README with a minimal custom-viewer example.
- Type exports for their option/return shapes.
Best done after component/hook tests exist, so the exported behavior is locked in before it becomes public API.
Acceptance criteria
Compatibility
Purely additive API.
Existing exports unchanged.
Motivation
The PhotoViewer refactor (#7, PR #13) produced a set of well-scoped hooks in
src/hooks/photo-viewer/, but none are exported.Consumers who want a custom viewer UI with the same zoom/gesture behavior currently have to reimplement them.
Proposed change
Export a curated subset from
src/index.ts, the ones that are generally reusable:useTransformuseWheelZoomuseTouchGesturesuseKeyboardShortcutsDeliberately keep the viewer-internal glue private (
useImageNavigation,useImagePreloader,useMouseDrag,useClickOutsideToClose,usePhotoViewerSettings) to preserve refactoring freedom; they can graduate later if there is demand.Each exported hook gets:
Best done after component/hook tests exist, so the exported behavior is locked in before it becomes public API.
Acceptance criteria
Compatibility
Purely additive API.
Existing exports unchanged.