UNPKG

@nstudio/nativescript-carousel

Version:

Carousel component for NativeScript (iOS & Android).

144 lines (143 loc) 5.17 kB
import { Color, GridLayout, ObservableArray, Property, StackLayout, Template, View } from '@nativescript/core'; export declare class CarouselUtil { static debug: boolean; } export declare class Log { static D(...args: any[]): void; } export declare class CarouselCommon extends GridLayout { /** * String value when hooking into the pageChanged event. */ static pageChangedEvent: string; /** * String value when hooking into the pageTapped event. */ static pageTappedEvent: string; /** * String value when hooking into the pageScrolling event. */ static pageScrollingEvent: string; /** * String value when hooking into the pageScrolled event. */ static pageScrollStateChangedEvent: string; /** * Returns the native iOS DKCarouselView instance. */ ios: any; /** * Returns the native android ViewPager instance. */ android: any; /** * Assign a data-array to generate the slides and apply the bindingContext. If items is populated then you must use the template-option. */ items: ObservableArray<any>; /** * Defines the view template for each slide-view to be generated. */ itemTemplate: string | Template; /** * Sets/Gets the active page by index */ selectedPage: any; /** * Shows or hides the page-indicator */ showIndicator: boolean; /** * Sets the active indicator color. Default is semi-transparent white. Use hex or color-name. */ indicatorColor: any; /** * Sets the color of unselected indicators */ indicatorColorUnselected: any; /** * By default the indicator is centered at the bottom. You can use points (x,y) to move the indicator. E.g. indicatorOffset="100,100" */ indicatorOffset: any; /** * iOS Only - If set to 'true' scrolling will bounce at the first/last page (non-infinite). Default is 'false'. */ bounce: any; /** * iOS Only - If true last slide will wrap back to first and visa versa */ finite: any; /** * iOS Only - Enables/Disables user scroll on the Carousel. */ scrollEnabled: any; /** * iOS Only - Defines the interval in seconds to wait before the next slide is shown. Default is 0 (off). */ autoPagingInterval: any; /** * Android Only - Sets the pager-indicator animation type. Choose between: color, slide, scale, worm, thin_worm, fill, drop or none. Default is none. */ indicatorAnimation: any; /** * Android Only - Sets the pager-indicator animation duration in milliseconds. Default is 500. */ indicatorAnimationDuration: any; /** * Android Only - Sets the pager-indicator alignment. Choose between top or bottom. Default is bottom. */ indicatorAlignment: any; /** * Android Only - Sets the pager-indicator dot radius. */ indicatorRadius: any; /** * Android Only - Sets the pager-indicator dot padding. */ indicatorPadding: any; /** * If true console logs will be output to help debug the Carousel events. */ set debug(value: boolean); get debug(): boolean; constructor(); _getDefaultItemContent(index: number): View; } export declare class CarouselItem extends StackLayout { constructor(); onLoaded(): void; } export declare namespace knownTemplates { const itemTemplate = "itemTemplate"; } export declare const debugProperty: Property<CarouselCommon, boolean>; export declare const itemTemplateProperty: Property<CarouselCommon, any>; export declare const itemsProperty: Property<CarouselCommon, ObservableArray<any>>; export declare const selectedPageProperty: Property<CarouselCommon, number>; export declare const showIndicatorProperty: Property<CarouselCommon, boolean>; export declare const indicatorColorProperty: Property<CarouselCommon, Color>; export declare const indicatorColorUnselectedProperty: Property<CarouselCommon, Color>; export declare const indicatorOffsetProperty: Property<CarouselCommon, any>; export declare const autoPagingIntervalProperty: Property<CarouselCommon, number>; export declare const finiteProperty: Property<CarouselCommon, boolean>; export declare const bounceProperty: Property<CarouselCommon, boolean>; export declare const scrollEnabledProperty: Property<CarouselCommon, boolean>; export declare const indicatorAnimationProperty: Property<CarouselCommon, IndicatorAnimation>; export declare const indicatorAnimationDurationProperty: Property<CarouselCommon, number>; export declare const indicatorAlignmentProperty: Property<CarouselCommon, any>; export declare const indicatorRadiusProperty: Property<CarouselCommon, number>; export declare const indicatorPaddingProperty: Property<CarouselCommon, number>; /** * ** ANDROID ONLY ** - Enum to indicator animation type. */ export declare enum IndicatorAnimation { 'NONE' = "NONE", 'COLOR' = "COLOR", 'SLIDE' = "SLIDE", 'WORM' = "WORM", 'FILL' = "FILL", 'SCALE' = "SCALE", 'SCALE_DOWN' = "SCALE_DOWN", 'THIN_WORM' = "THIN_WORM", 'DROP' = "DROP", 'SWAP' = "SWAP" }