dimsemenov / photoswipe-dynamic-caption-plugin

A dynamic caption plugin for PhotoSwipe v5. Automatically positions the caption aside or below the image.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Typescript Declarations

okerx opened this issue · comments

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

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';
  1. Add following declarations into photoswipe.d.ts:
    declare module 'photoswipe';
    declare module 'photoswipe/lightbox';

Also don't forget to include css.