UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

36 lines (35 loc) 924 B
interface EyeDropperResult { sRGBHex: string; } interface EyeDropper { open: (options?: { signal?: AbortSignal; }) => Promise<EyeDropperResult>; } declare global { interface Window { EyeDropper?: { new (): EyeDropper; }; } } interface UseEyeDropperOptions { onError?: (error: Error) => void; } interface UseEyeDropperReturn { isSupported: boolean; sRGBHex: string | null; open: () => Promise<void>; error: Error | null; } /** * Hook to use the experimental EyeDropper API. * * Allows users to sample colors from their screen. * Note: This API is experimental and browser support is limited. * * @param {UseEyeDropperOptions} [options] Configuration options. * @returns {UseEyeDropperReturn} Object with EyeDropper state and controls. */ export declare function useEyeDropper(options?: UseEyeDropperOptions): UseEyeDropperReturn; export {};