import React from 'react'; import { Object3DNode } from '@react-three/fiber'; import { ImageAnchorGroup as ImageAnchorGroupImpl, ImageTracker as ImageTrackerImpl, Pipeline, ImageAnchor, Camera } from '@zappar/zappar-threejs'; import { ForwardRefComponent } from '../util/utils.js'; declare module '@react-three/fiber' { interface ThreeElements { imageAnchorGroupImpl: Object3DNode; } } export type AnchorVisibilityEvent = (anchor: T) => void; export interface ImageTrackerProps extends Omit { /** Target image to track */ targetImage: string; /** A reference to a Zappar camera. */ camera?: React.RefObject; /** * A callback to get the tracker * @returns a callback containing the tracker. */ useImageTracker?: (imageTracker: ImageTrackerImpl) => void; /** The pipeline that this component will operate within. */ pipeline?: Pipeline; /** Disables tracking if set to `false`. Default is `true`. */ enabled?: boolean; /** * Emitted when the anchor becomes visible in a camera frame. */ onVisible?: AnchorVisibilityEvent; /** * Emitted when the anchor goes from being visible in the previous camera frame, to not being visible in the current frame. */ onNotVisible?: AnchorVisibilityEvent; /** * Emitted when a new anchor is created by the tracker. */ onNewAnchor?: AnchorVisibilityEvent; } /** * A THREE.Group that attaches content to a known image as it moves around in the camera view. * @see https://docs.zap.works/universal-ar/web-libraries/react-threejs/image-tracking/ */ declare const ImageTracker: ForwardRefComponent; export default ImageTracker;