diff --git a/types/fslightbox-react/fslightbox-react-tests.tsx b/types/fslightbox-react/fslightbox-react-tests.tsx index 39cfef9f5aa0b3..b7e8f56201926e 100644 --- a/types/fslightbox-react/fslightbox-react-tests.tsx +++ b/types/fslightbox-react/fslightbox-react-tests.tsx @@ -2,7 +2,8 @@ import FsLightbox from "fslightbox-react"; import * as React from "react"; class Test extends React.Component { - handleEvent = (instance: FsLightbox) => {}; + handleEvent = (instance: any) => {}; + handleSourceLoadEvent = (instance: any, source: any, index: number) => {}; render() { return ( @@ -24,6 +25,11 @@ class Test extends React.Component { type="image" types={[null, "video", "youtube"]} thumbs={[null, "yt.jpg", "bbbunny.jpg", "vimeo.jpg"]} + thumbsIcon={ + + + + } thumbsIcons={[ null, @@ -39,6 +45,7 @@ class Test extends React.Component { captions={[

Caption 1

, "Caption 2", "Caption 3"]} customAttributes={[null, { poster: "bbbunny.jpg" }]} showThumbsOnMount={false} + showThumbsWithCaptions={true} disableThumbs={false} openOnMount={false} autoplay @@ -48,12 +55,14 @@ class Test extends React.Component { exitFullscreenOnClose={false} slideDistance={0.5} slideshowTime={10000} + sourceMargin={0.2} UIFadeOutTime={10000} zoomIncrement={0.5} onInit={this.handleEvent} onOpen={this.handleEvent} onShow={this.handleEvent} onClose={this.handleEvent} + onSourceLoad={this.handleSourceLoadEvent} onSlideChange={this.handleEvent} maxYoutubeVideoDimensions={{ width: 400, height: 300 }} initialAnimation="example-initial-animation" @@ -61,21 +70,20 @@ class Test extends React.Component { svg={{ toolbarButtons: { thumbs: { + class: "new-thumbs-btn", viewBox: "0 0 278 278", - width: "17px", - height: "17px", d: "M0 0 H119.054 V119.054 H0 V0 z M158.946 0 H278 V119.054 H158.946 V0 z M158.946 158.946 H278 V278 H158.946 V158.946 z M0 158.946 H119.054 V278 H0 V158.946 z", title: "Preview", }, zoomIn: { - width: "20px", + title: "Bigger", }, zoomOut: { - height: "20px", + class: "new-zoom-out", }, slideshow: { start: { - width: "20px", + d: "M 1", }, pause: { viewBox: "0 0 31 31", @@ -90,12 +98,12 @@ class Test extends React.Component { }, }, close: { - height: "32px", + d: "M 0", }, }, slideButtons: { previous: { - width: "40px", + viewBox: "0 0 40 40", }, next: { title: "Next", diff --git a/types/fslightbox-react/index.d.ts b/types/fslightbox-react/index.d.ts index 17aa00acd00c01..394c41ef7277e8 100644 --- a/types/fslightbox-react/index.d.ts +++ b/types/fslightbox-react/index.d.ts @@ -9,10 +9,9 @@ declare namespace FsLightbox { } interface ToolbarButtonProps { + class?: string; viewBox?: string; d?: string; - width?: string; - height?: string; title?: string; } @@ -32,15 +31,15 @@ declare namespace FsLightbox { // slide number controlling slide?: number | undefined; - source?: string | undefined; sourceIndex?: number | undefined; // events - onOpen?: ((instance: FsLightbox) => void) | undefined; - onClose?: ((instance: FsLightbox) => void) | undefined; - onInit?: ((instance: FsLightbox) => void) | undefined; - onShow?: ((instance: FsLightbox) => void) | undefined; - onSlideChange?: ((instance: FsLightbox) => void) | undefined; // pro feature + onOpen?: ((instance: any) => void) | undefined; + onClose?: ((instance: any) => void) | undefined; + onInit?: ((instance: any) => void) | undefined; + onShow?: ((instance: any) => void) | undefined; + onSourceLoad?: ((instance: any, source: any, index: number) => void) | undefined; + onSlideChange?: ((instance: any) => void) | undefined; // pro feature // types disableLocalStorage?: boolean | undefined; @@ -53,6 +52,7 @@ declare namespace FsLightbox { // thumbs thumbs?: Array | undefined; // pro feature + thumbsIcon?: React.JSX.Element | undefined; // pro feature thumbsIcons?: Array | undefined; // pro feature // animations @@ -66,9 +66,11 @@ declare namespace FsLightbox { disableSlideSwiping?: boolean | undefined; loadOnlyCurrentSource?: boolean | undefined; showThumbsOnMount?: boolean | undefined; // pro feature + showThumbsWithCaptions?: boolean | undefined; // pro feature disableThumbs?: boolean | undefined; // pro feature slideDistance?: number | undefined; slideshowTime?: number | undefined; // pro feature + sourceMargin?: number | undefined; UIFadeOutTime?: number | false | undefined; // pro feature zoomIncrement?: number | undefined; // pro feature openOnMount?: boolean | undefined; @@ -98,6 +100,5 @@ declare namespace FsLightbox { } } -declare class FsLightbox extends React.Component {} - +declare const FsLightbox: React.FC; export = FsLightbox; diff --git a/types/fslightbox-react/package.json b/types/fslightbox-react/package.json index fcab07c2d9a4b9..6aa7176c43406d 100644 --- a/types/fslightbox-react/package.json +++ b/types/fslightbox-react/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/fslightbox-react", - "version": "1.8.9999", + "version": "2.0.9999", "projects": [ "https://fslightbox.com/" ],