Repository navigation
Expand file tree
/
Copy pathpage.d.ts
More file actions
250 lines (207 loc) · 8.58 KB
/
Copy pathpage.d.ts
File metadata and controls
250 lines (207 loc) · 8.58 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/**
* Contains the Page class, which represents a logical unit for navigation inside a Frame.
*/
declare module "ui/page" {
import observable = require("data/observable");
import view = require("ui/core/view");
import contentView = require("ui/content-view");
import frame = require("ui/frame");
import actionBar = require("ui/action-bar");
import dependencyObservable = require("ui/core/dependency-observable");
//@private
import styleScope = require("ui/styling/style-scope");
//@endprivate
/**
* Defines the data for the page navigation events.
*/
export interface NavigatedData extends observable.EventData {
/**
* The navigation context (optional, may be undefined) passed to the page navigation events method.
*/
context: any;
/**
* Represents if a navigation is forward or backward.
*/
isBackNavigation: boolean;
}
/**
* Defines the data for the Page.shownModally event.
*/
export interface ShownModallyData extends observable.EventData {
/**
* The context (optional, may be undefined) passed to the page when shown modally.
*/
context: any;
/**
* A callback to call when you want to close the modally shown page. Pass in any kind of arguments and you will receive when the callback parameter of Page.showModal is executed.
*/
closeCallback: Function;
}
export module knownCollections {
export var actionItems: string;
}
/**
* Represents a logical unit for navigation (inside Frame).
*/
export class Page extends contentView.ContentView {
/**
* Dependency property that specify if page background should span under status bar.
*/
public static backgroundSpanUnderStatusBarProperty: dependencyObservable.Property;
/**
* Dependency property used to hide the Navigation Bar in iOS and the Action Bar in Android.
*/
public static actionBarHiddenProperty: dependencyObservable.Property;
/**
* String value used when hooking to showingModally event.
*/
public static showingModallyEvent: string;
/**
* String value used when hooking to shownModally event.
*/
public static shownModallyEvent: string;
/**
* String value used when hooking to navigatingTo event.
*/
public static navigatingToEvent: string;
/**
* String value used when hooking to navigatedTo event.
*/
public static navigatedToEvent: string;
/**
* String value used when hooking to navigatingFrom event.
*/
public static navigatingFromEvent: string;
/**
* String value used when hooking to navigatedFrom event.
*/
public static navigatedFromEvent: string;
constructor(options?: Options)
/**
* Gets or sets whether page background spans under status bar.
*/
backgroundSpanUnderStatusBar: boolean;
/**
* Used to hide the Navigation Bar in iOS and the Action Bar in Android.
*/
actionBarHidden: boolean;
/**
* A valid css string which will be applied for all nested UI components (based on css rules).
*/
css: string;
/**
* Adds a new values to current css.
* @param cssString - A valid css which will be added to current css.
*/
addCss(cssString: string): void;
/**
* Adds the content of the file to the current css.
* @param cssFileName - A valid file name (from the application root) which contains a valid css.
*/
addCssFile(cssFileName: string): void;
/**
* A property that is used to pass a data from another page (while navigate to).
*/
navigationContext: any;
/**
* Gets the Frame object controlling this instance.
*/
frame: frame.Frame;
/**
* Gets the ActionBar for this page.
*/
actionBar: actionBar.ActionBar;
/**
* 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 navigation to the page has started.
*/
on(event: "navigatingTo", callback: (args: NavigatedData) => void, thisArg?: any);
/**
* Raised when navigation to the page has finished.
*/
on(event: "navigatedTo", callback: (args: NavigatedData) => void, thisArg?: any);
/**
* Raised when navigation from the page has started.
*/
on(event: "navigatingFrom", callback: (args: NavigatedData) => void, thisArg?: any);
/**
* Raised when navigation from the page has finished.
*/
on(event: "navigatedFrom", callback: (args: NavigatedData) => void, thisArg?: any);
/**
* Raised before the page is shown as a modal dialog.
*/
on(event: "showingModally", callback: (args: observable.EventData) => void, thisArg?: any);
/**
* Raised after the page is shown as a modal dialog.
*/
on(event: "shownModally", callback: (args: ShownModallyData) => void, thisArg?: any);
/**
* Shows the page contained in moduleName as a modal view.
* @param moduleName - The name of the page module to load starting from the application root.
* @param context - Any context you want to pass to the modally shown page. This same context will be available in the arguments of the Page.shownModally event handler.
* @param closeCallback - A function that will be called when the page is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.
* @param fullscreen - An optional parameter specifying whether to show the modal page in full-screen mode.
*/
showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean);
/**
* Shows the page as a modal view.
*/
showModal();
/**
* Closes the current modal view that this page is showing.
*/
closeModal();
/**
* Returns the current modal view that this page is showing (is parent of), if any.
*/
modal: Page;
//@private
/**
* A method called before navigating to the page.
* @param context - The data passed to the page through the NavigationEntry.context property.
* @param isBackNavigation - True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
*/
onNavigatingTo(context: any, isBackNavigation: boolean): void;
/**
* A method called after navigated to the page.
* @param isBackNavigation - True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
*/
onNavigatedTo(isBackNavigation: boolean): void;
/**
* A method called before navigating from the page.
* @param isBackNavigation - True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
*/
onNavigatingFrom(isBackNavigation: boolean): void;
/**
* A method called after navigated from the page.
* @param isBackNavigation - True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
*/
onNavigatedFrom(isBackNavigation: boolean): void;
_getStyleScope(): styleScope.StyleScope;
//@endprivate
}
/**
* Provides a set with most common option used to create a page instance.
*/
export interface Options extends view.Options {
/**
* Gets or sets the page module.
*/
module?: any;
/**
* Gets or sets the page module file name.
*/
filename?: string;
/**
* Gets or sets the page module exports.
*/
exports?: any;
}
}