Skip to content

Commit

Permalink
Merge pull request #1112 from marekdedic/jquery-import-fixes
Browse files Browse the repository at this point in the history
Fixed import errors for jQuery version
  • Loading branch information
marekdedic authored Oct 5, 2024
2 parents 086954c + d02fd45 commit 35503ef
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ npm install --save imagelightbox

After that include the `dist/imagelightbox.css` and `dist/imagelightbox.umd.cjs` files. Alternatively, you can use the `dist/imagelightbox.js` file if you are using ES6 modules.

If you prefer to use jQuery, there are also jQuery wrappers available in `dist/imagelightbox.jquery.umd.cjs` or `dist/imagelightbox.jquery.js`. These wrappers mostly adapt the interface of the library to work with jQuery types and emit jQuery events. These are here mostly for legacy reasons and their use is discouraged.
If you prefer to use jQuery, there are also jQuery versions available in `dist/imagelightbox.jquery.umd.cjs` or `dist/imagelightbox.jquery.js`. These mostly adapt the interface of the library to work with jQuery types and emit jQuery events. These are here mostly for legacy reasons and their use is discouraged.

## How to use

Expand Down
2 changes: 1 addition & 1 deletion jquery.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
},
outDir: "../dist",
rollupOptions: {
external: ["jquery", "./imagelightbox"],
external: ["jquery"],
output: {
assetFileNames: "imagelightbox.[ext]",
globals: {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
".": {
"import": "./dist/imagelightbox.js",
"require": "./dist/imagelightbox.umd.cjs",
"style": "./dist/imagelightbox.min.css"
"style": "./dist/imagelightbox.min.css",
"types": "./types/imagelightbox.d.ts"
},
"./jquery": {
"import": "./dist/imagelightbox.jquery.js",
"require": "./dist/imagelightbox.jquery.umd.cjs",
"style": "./dist/imagelightbox.min.css"
"style": "./dist/imagelightbox.min.css",
"types": "./types/imagelightbox.jquery.d.ts"
}
},
"files": [
Expand Down
20 changes: 20 additions & 0 deletions types/imagelightbox.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
interface ILBOptions {
activity: boolean;
allowedTypes: string;
animationSpeed: number;
arrows: boolean;
button: boolean;
caption: boolean;
enableKeyboard: boolean;
fullscreen: boolean;
gutter: number;
history: boolean;
navigation: boolean;
overlay: boolean;
preloadNext: boolean;
quitOnDocClick: boolean;
quitOnEnd: boolean;
quitOnEscKey: boolean;
quitOnImgClick: boolean;
}

export class ImageLightbox {
public constructor(
images:
Expand Down

0 comments on commit 35503ef

Please sign in to comment.