import Flicking, { Plugin } from "@egjs/flicking"; import ScrollContext from "../type"; /** * Options for the {@link Pagination} plugin */ export interface PaginationOptions { /** * The parent element to search for the pagination wrapper. If `null`, the Flicking element is used * @defaultValue null */ parentEl: HTMLElement | null; /** * CSS selector for the pagination wrapper element * @defaultValue ".flicking-pagination" */ selector: string; /** * Pagination display type * @defaultValue "bullet" */ type: "bullet" | "fraction" | "scroll"; /** * CSS class prefix for pagination elements * @defaultValue "flicking-pagination" */ classPrefix: string; /** * Maximum number of bullet indicators displayed at once (only for `"scroll"` type) * @defaultValue 5 */ bulletCount: number; /** * Custom render function for each bullet element */ renderBullet: (className: string, index: number) => string; /** * Custom render function for the fraction display */ renderFraction: (currentClass: string, totalClass: string) => string; /** * Custom render function for the active bullet element. If `null`, the default bullet is used * @defaultValue null */ renderActiveBullet: ((className: string, index: number) => string) | null; /** * Format function for the current index in fraction type */ fractionCurrentFormat: (index: number) => string; /** * Format function for the total count in fraction type */ fractionTotalFormat: (total: number) => string; /** * Callback invoked when the scroll pagination index changes */ scrollOnChange: (index: number, ctx: ScrollContext) => any; } /** * A plugin to add pagination indicators (bullets, fractions, or scrollable bullets) to Flicking * @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/pagination | Demo: Pagination} */ declare class Pagination implements Plugin { private _flicking; private _renderer; private _wrapper; private _parentEl; private _selector; private _type; private _classPrefix; private _bulletCount; private _renderBullet; private _renderActiveBullet; private _renderFraction; private _fractionCurrentFormat; private _fractionTotalFormat; private _scrollOnChange; /** Current value of the {@link PaginationOptions.parentEl | parentEl} option. */ get parentEl(): PaginationOptions["parentEl"]; /** Current value of the {@link PaginationOptions.selector | selector} option. */ get selector(): PaginationOptions["selector"]; /** Current value of the {@link PaginationOptions.type | type} option. */ get type(): PaginationOptions["type"]; /** Current value of the {@link PaginationOptions.classPrefix | classPrefix} option. */ get classPrefix(): string; /** Current value of the {@link PaginationOptions.bulletCount | bulletCount} option. */ get bulletCount(): PaginationOptions["bulletCount"]; /** Current value of the {@link PaginationOptions.renderBullet | renderBullet} option. */ get renderBullet(): PaginationOptions["renderBullet"]; /** Current value of the {@link PaginationOptions.renderActiveBullet | renderActiveBullet} option. */ get renderActiveBullet(): PaginationOptions["renderActiveBullet"]; /** Current value of the {@link PaginationOptions.renderFraction | renderFraction} option. */ get renderFraction(): PaginationOptions["renderFraction"]; /** Current value of the {@link PaginationOptions.fractionCurrentFormat | fractionCurrentFormat} option. */ get fractionCurrentFormat(): PaginationOptions["fractionCurrentFormat"]; /** Current value of the {@link PaginationOptions.fractionTotalFormat | fractionTotalFormat} option. */ get fractionTotalFormat(): PaginationOptions["fractionTotalFormat"]; /** Current value of the {@link PaginationOptions.scrollOnChange | scrollOnChange} option. */ get scrollOnChange(): PaginationOptions["scrollOnChange"]; /** Sets {@link PaginationOptions.parentEl | parentEl}. */ set parentEl(val: PaginationOptions["parentEl"]); /** Sets {@link PaginationOptions.selector | selector}. */ set selector(val: PaginationOptions["selector"]); /** Sets {@link PaginationOptions.type | type}. */ set type(val: PaginationOptions["type"]); /** Sets {@link PaginationOptions.classPrefix | classPrefix}. */ set bulletWrapperclassPrefixClass(val: PaginationOptions["classPrefix"]); /** Sets {@link PaginationOptions.bulletCount | bulletCount}. */ set bulletCount(val: PaginationOptions["bulletCount"]); /** Sets {@link PaginationOptions.renderBullet | renderBullet}. */ set renderBullet(val: PaginationOptions["renderBullet"]); /** Sets {@link PaginationOptions.renderActiveBullet | renderActiveBullet}. */ set renderActiveBullet(val: PaginationOptions["renderActiveBullet"]); /** Sets {@link PaginationOptions.renderFraction | renderFraction}. */ set renderFraction(val: PaginationOptions["renderFraction"]); /** Sets {@link PaginationOptions.fractionCurrentFormat | fractionCurrentFormat}. */ set fractionCurrentFormat(val: PaginationOptions["fractionCurrentFormat"]); /** Sets {@link PaginationOptions.fractionTotalFormat | fractionTotalFormat}. */ set fractionTotalFormat(val: PaginationOptions["fractionTotalFormat"]); /** Sets {@link PaginationOptions.scrollOnChange | scrollOnChange}. */ set scrollOnChange(val: PaginationOptions["scrollOnChange"]); /** * @param options - Options for the Pagination instance * @example * ```ts * flicking.addPlugins(new Pagination({ type: "bullet", selector: ".flicking-pagination" })); * ``` */ constructor(options?: Partial); /** Initialize the plugin, create the pagination renderer, and attach event listeners to the Flicking instance. * @param flicking - The Flicking instance to attach this plugin to */ init(flicking: Flicking): void; /** Destroy the plugin, remove all event listeners, and clean up pagination DOM elements. */ destroy(): void; /** Re-render the pagination indicators to reflect the current panel state. */ update: () => void; private _createRenderer; private _onIndexChange; private _removeAllChilds; } export default Pagination;