UNPKG

7.3 kBTypeScriptView Raw
1import { AfterContentChecked, AfterContentInit, AfterViewInit, EventEmitter, QueryList, TemplateRef } from '@angular/core';
2import { NgbSlideEventDirection } from './carousel-transition';
3import * as i0 from "@angular/core";
4/**
5 * A directive that wraps the individual carousel slide.
6 */
7export declare class NgbSlide {
8 templateRef: TemplateRef<any>;
9 /**
10 * Slide id that must be unique for the entire document.
11 *
12 * If not provided, will be generated in the `ngb-slide-xx` format.
13 */
14 id: string;
15 /**
16 * An event emitted when the slide transition is finished
17 *
18 * @since 8.0.0
19 */
20 slid: EventEmitter<NgbSingleSlideEvent>;
21 static ɵfac: i0.ɵɵFactoryDeclaration<NgbSlide, never>;
22 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbSlide, "ng-template[ngbSlide]", never, { "id": { "alias": "id"; "required": false; }; }, { "slid": "slid"; }, never, never, true, never>;
23}
24/**
25 * Carousel is a component to easily create and control slideshows.
26 *
27 * Allows to set intervals, change the way user interacts with the slides and provides a programmatic API.
28 */
29export declare class NgbCarousel implements AfterContentChecked, AfterContentInit, AfterViewInit {
30 slides: QueryList<NgbSlide>;
31 NgbSlideEventSource: typeof NgbSlideEventSource;
32 private _config;
33 private _platformId;
34 private _ngZone;
35 private _cd;
36 private _container;
37 private _destroyRef;
38 private _injector;
39 private _interval$;
40 private _mouseHover$;
41 private _focused$;
42 private _pauseOnHover$;
43 private _pauseOnFocus$;
44 private _pause$;
45 private _wrap$;
46 id: string;
47 /**
48 * A flag to enable/disable the animations.
49 *
50 * @since 8.0.0
51 */
52 animation: boolean;
53 /**
54 * The slide id that should be displayed **initially**.
55 *
56 * For subsequent interactions use methods `select()`, `next()`, etc. and the `(slide)` output.
57 */
58 activeId: string;
59 /**
60 * Time in milliseconds before the next slide is shown.
61 */
62 set interval(value: number);
63 get interval(): number;
64 /**
65 * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
66 */
67 set wrap(value: boolean);
68 get wrap(): boolean;
69 /**
70 * If `true`, allows to interact with carousel using keyboard 'arrow left' and 'arrow right'.
71 */
72 keyboard: boolean;
73 /**
74 * If `true`, will pause slide switching when mouse cursor hovers the slide.
75 *
76 * @since 2.2.0
77 */
78 set pauseOnHover(value: boolean);
79 get pauseOnHover(): boolean;
80 /**
81 * If `true`, will pause slide switching when the focus is inside the carousel.
82 */
83 set pauseOnFocus(value: boolean);
84 get pauseOnFocus(): boolean;
85 /**
86 * If `true`, 'previous' and 'next' navigation arrows will be visible on the slide.
87 *
88 * @since 2.2.0
89 */
90 showNavigationArrows: boolean;
91 /**
92 * If `true`, navigation indicators at the bottom of the slide will be visible.
93 *
94 * @since 2.2.0
95 */
96 showNavigationIndicators: boolean;
97 /**
98 * An event emitted just before the slide transition starts.
99 *
100 * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.
101 */
102 slide: EventEmitter<NgbSlideEvent>;
103 /**
104 * An event emitted right after the slide transition is completed.
105 *
106 * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.
107 *
108 * @since 8.0.0
109 */
110 slid: EventEmitter<NgbSlideEvent>;
111 private _transitionIds;
112 set mouseHover(value: boolean);
113 get mouseHover(): boolean;
114 set focused(value: boolean);
115 get focused(): boolean;
116 arrowLeft(): void;
117 arrowRight(): void;
118 ngAfterContentInit(): void;
119 ngAfterContentChecked(): void;
120 ngAfterViewInit(): void;
121 /**
122 * Navigates to a slide with the specified identifier.
123 */
124 select(slideId: string, source?: NgbSlideEventSource): void;
125 /**
126 * Navigates to the previous slide.
127 */
128 prev(source?: NgbSlideEventSource): void;
129 /**
130 * Navigates to the next slide.
131 */
132 next(source?: NgbSlideEventSource): void;
133 /**
134 * Pauses cycling through the slides.
135 */
136 pause(): void;
137 /**
138 * Restarts cycling through the slides from start to end.
139 */
140 cycle(): void;
141 /**
142 * Set the focus on the carousel.
143 */
144 focus(): void;
145 private _cycleToSelected;
146 private _getSlideEventDirection;
147 private _getSlideById;
148 private _getSlideIdxById;
149 private _getNextSlide;
150 private _getPrevSlide;
151 private _getSlideElement;
152 static ɵfac: i0.ɵɵFactoryDeclaration<NgbCarousel, never>;
153 static ɵcmp: i0.ɵɵComponentDeclaration<NgbCarousel, "ngb-carousel", ["ngbCarousel"], { "animation": { "alias": "animation"; "required": false; }; "activeId": { "alias": "activeId"; "required": false; }; "interval": { "alias": "interval"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "keyboard": { "alias": "keyboard"; "required": false; }; "pauseOnHover": { "alias": "pauseOnHover"; "required": false; }; "pauseOnFocus": { "alias": "pauseOnFocus"; "required": false; }; "showNavigationArrows": { "alias": "showNavigationArrows"; "required": false; }; "showNavigationIndicators": { "alias": "showNavigationIndicators"; "required": false; }; }, { "slide": "slide"; "slid": "slid"; }, ["slides"], never, true, never>;
154}
155/**
156 * A slide change event emitted right after the slide transition is completed.
157 */
158export interface NgbSlideEvent {
159 /**
160 * The previous slide id.
161 */
162 prev: string;
163 /**
164 * The current slide id.
165 */
166 current: string;
167 /**
168 * The slide event direction.
169 *
170 * <span class="badge bg-info text-dark">since 12.0.0</span> Possible values are `'start' | 'end'`.
171 *
172 * <span class="badge bg-secondary">before 12.0.0</span> Possible values were `'left' | 'right'`.
173 */
174 direction: NgbSlideEventDirection;
175 /**
176 * Whether the pause() method was called (and no cycle() call was done afterwards).
177 *
178 * @since 5.1.0
179 */
180 paused: boolean;
181 /**
182 * Source triggering the slide change event.
183 *
184 * Possible values are `'timer' | 'arrowLeft' | 'arrowRight' | 'indicator'`
185 *
186 * @since 5.1.0
187 */
188 source?: NgbSlideEventSource;
189}
190/**
191 * A slide change event emitted right after the slide transition is completed.
192 *
193 * @since 8.0.0
194 */
195export interface NgbSingleSlideEvent {
196 /**
197 * true if the slide is shown, false otherwise
198 */
199 isShown: boolean;
200 /**
201 * The slide event direction.
202 *
203 * <span class="badge bg-info text-dark">since 12.0.0</span> Possible values are `'start' | 'end'`.
204 *
205 * <span class="badge bg-secondary">before 12.0.0</span> Possible values were `'left' | 'right'`.
206 */
207 direction: NgbSlideEventDirection;
208 /**
209 * Source triggering the slide change event.
210 *
211 * Possible values are `'timer' | 'arrowLeft' | 'arrowRight' | 'indicator'`
212 *
213 */
214 source?: NgbSlideEventSource;
215}
216export declare enum NgbSlideEventSource {
217 TIMER = "timer",
218 ARROW_LEFT = "arrowLeft",
219 ARROW_RIGHT = "arrowRight",
220 INDICATOR = "indicator"
221}