Refactor carousel into separate components.
This commit is contained in:
@@ -19,7 +19,7 @@ export const defaultOptions: OptionsType = {
|
||||
lazyLoadCount: 0,
|
||||
};
|
||||
|
||||
export type LazyloadOptionsType = Partial<OptionsType>
|
||||
export type LazyloadOptionsType = Partial<OptionsType>;
|
||||
|
||||
export type LazyloadType = CreatePluginType<
|
||||
{
|
||||
@@ -28,6 +28,12 @@ export type LazyloadType = CreatePluginType<
|
||||
LazyloadOptionsType
|
||||
>;
|
||||
|
||||
declare module 'embla-carousel/components/Plugins' {
|
||||
interface EmblaPluginsType {
|
||||
lazyload?: LazyloadType;
|
||||
}
|
||||
}
|
||||
|
||||
export function Lazyload(userOptions?: LazyloadOptionsType): LazyloadType {
|
||||
const optionsHandler = EmblaCarousel.optionsHandler();
|
||||
const optionsBase = optionsHandler.merge(defaultOptions, Lazyload.globalOptions);
|
||||
|
||||
Reference in New Issue
Block a user