react-photoswipe icon indicating copy to clipboard operation
react-photoswipe copied to clipboard

Typescript Typings

Open michelalbers opened this issue 6 years ago • 2 comments

It would be nice to have typescript typings for this. I wrote a first version of them here:

declare module 'react-photoswipe' {
  import * as React from 'react';
  export interface PhotoSwipeGalleryItem {
    src: string;
    thumbnail: string;
    w: number;
    h: number;
    title: string;
  }

  export interface PhotoSwipeProps {
    afterChange?: () => void;
    beforeChange?: () => void;
    className?: string;
    close?: () => void;
    destroy?: () => void;
    gettingData?: () => void;
    id?: string;
    imageLoadComplete?: () => void;
    initialZoomIn?: () => void;
    initialZoomInEnd?: () => void;
    initialZoomOut?: () => void;
    initialZoomOutEnd?: () => void;
    isOpen: boolean;
    items: PhotoSwipeGalleryItem[];
    mouseUsed?: () => void;
    onClose?: () => void;
    options?: any;
    parseVerticalMargin?: () => void;
    preventDragEvent?: () => void;
    resize?: () => void;
    shareLinkClick?: () => void;
    unbindEvents?: () => void;
    updateScrollOffset?: () => void;
  }

  export interface PhotoSwipeGalleryProps extends PhotoSwipeProps {
    thumbnailContent: (PhotoSwipeGalleryItem) => React.ReactNode;
  }

  export class PhotoSwipe extends React.Component<PhotoSwipeProps> { render(): JSX.Element; }
  export class PhotoSwipeGallery extends React.Component<PhotoSwipeGalleryProps> { render(): JSX.Element; }
}

Should we release them here oder in the @typings repo?

michelalbers avatar Nov 22 '18 14:11 michelalbers

support

kringt06 avatar Jan 19 '19 03:01 kringt06

👍

xndyz avatar Feb 25 '19 00:02 xndyz