import type { TorchError } from './types'; /** * Hook configuration type - allows passing callbacks */ interface UseTorchOptions { /** * Called when the torch state changes (true = on, false = off) * Callback is called only when the value actually changes, not on every on()/off() call */ onStateChanged?: (state: boolean) => void; /** * Called when an error occurs (e.g. missing permissions, no flash, etc.) */ onError?: (error: TorchError) => void; /** * Called when the torch level changes * Callback is called only when the value actually changes, not on every setLevel() call */ onLevelChanged?: (level: number | null) => void; } /** * React hook for controlling the native torch through Nitro Module. * * @example * const { isOn, on, off } = useTorch({ * onTorchStateChanged: (state) => console.log('Torch:', state), * onError: (error) => console.error('Torch error:', error) * }) */ export declare function useTorch(options?: UseTorchOptions): { on: () => Promise; off: () => Promise; toggle: () => Promise; setLevel: (level: number) => Promise; getMaxLevel: (dynamic?: boolean) => number | null; }; export {};