🤖 Merge PR #50030 [photoswipe] fix wrong types by @Razdva122

This commit is contained in:
Dmitrii
2020-12-10 09:54:59 +05:00
committed by GitHub
parent 5af8fdf215
commit f95d77462d
2 changed files with 20 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
// Project: http://photoswipe.com/
// Definitions by: Xiaohan Zhang <https://github.com/hellochar>
// PikachuEXE <https://github.com/PikachuEXE>
// RazDva122 <https://github.com/Razdva122>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace PhotoSwipe {
@@ -61,6 +62,11 @@ declare namespace PhotoSwipe {
* Internal property added by PhotoSwipe.
*/
initialPosition?: any;
/**
* Custom IDs for each slide object that are used when forming URL
*/
pid?: string | number;
}
/**
@@ -140,7 +146,7 @@ declare namespace PhotoSwipe {
*
* Default true.
*/
allowNoPanText?: boolean;
allowPanToNext?: boolean;
/**
* Maximum zoom level when performing spread (zoom) gesture. 2 means that image can be zoomed 2x from original size.
@@ -255,6 +261,14 @@ declare namespace PhotoSwipe {
*/
galleryUID?: number;
/**
* Enables custom IDs for each slide object that are used when forming URL.
* If option set set to true, slide objects must have pid (picture identifier) property that can be a string or an integer.
*
* Default false.
*/
galleryPIDs?: boolean;
/**
* Error message when image was not loaded. %url% will be replaced by URL of image.
*
@@ -278,20 +292,6 @@ declare namespace PhotoSwipe {
*/
mainClass?: string;
/**
* NOTE: this property will be ignored in future versions of PhotoSwipe.
*
* @deprecated
*/
mainScrollEndFriction?: number;
/**
* NOTE: this property will be ignored in future versions of PhotoSwipe.
*
* @deprecated
*/
panEndFriction?: number;
/**
* Function that should return total number of items in gallery. Don't put very complex code here, function is executed very often.
*

View File

@@ -7,16 +7,19 @@ function test_defaultUI() {
src: "path/to/image.jpg",
w: 100,
h: 200,
pid: 'image-one',
},
{
src: "path/to/image2.jpg",
w: 1000,
h: 2000,
pid: 'image-two',
},
{
src: "path/to/image3.jpg",
w: 1000,
h: 2000,
pid: 'image-three',
msrc: "path/to/image3-thumb.jpg"
},
@@ -35,7 +38,7 @@ function test_defaultUI() {
showHideOpacity: false,
bgOpacity: 1,
spacing: 0.12,
allowNoPanText: true,
allowPanToNext: true,
maxSpreadZoom: 2,
getDoubleTapZoom: function(isMouseClick, item) {
if (isMouseClick) {
@@ -53,6 +56,7 @@ function test_defaultUI() {
arrowKeys: true,
history: true,
galleryUID: 3,
galleryPIDs: true,
errorMsg: '<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',
preload: [1, 1],
mainClass: "",
@@ -61,8 +65,6 @@ function test_defaultUI() {
isClickableElement: function(el) {
return el.tagName === 'A';
},
mainScrollEndFriction: 0.35,
panEndFriction: 0.35,
modal: true
};