New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Definitions Missing for lgMediumZoom Plugin Options in TypeScript #1607
Comments
@Andyradall , Thanks for highlighting the issue with lightGallery and the lgMediumZoom plugin in TypeScript! It seems we missed the types for plugin-specific options like backgroundColor, margin, mediumZoom ..etc . import 'lightgallery';
declare module 'lightgallery' {
interface LightGalleryAllSettings {
backgroundColor?: string;
// Include any other plugin-specific settings here
}
} This workaround will help you avoid TypeScript errors for now. We're on it, and we'll include the complete types in our next release. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
When using
lightGallery
with thelgMediumZoom
plugin in a SvelteKit project, specifying plugin-specific settings such asbackgroundColor
forlgMediumZoom
results in a TypeScript error. This is because thebackgroundColor
property does not exist in the typePartial<LightGalleryAllSettings>
, indicating that the type definitions do not currently supportlgMediumZoom
plugin options.Steps to reproduce
lightGallery
in a Svelte component with thelgMediumZoom
plugin.backgroundColor
option within thelgMediumZoom
plugin options.backgroundColor
does not exist in typePartial<LightGalleryAllSettings>
.Unfortunately, I cannot provide a live demo project, but I have included the relevant JS code and sample HTML markup below.
JS code that you use to initialize lightGallery
Sample HTML markup
Environment
Additional context
The issue seems to stem from incomplete type definitions for
lightGallery
settings, particularly when trying to configure options for plugins likelgMediumZoom
. This makes it challenging to uselightGallery
in TypeScript projects where type safety is a concern, especially in SvelteKit applications.The text was updated successfully, but these errors were encountered: