import type { Plugin } from "@egjs/flicking"; import Flicking from "@egjs/flicking"; import { SYNC } from "./const"; /** * Options for the {@link Sync} plugin */ export interface SyncOptions { /** * Method to synchronize between Flickings. `"camera"` syncs by camera position, `"index"` syncs by panel index * @defaultValue "camera" */ type: typeof SYNC.TYPE.CAMERA | typeof SYNC.TYPE.INDEX; /** * Detailed options for each Flicking instance to synchronize * @defaultValue [] */ synchronizedFlickingOptions: SychronizableFlickingOptions[]; } /** * Per-instance synchronization options used in {@link SyncOptions.synchronizedFlickingOptions} */ export interface SychronizableFlickingOptions { /** * The Flicking instance to synchronize */ flicking: Flicking; /** * Whether clicking this Flicking's panel changes the index of all synced Flickings * @defaultValue false */ isClickable?: boolean; /** * Whether mouse/touch scroll on this Flicking changes other Flickings' index. Only available for the `"index"` type * @defaultValue false */ isSlidable?: boolean; /** * CSS class added to the active (selected) panel * @defaultValue undefined */ activeClass?: string; } /** * Plugin for synchronizing multiple Flicking instances * @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/sync | Demo: Sync} */ declare class Sync implements Plugin { private _flicking; private _disabledIndex; private _type; private _synchronizedFlickingOptions; /** Current value of the {@link SyncOptions.type | type} option. */ get type(): SyncOptions["type"]; /** Current value of the {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions} option. */ get synchronizedFlickingOptions(): SyncOptions["synchronizedFlickingOptions"]; /** Sets {@link SyncOptions.type | type}. */ set type(val: SyncOptions["type"]); /** Sets {@link SyncOptions.synchronizedFlickingOptions | synchronizedFlickingOptions}. */ set synchronizedFlickingOptions(val: SyncOptions["synchronizedFlickingOptions"]); /** * @param options - Options for the Sync instance * @example * ```ts * flicking.addPlugins(new Sync({ * type: "camera", * synchronizedFlickingOptions: [ * { flicking: flicking1 }, * { flicking: flicking2, isClickable: true } * ] * })); * ``` */ constructor(options?: Partial); /** Initialize the plugin and set up synchronization event listeners between Flicking instances. * @param flicking - The Flicking instance to attach this plugin to */ init(flicking: Flicking): void; /** Destroy the plugin and remove all synchronization event listeners. */ destroy(): void; /** Update the active class state for all synchronized Flicking instances. */ update(): void; private _preventEvent; private _addEvents; private _removeEvents; private _onIndexChange; private _onMove; private _onMoveStart; private _onMoveEnd; private _onSelect; private _synchronizeByIndex; private _updateClass; } export default Sync;