UNPKG

2.29 kBTypeScriptView Raw
1import { CSSSelector } from '../shared';
2import Swiper from '../swiper-class';
3
4export interface NavigationMethods {
5 /**
6 * HTMLElement of "next" navigation button
7 */
8 nextEl: HTMLElement;
9
10 /**
11 * HTMLElement of "previous" navigation button
12 */
13 prevEl: HTMLElement;
14
15 /**
16 * Update navigation buttons state (enabled/disabled)
17 */
18 update(): void;
19
20 /**
21 * Initialize navigation
22 */
23 init(): void;
24
25 /**
26 * Destroy navigation
27 */
28 destroy(): void;
29}
30
31export interface NavigationEvents {
32 /**
33 * Event will be fired on navigation hide
34 */
35 navigationHide: (swiper: Swiper) => void;
36 /**
37 * Event will be fired on navigation show
38 */
39 navigationShow: (swiper: Swiper) => void;
40 /**
41 * Event will be fired on navigation prev button click
42 */
43 navigationPrev: (swiper: Swiper) => void;
44 /**
45 * Event will be fired on navigation next button click
46 */
47 navigationNext: (swiper: Swiper) => void;
48}
49
50export interface NavigationOptions {
51 /**
52 * Boolean property to use with breakpoints to enable/disable navigation on certain breakpoints
53 */
54 enabled?: boolean;
55 /**
56 * String with CSS selector or HTML element of the element that will work
57 * like "next" button after click on it
58 *
59 * @default null
60 */
61 nextEl?: CSSSelector | HTMLElement | null;
62
63 /**
64 * String with CSS selector or HTML element of the element that will work
65 * like "prev" button after click on it
66 *
67 * @default null
68 */
69 prevEl?: CSSSelector | HTMLElement | null;
70
71 /**
72 * Toggle navigation buttons visibility after click on Slider's container
73 *
74 * @default false
75 */
76 hideOnClick?: boolean;
77
78 /**
79 * CSS class name added to navigation button when it becomes disabled
80 *
81 * @default 'swiper-button-disabled'
82 */
83 disabledClass?: string;
84
85 /**
86 * CSS class name added to navigation button when it becomes hidden
87 *
88 * @default 'swiper-button-hidden'
89 */
90 hiddenClass?: string;
91
92 /**
93 * CSS class name added to navigation button when it is disabled
94 *
95 * @default 'swiper-button-lock'
96 */
97 lockClass?: string;
98
99 /**
100 * CSS class name added on swiper container when navigation is disabled by breakpoint
101 *
102 * @default 'swiper-navigation-disabled'
103 */
104 navigationDisabledClass?: string;
105}