embla-carousel-angular
Version:
Angular wrapper for Embla Carousel
38 lines (34 loc) • 2.21 kB
TypeScript
import { EmblaOptionsType, EmblaPluginType, EmblaEventType, EmblaCarouselType } from 'embla-carousel';
export { EmblaCarouselType, EmblaEventType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel';
import * as i0 from '@angular/core';
import { NgZone, ElementRef, DestroyRef, InputSignal, InjectionToken, Provider } from '@angular/core';
import { Subject } from 'rxjs';
declare class EmblaCarouselDirective {
protected _globalOptions: EmblaOptionsType | undefined;
protected _ngZone: NgZone;
protected _elementRef: ElementRef<HTMLElement>;
protected _destroyRef: DestroyRef;
options: InputSignal<EmblaOptionsType>;
plugins: InputSignal<EmblaPluginType[]>;
subscribeToEvents: InputSignal<EmblaEventType[]>;
eventsThrottleTime: InputSignal<number>;
readonly emblaChange: i0.OutputEmitterRef<EmblaEventType>;
protected _destroy$: Subject<void>;
private storedOptions;
private storedPlugins;
emblaApi?: EmblaCarouselType;
constructor();
scrollTo(...args: Parameters<EmblaCarouselType['scrollTo']>): void;
scrollPrev(...args: Parameters<EmblaCarouselType['scrollPrev']>): void;
scrollNext(...args: Parameters<EmblaCarouselType['scrollNext']>): void;
reInit(): void;
/**
* `eventsThrottler$` Subject was made just because `scroll` event fires too often.
*/
private listenEvents;
static ɵfac: i0.ɵɵFactoryDeclaration<EmblaCarouselDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<EmblaCarouselDirective, "[emblaCarousel]", ["emblaCarousel"], { "options": { "alias": "options"; "required": false; "isSignal": true; }; "plugins": { "alias": "plugins"; "required": false; "isSignal": true; }; "subscribeToEvents": { "alias": "subscribeToEvents"; "required": false; "isSignal": true; }; "eventsThrottleTime": { "alias": "eventsThrottleTime"; "required": false; "isSignal": true; }; }, { "emblaChange": "emblaChange"; }, never, never, true, never>;
}
declare const EMBLA_OPTIONS_TOKEN: InjectionToken<EmblaOptionsType | undefined>;
declare function provideEmblaGlobalOptions(options?: EmblaOptionsType): Provider[];
export { EMBLA_OPTIONS_TOKEN, EmblaCarouselDirective, provideEmblaGlobalOptions };