UNPKG

2.19 kBTypeScriptView Raw
1import { View } from '../core/view';
2import { Property, CoercibleProperty } from '../core/properties';
3import { EventData } from '../../data/observable';
4import type { SliderBase } from './slider-common';
5
6/**
7 * Represents a slider component.
8 */
9export class Slider extends View {
10 static readonly accessibilityDecrementEvent = 'accessibilityDecrement';
11 static readonly accessibilityIncrementEvent = 'accessibilityIncrement';
12
13 /**
14 * Gets the native [android widget](http://developer.android.com/reference/android/widget/SeekBar.html) that represents the user interface for this component. Valid only when running on Android OS.
15 */
16 android: any /* android.widget.SeekBar */;
17
18 /**
19 * Gets the native iOS [UISlider](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISlider_Class/) that represents the user interface for this component. Valid only when running on iOS.
20 */
21 ios: any /* UISlider */;
22
23 /**
24 * Gets or sets a slider current value. The default value is 0.
25 */
26 value: number;
27
28 /**
29 * Gets or sets a slider min value. The default value is 0.
30 */
31 minValue: number;
32
33 /**
34 * Gets or sets a slider max value. The default value is 100.
35 */
36 maxValue: number;
37
38 /**
39 * Increase/Decrease step size for iOS Increment-/Decrement events
40 */
41 accessibilityStep: number;
42}
43
44/**
45 * Represents the observable property backing the value property of each Slider instance.
46 */
47export const valueProperty: CoercibleProperty<Slider, number>;
48
49/**
50 * Represents the observable property backing the minValue property of each Slider instance.
51 */
52export const minValueProperty: Property<Slider, number>;
53
54/**
55 * Represents the observable property backing the maxValue property of each Slider instance.
56 */
57export const maxValueProperty: CoercibleProperty<Slider, number>;
58
59/**
60 * Represents the observable property backing the accessibilityStep property of each Slider instance.
61 */
62export const accessibilityStepProperty: Property<SliderBase, number>;
63
64interface AccessibilityIncrementEventData extends EventData {
65 object: Slider;
66 value?: number;
67}
68
69interface AccessibilityDecrementEventData extends EventData {
70 object: Slider;
71 value?: number;
72}