forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtab-view.d.ts
More file actions
89 lines (76 loc) · 3.06 KB
/
tab-view.d.ts
File metadata and controls
89 lines (76 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* Contains the TabView class, which represents a standard content component with tabs.
*/
declare module "ui/tab-view" {
import view = require("ui/core/view");
import dependencyObservable = require("ui/core/dependency-observable");
import observable = require("data/observable");
/**
* Represents a tab view entry.
*/
interface TabViewItem {
/**
* Gets or sets the title of the TabViewItem.
*/
title: string;
/**
* Gets or sets the view of the TabViewItem.
*/
view: view.View;
/**
* Gets or sets the icon source of the TabViewItem. This could either be a a file name or resource id.
*/
iconSource?: string;
}
/**
* Defines the data for the TabView.selectedIndexChanged event.
*/
export interface SelectedIndexChangedEventData extends observable.EventData {
/**
* The old selected index.
*/
oldIndex: number;
/**
* The new selected index.
*/
newIndex: number;
}
/**
* Represents a tab view.
*/
class TabView extends view.View {
public static itemsProperty: dependencyObservable.Property;
public static selectedIndexProperty: dependencyObservable.Property;
/**
* Gets or sets the items of the TabView.
*/
items: Array<TabViewItem>;
/**
* Gets or sets the selectedIndex of the TabView.
*/
selectedIndex: number;
/**
* Gets the native [android widget](http://developer.android.com/reference/android/support/v4/view/ViewPager.html) that represents the user interface for this component. Valid only when running on Android OS.
*/
android: android.support.v4.view.ViewPager;
/**
* Gets the native iOS [UITabBarController](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/) that represents the user interface for this component. Valid only when running on iOS.
*/
ios: UITabBarController;
/**
* String value used when hooking to the selectedIndexChanged event.
*/
public static selectedIndexChangedEvent: string;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (data: observable.EventData) => void, thisArg?: any);
/**
* Raised when the selected index changes.
*/
on(event: "selectedIndexChanged", callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any);
}
}