* @param {{ * win: !Window, * element: !Element, * scrollContainer: !Element, * runMutate: function(function()), * }} config
(config)
| 140 | * }} config |
| 141 | */ |
| 142 | constructor(config) { |
| 143 | const {element, initialIndex, runMutate, scrollContainer, win} = config; |
| 144 | /** @private @const */ |
| 145 | this.win_ = win; |
| 146 | |
| 147 | /** @private @const */ |
| 148 | this.runMutate_ = runMutate; |
| 149 | |
| 150 | /** @private @const */ |
| 151 | this.element_ = element; |
| 152 | |
| 153 | /** @private @const */ |
| 154 | this.scrollContainer_ = scrollContainer; |
| 155 | |
| 156 | /** @private @const */ |
| 157 | this.autoAdvance_ = new AutoAdvance({ |
| 158 | win, |
| 159 | element, |
| 160 | scrollContainer, |
| 161 | advanceable: this, |
| 162 | }); |
| 163 | |
| 164 | /** @private @const */ |
| 165 | this.carouselAccessibility_ = new CarouselAccessibility({ |
| 166 | win, |
| 167 | element, |
| 168 | scrollContainer, |
| 169 | runMutate, |
| 170 | stoppable: this.autoAdvance_, |
| 171 | }); |
| 172 | |
| 173 | /** @private @const */ |
| 174 | this.debouncedResetScrollReferencePoint_ = debounce( |
| 175 | win, |
| 176 | () => this.resetScrollReferencePoint_(), |
| 177 | RESET_SCROLL_REFERENCE_POINT_WAIT_MS |
| 178 | ); |
| 179 | |
| 180 | /** @private {number} */ |
| 181 | this.advanceCount_ = 1; |
| 182 | |
| 183 | /** @private {number} */ |
| 184 | this.autoAdvanceLoops_ = Number.POSITIVE_INFINITY; |
| 185 | |
| 186 | /** @private {boolean} */ |
| 187 | this.mixedLength_ = false; |
| 188 | |
| 189 | /** @private {!Array<!Element>} */ |
| 190 | this.slides_ = []; |
| 191 | |
| 192 | /** @private {boolean} */ |
| 193 | this.userScrollable_ = true; |
| 194 | |
| 195 | /** @private {boolean} */ |
| 196 | this.updating_ = false; |
| 197 | |
| 198 | /**@private {!Array<!Element>} */ |
| 199 | this.beforeSpacers_ = []; |
nothing calls this directly
no test coverage detected