Skip to content

Commit

Permalink
fix(types): change types of children & gallery options according to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov authored Oct 25, 2022
2 parents ab74267 + d3c3a9c commit 1530ea7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/js/photoswipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ import ContentLoader from './slide/loader.js';
/** @typedef {Type<PhotoSwipe> | { default: Type<PhotoSwipe> }} PhotoSwipeModule */
/** @typedef {PhotoSwipeModule | Promise<PhotoSwipeModule> | (() => Promise<PhotoSwipeModule>)} PhotoSwipeModuleOption */

/**
* @typedef {string | NodeListOf<HTMLElement> | HTMLElement[] | HTMLElement} ElementProvider
*/

/**
* @typedef {Object} PhotoSwipeOptions https://photoswipe.com/options/
*
Expand Down Expand Up @@ -208,9 +212,9 @@ import ContentLoader from './slide/loader.js';
* @prop {PhotoSwipeModuleOption} [pswpModule]
* @prop {() => Promise<any>} [openPromise]
* @prop {boolean=} preloadFirstSlide
* @prop {string=} gallery
* @prop {ElementProvider=} gallery
* @prop {string=} gallerySelector
* @prop {string=} children
* @prop {ElementProvider=} children
* @prop {string=} childSelector
* @prop {string | false} [thumbSelector]
*/
Expand Down
2 changes: 1 addition & 1 deletion src/js/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export function specialKeyUsed(e) {
/**
* Parse `gallery` or `children` options.
*
* @param {HTMLElement | NodeListOf<HTMLElement> | string} option
* @param {import('../photoswipe.js').ElementProvider} option
* @param {string=} legacySelector
* @param {HTMLElement | Document} [parent]
* @returns HTMLElement[]
Expand Down

0 comments on commit 1530ea7

Please sign in to comment.