Skip to content

Commit

Permalink
typefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samouri committed Jan 6, 2022
1 parent affe258 commit 9ec8efb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions extensions/amp-carousel/0.1/build-dom.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {devAssert} from '#core/assert';
import {isAmp4Email} from '#core/document/format';
import {isServerRendered} from '#core/dom';
import {escapeCssSelectorIdent} from '#core/dom/css-selectors';
Expand Down Expand Up @@ -43,7 +44,7 @@ function assertDomQueryResults() {
* Builds a carousel button for next/prev.
* @param {Element} element
* @param {{className: string, title: string, enabled: boolean}} options
* @return {?HTMLDivElement}
* @return {HTMLDivElement}
*/
function buildButton(element, {className, enabled, title}) {
/*
Expand Down Expand Up @@ -218,6 +219,7 @@ function buildSlideScrollCarousel(element) {
slidesContainer.setAttribute('aria-live', 'polite');
element.appendChild(slidesContainer);

/** @type {HTMLDivElement[]} */
const slideWrappers = [];
slides.forEach((slide) => {
slide.classList.add(ClassNames.SLIDE);
Expand Down Expand Up @@ -317,13 +319,16 @@ export function getPrevButtonTitle(element, options = {}) {
* - Slides : "Next item in carousel (X of Y)"
*
* @param {*} element
* @param {{prefix: string, index: string, total:string}} param1
* @param {{prefix: string, index?: string, total?:string}} param1
* @return {string}
*/
function getButtonTitle(element, {index, prefix, total}) {
if (isScrollable(element)) {
return prefix;
}
// Slides carousel should always have index/total provided.
devAssert(index);
devAssert(total);

/**
* A format string for the button label. Should be a string, containing two
Expand Down

0 comments on commit 9ec8efb

Please sign in to comment.