dimsemenov / photoswipe-dynamic-caption-plugin

A dynamic caption plugin for PhotoSwipe v5. Automatically positions the caption aside or below the image.
MIT License
65 stars 12 forks source link

Add Typescript Declarations #9

Open okerx opened 2 years ago

okerx commented 2 years ago

The package has no corresponding Typescript declarations, therefore it cannot be used in a TS project.

doubleforte commented 2 years ago

+1.

dealancer commented 2 years ago

There is a workaround I used to make it work in TS.

  1. Add "allowJs": true into tsconfig.json
  2. Add following declarations into photoswipe-dynamic-caption-plugin.d.ts:
    declare module 'photoswipe-dynamic-caption-plugin';
  3. Add following declarations into photoswipe.d.ts: declare module 'photoswipe'; declare module 'photoswipe/lightbox';

Also don't forget to include css.