useStatus.d.ts 369 B

12345678910111213
  1. type ImageStatus = 'normal' | 'error' | 'loading';
  2. export default function useStatus({ src, isCustomPlaceholder, fallback, }: {
  3. src: string;
  4. isCustomPlaceholder?: boolean;
  5. fallback?: string;
  6. }): readonly [(img?: HTMLImageElement) => void, {
  7. src: string;
  8. onLoad?: undefined;
  9. } | {
  10. onLoad: () => void;
  11. src: string;
  12. }, ImageStatus];
  13. export {};