UNPKG

@djs-button-pages/presets

Version:

A set of presets that are used for faster development.

78 lines (77 loc) 2.93 kB
import { ButtonData, ButtonWrapper } from "djs-button-pages"; import LocaleGenerator from "../Types/LocaleGenerator"; /** * Bind for button that switches pagination to the page specified by user. */ export default class PageTravelButton extends ButtonWrapper { private _duration; private _endPhrase; private _endTip; private _startTip; private _travelSet; /** * Bind for button that switches pagination to the page specified by user. * @param {ButtonData} style Styling for button. */ constructor(style?: ButtonData); /** * @returns {string} Phrase that stops page travel. */ get endPhrase(): string; /** * @returns {string | LocaleGenerator | undefined} Tip that will appear when person presses button but he's already travelling through pages. */ get endTip(): string | LocaleGenerator | undefined; /** * @returns {string | LocaleGenerator | undefined} Tip that will appear when person activates page travelling. */ get startTip(): string | LocaleGenerator | undefined; /** * @returns {number} Page travel duration. */ get duration(): number; /** * Sets duration for page travel. * @param {number} duration Page travel duration. * @param {boolean} bypassLimits Should this method bypass limits of library or not. * @returns {this} */ setDuration(duration: number, bypassLimits?: boolean): this; /** * Sets phrase that ends page travel. * @param {string} phrase Phrase that ends page travel. * @returns {this} */ setEndPhrase(phrase: string): this; /** * Sets tip that will appear when person presses button but he's already travelling through pages. * @param {string | LocaleGenerator} tip Tip that will appear when person presses button but he's already travelling through pages. * @returns {this} */ setEndTip(tip: string | LocaleGenerator): this; /** * Sets tip that will appear when person activates page travelling. * @param {string | LocaleGenerator} tip Tip that will appear when person activates page travelling. * @returns {this} */ setStartTip(tip: string | LocaleGenerator): this; /** * Action that switches pagination to the page specified by user. * @param {PaginationSent} pagination Pagination. * @returns {Promise<void>} */ private _doAction; /** * Handles collect event for message collector. * @param {Message} message Message that user wrote. * @param {PaginationSent} pagination Pagination that should be updated. * @param {MessageCollector} collector Message collector. * @returns {Promise<void>} */ private _collect; /** * Switch that never disables the button. * @returns {false} */ private static _switch; }