docs(components): update method and parameter descriptions (#18075)

This commit is contained in:
Brandy Carney
2019-04-23 12:59:25 -04:00
committed by GitHub
parent bd96491d03
commit 464ec3b70a
56 changed files with 879 additions and 644 deletions

View File

@ -161,7 +161,10 @@ export class Slides implements ComponentInterface {
}
/**
* Force swiper to update its height (when autoHeight enabled) for the duration equal to 'speed' parameter
* Force swiper to update its height (when autoHeight is enabled) for the duration
* equal to 'speed' parameter.
*
* @param speed The transition duration (in ms).
*/
@Method()
async updateAutoHeight(speed?: number) {
@ -171,6 +174,10 @@ export class Slides implements ComponentInterface {
/**
* Transition to the specified slide.
*
* @param index The index of the slide to transition to.
* @param speed The transition duration (in ms).
* @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.
*/
@Method()
async slideTo(index: number, speed?: number, runCallbacks?: boolean) {
@ -180,6 +187,9 @@ export class Slides implements ComponentInterface {
/**
* Transition to the next slide.
*
* @param speed The transition duration (in ms).
* @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.
*/
@Method()
async slideNext(speed?: number, runCallbacks?: boolean) {
@ -189,6 +199,9 @@ export class Slides implements ComponentInterface {
/**
* Transition to the previous slide.
*
* @param speed The transition duration (in ms).
* @param runCallbacks If true, the transition will produce the [Transition/SlideChange][Start/End] transition events.
*/
@Method()
async slidePrev(speed?: number, runCallbacks?: boolean) {
@ -225,7 +238,6 @@ export class Slides implements ComponentInterface {
/**
* Get whether or not the current slide is the last slide.
*
*/
@Method()
async isEnd(): Promise<boolean> {
@ -265,32 +277,38 @@ export class Slides implements ComponentInterface {
}
/**
* Lock or unlock the ability to slide to the next slides.
* Lock or unlock the ability to slide to the next slide.
*
* @param lock If `true`, disable swiping to the next slide.
*/
@Method()
async lockSwipeToNext(shouldLockSwipeToNext: boolean) {
async lockSwipeToNext(lock: boolean) {
const swiper = await this.getSwiper();
swiper.allowSlideNext = !shouldLockSwipeToNext;
swiper.allowSlideNext = !lock;
}
/**
* Lock or unlock the ability to slide to the previous slides.
* Lock or unlock the ability to slide to the previous slide.
*
* @param lock If `true`, disable swiping to the previous slide.
*/
@Method()
async lockSwipeToPrev(shouldLockSwipeToPrev: boolean) {
async lockSwipeToPrev(lock: boolean) {
const swiper = await this.getSwiper();
swiper.allowSlidePrev = !shouldLockSwipeToPrev;
swiper.allowSlidePrev = !lock;
}
/**
* Lock or unlock the ability to slide to change slides.
* Lock or unlock the ability to slide to the next or previous slide.
*
* @param lock If `true`, disable swiping to the next and previous slide.
*/
@Method()
async lockSwipes(shouldLockSwipes: boolean) {
async lockSwipes(lock: boolean) {
const swiper = await this.getSwiper();
swiper.allowSlideNext = !shouldLockSwipes;
swiper.allowSlidePrev = !shouldLockSwipes;
swiper.allowTouchMove = !shouldLockSwipes;
swiper.allowSlideNext = !lock;
swiper.allowSlidePrev = !lock;
swiper.allowTouchMove = !lock;
}
private async initSwiper() {