embla-carousel-angular
Version:
Angular wrapper for Embla Carousel
49 lines (45 loc) • 2.58 kB
TypeScript
import * as i0 from '@angular/core';
import { NgZone, ElementRef, DestroyRef, InputSignal, Signal, InjectionToken, Provider } from '@angular/core';
import { EmblaOptionsType, EmblaPluginType, EmblaEventType, EmblaCarouselType } from 'embla-carousel';
declare class EmblaCarouselDirective {
protected _globalOptions: EmblaOptionsType | undefined;
protected _ngZone: NgZone;
protected _elementRef: ElementRef<HTMLElement>;
protected _destroyRef: DestroyRef;
readonly options: InputSignal<EmblaOptionsType>;
readonly plugins: InputSignal<EmblaPluginType[]>;
readonly subscribeToEvents: InputSignal<EmblaEventType[]>;
readonly eventsThrottleTime: InputSignal<number>;
readonly emblaChange: i0.OutputEmitterRef<EmblaEventType>;
private storedOptions;
private storedPlugins;
private readonly _emblaApiSignal;
readonly emblaApiSignal: Signal<EmblaCarouselType | null>;
get emblaApi(): EmblaCarouselType | null;
constructor();
goTo(...args: Parameters<EmblaCarouselType['scrollTo']>): void;
goToPrev(...args: Parameters<EmblaCarouselType['scrollPrev']>): void;
goToNext(...args: Parameters<EmblaCarouselType['scrollNext']>): void;
/**
* @deprecated Use `goTo` instead
*/
scrollTo(...args: Parameters<EmblaCarouselType['scrollTo']>): void;
/**
* @deprecated Use `goToPrev` instead
*/
scrollPrev(...args: Parameters<EmblaCarouselType['scrollPrev']>): void;
/**
* @deprecated Use `goToNext` instead
*/
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 };