/** * DevExtreme (ui/gallery.d.ts) * Version: 25.1.7 * Build date: Mon Nov 10 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { DataSourceLike } from '../data/data_source'; import { DxPromise, } from '../core/utils/deferred'; import { EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, ItemInfo, PointerInteractionEvent, } from '../events'; import CollectionWidget, { CollectionWidgetItem, CollectionWidgetOptions, SelectionChangeInfo, } from './collection/ui.collection_widget.base'; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ type ItemLike = string | Item | any; /** * The type of the contentReady event handler's argument. */ export type ContentReadyEvent = EventInfo>; /** * The type of the disposing event handler's argument. */ export type DisposingEvent = EventInfo>; /** * The type of the initialized event handler's argument. */ export type InitializedEvent = InitializedEventInfo>; /** * The type of the itemClick event handler's argument. */ export type ItemClickEvent = NativeEventInfo, KeyboardEvent | MouseEvent | PointerEvent> & ItemInfo; /** * The type of the itemContextMenu event handler's argument. */ export type ItemContextMenuEvent = NativeEventInfo, PointerInteractionEvent> & ItemInfo; /** * The type of the itemHold event handler's argument. */ export type ItemHoldEvent = NativeEventInfo, PointerInteractionEvent> & ItemInfo; /** * The type of the itemRendered event handler's argument. */ export type ItemRenderedEvent = EventInfo> & ItemInfo; /** * The type of the optionChanged event handler's argument. */ export type OptionChangedEvent = EventInfo> & ChangedOptionInfo; /** * The type of the selectionChanged event handler's argument. */ export type SelectionChangedEvent = EventInfo> & SelectionChangeInfo; /** * * @deprecated */ export interface dxGalleryOptions< TItem extends ItemLike = any, TKey = any, > extends CollectionWidgetOptions, TItem, TKey> { /** * The time, in milliseconds, spent on slide animation. */ animationDuration?: number; /** * Specifies whether or not to animate the displayed item change. */ animationEnabled?: boolean; /** * Binds the UI component to data. */ dataSource?: DataSourceLike | null; /** * Specifies whether the UI component can be focused using keyboard navigation. */ focusStateEnabled?: boolean; /** * A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ indicatorEnabled?: boolean; /** * Specifies the width of an area used to display a single image. */ initialItemWidth?: number | undefined; /** * An array of items displayed by the UI component. */ items?: Array; /** * A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ loop?: boolean; /** * Specifies the text or HTML markup displayed by the UI component if the item collection is empty. */ noDataText?: string; /** * The index of the currently active gallery item. */ selectedIndex?: number; /** * A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ showIndicator?: boolean; /** * A Boolean value that specifies the availability of the 'Forward' and 'Back' navigation buttons. */ showNavButtons?: boolean; /** * The time interval in milliseconds, after which the gallery switches to the next item. */ slideshowDelay?: number; /** * Specifies if the UI component stretches images to fit the total gallery width. */ stretchImages?: boolean; /** * A Boolean value specifying whether or not to allow users to switch between items by swiping. */ swipeEnabled?: boolean; /** * Specifies whether or not to display parts of previous and next images along the sides of the current image. */ wrapAround?: boolean; } /** * The Gallery is a UI component that displays a collection of images in a carousel. The UI component is supplied with various navigation controls that allow a user to switch between images. */ export default class dxGallery< TItem extends ItemLike = any, TKey = any, > extends CollectionWidget, TItem, TKey> { /** * Shows a specific image. */ goToItem(itemIndex: number, animation: boolean): DxPromise; /** * Shows the next image. */ nextItem(animation: boolean): DxPromise; /** * Shows the previous image. */ prevItem(animation: boolean): DxPromise; } export type Item = dxGalleryItem; /** * @deprecated Use Item instead * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export interface dxGalleryItem extends CollectionWidgetItem { /** * Specifies the text passed to the alt attribute of the image markup element. */ imageAlt?: string; /** * Specifies the URL of the image displayed by the item. */ imageSrc?: string; } export type ExplicitTypes< TItem extends ItemLike, TKey, > = { Properties: Properties; ContentReadyEvent: ContentReadyEvent; DisposingEvent: DisposingEvent; InitializedEvent: InitializedEvent; ItemClickEvent: ItemClickEvent; ItemContextMenuEvent: ItemContextMenuEvent; ItemHoldEvent: ItemHoldEvent; ItemRenderedEvent: ItemRenderedEvent; OptionChangedEvent: OptionChangedEvent; SelectionChangedEvent: SelectionChangedEvent; }; export type Properties< TItem extends ItemLike = any, TKey = any, > = dxGalleryOptions; /** * @deprecated use Properties instead * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ export type Options< TItem extends ItemLike = any, TKey = any, > = Properties;