mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings - Only use ambient mobules for global API's - Move single-file modules to a subdir with the same name so that we can provide a hand-written typing next to it (via package.json) - Delete all mentions of tns-core-modules.d.ts - Delete reference d.ts assembly build steps. Not needed anymore. - HACK! Use a <reference> for global typings in application.d.ts to avoid publishing a separate @types/tns-core-modules package. - Rename declarations.d.ts to tns-core-modules.d.ts to preserve JS project mappings in references.d.ts (the only place we use those)
This commit is contained in:
committed by
Hristo Deshev
parent
1af8c6ca8e
commit
b45cbe929b
286
tns-core-modules/ui/list-view/list-view.d.ts
vendored
286
tns-core-modules/ui/list-view/list-view.d.ts
vendored
@@ -1,174 +1,172 @@
|
||||
/**
|
||||
* Contains the ListView class, which represents a standard list view widget.
|
||||
*/
|
||||
declare module "ui/list-view" {
|
||||
import { EventData, View, Template, KeyedTemplate, Length, Property, CssProperty, Color, Style } from "ui/core/view";
|
||||
import { EventData, View, Template, KeyedTemplate, Length, Property, CssProperty, Color, Style } from "ui/core/view";
|
||||
|
||||
/**
|
||||
* Known template names.
|
||||
*/
|
||||
export module knownTemplates {
|
||||
/**
|
||||
* The ListView item template.
|
||||
*/
|
||||
export var itemTemplate: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a view that shows items in a vertically scrolling list.
|
||||
*/
|
||||
export class ListView extends View {
|
||||
/**
|
||||
* String value used when hooking to itemLoading event.
|
||||
*/
|
||||
public static itemLoadingEvent: string;
|
||||
/**
|
||||
* String value used when hooking to itemTap event.
|
||||
*/
|
||||
public static itemTapEvent: string;
|
||||
/**
|
||||
* String value used when hooking to loadMoreItems event.
|
||||
*/
|
||||
public static loadMoreItemsEvent: string;
|
||||
|
||||
/**
|
||||
* Known template names.
|
||||
* Gets the native [android widget](http://developer.android.com/reference/android/widget/ListView.html) that represents the user interface for this component. Valid only when running on Android OS.
|
||||
*/
|
||||
export module knownTemplates {
|
||||
/**
|
||||
* The ListView item template.
|
||||
*/
|
||||
export var itemTemplate: string;
|
||||
}
|
||||
android: any /* android.widget.ListView */;
|
||||
|
||||
/**
|
||||
* Represents a view that shows items in a vertically scrolling list.
|
||||
* Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/) that represents the user interface for this component. Valid only when running on iOS.
|
||||
*/
|
||||
export class ListView extends View {
|
||||
/**
|
||||
* String value used when hooking to itemLoading event.
|
||||
*/
|
||||
public static itemLoadingEvent: string;
|
||||
/**
|
||||
* String value used when hooking to itemTap event.
|
||||
*/
|
||||
public static itemTapEvent: string;
|
||||
/**
|
||||
* String value used when hooking to loadMoreItems event.
|
||||
*/
|
||||
public static loadMoreItemsEvent: string;
|
||||
|
||||
/**
|
||||
* Gets the native [android widget](http://developer.android.com/reference/android/widget/ListView.html) that represents the user interface for this component. Valid only when running on Android OS.
|
||||
*/
|
||||
android: any /* android.widget.ListView */;
|
||||
|
||||
/**
|
||||
* Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/) that represents the user interface for this component. Valid only when running on iOS.
|
||||
*/
|
||||
ios: any /* UITableView */;
|
||||
|
||||
/**
|
||||
* Gets or set the items collection of the ListView.
|
||||
* The items property can be set to an array or an object defining length and getItem(index) method.
|
||||
*/
|
||||
items: any[] | ItemsSource;
|
||||
|
||||
/**
|
||||
* Gets or set the item template of the ListView.
|
||||
*/
|
||||
itemTemplate: string | Template;
|
||||
|
||||
/**
|
||||
* Gets or set the list of item templates for the item template selector
|
||||
*/
|
||||
itemTemplates: string | Array<KeyedTemplate>;
|
||||
|
||||
/**
|
||||
* A function that returns the appropriate ket template based on the data item.
|
||||
*/
|
||||
|
||||
itemTemplateSelector: string | ((item: any, index: number, items: any) => string);
|
||||
/**
|
||||
* Gets or set the items separator line color of the ListView.
|
||||
*/
|
||||
separatorColor: Color;
|
||||
|
||||
/**
|
||||
* Gets or set row height of the ListView.
|
||||
*/
|
||||
rowHeight: Length;
|
||||
|
||||
/**
|
||||
* Forces the ListView to reload all its items.
|
||||
*/
|
||||
refresh();
|
||||
|
||||
/**
|
||||
* Scrolls the specified item with index into view.
|
||||
* [iOS](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:)
|
||||
* [Android](http://developer.android.com/reference/android/widget/ListView.html#setSelection(int))
|
||||
* @param index - Item index.
|
||||
*/
|
||||
scrollToIndex(index: number);
|
||||
|
||||
/**
|
||||
* 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: EventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when a View for the data at the specified index should be created.
|
||||
* The result should be returned trough the view property of the event data.
|
||||
* Note, that the view property of the event data can be pre-initialized with
|
||||
* an old instance of a view, so that it can be reused.
|
||||
*/
|
||||
on(event: "itemLoading", callback: (args: ItemEventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when an item inside the ListView is tapped.
|
||||
*/
|
||||
on(event: "itemTap", callback: (args: ItemEventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when the ListView is scrolled so that its last item is visible.
|
||||
*/
|
||||
on(event: "loadMoreItems", callback: (args: EventData) => void, thisArg?: any);
|
||||
}
|
||||
ios: any /* UITableView */;
|
||||
|
||||
/**
|
||||
* Event data containing information for the index and the view associated to a list view item.
|
||||
* Gets or set the items collection of the ListView.
|
||||
* The items property can be set to an array or an object defining length and getItem(index) method.
|
||||
*/
|
||||
export interface ItemEventData extends EventData {
|
||||
/**
|
||||
* The index of the item, for which the event is raised.
|
||||
*/
|
||||
index: number;
|
||||
|
||||
/**
|
||||
* The view that is associated to the item, for which the event is raised.
|
||||
*/
|
||||
view: View;
|
||||
|
||||
/**
|
||||
* Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/) that represents the user interface where the view is hosted. Valid only when running on iOS.
|
||||
*/
|
||||
ios: any /* UITableViewCell */;
|
||||
|
||||
/**
|
||||
* Gets the native [android widget](http://developer.android.com/reference/android/view/ViewGroup.html) that represents the user interface where the view is hosted. Valid only when running on Android OS.
|
||||
*/
|
||||
android: any /* android.view.ViewGroup */;
|
||||
}
|
||||
|
||||
export interface ItemsSource {
|
||||
length: number;
|
||||
getItem(index: number): any;
|
||||
}
|
||||
items: any[] | ItemsSource;
|
||||
|
||||
/**
|
||||
* Represents the property backing the items property of each ListView instance.
|
||||
* Gets or set the item template of the ListView.
|
||||
*/
|
||||
export const itemsProperty: Property<ListView, any[] | ItemsSource>;
|
||||
itemTemplate: string | Template;
|
||||
|
||||
/**
|
||||
* Represents the item template property of each ListView instance.
|
||||
* Gets or set the list of item templates for the item template selector
|
||||
*/
|
||||
export const itemTemplateProperty: Property<ListView, string | Template>;
|
||||
itemTemplates: string | Array<KeyedTemplate>;
|
||||
|
||||
/**
|
||||
* Represents the items template property of each ListView instance.
|
||||
* A function that returns the appropriate ket template based on the data item.
|
||||
*/
|
||||
export const itemTemplatesProperty: Property<ListView, string | Array<KeyedTemplate>>;
|
||||
|
||||
itemTemplateSelector: string | ((item: any, index: number, items: any) => string);
|
||||
/**
|
||||
* Gets or set the items separator line color of the ListView.
|
||||
*/
|
||||
separatorColor: Color;
|
||||
|
||||
/**
|
||||
* Represents the separator color backing property.
|
||||
* Gets or set row height of the ListView.
|
||||
*/
|
||||
export const separatorColor: Property<ListView, Color>;
|
||||
rowHeight: Length;
|
||||
|
||||
/**
|
||||
* Represents the observable property backing the rowHeight property of each ListView instance.
|
||||
* Forces the ListView to reload all its items.
|
||||
*/
|
||||
export const rowHeightProperty: Property<ListView, Length>;
|
||||
refresh();
|
||||
|
||||
/**
|
||||
* Backing property for separator color property.
|
||||
* Scrolls the specified item with index into view.
|
||||
* [iOS](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:)
|
||||
* [Android](http://developer.android.com/reference/android/widget/ListView.html#setSelection(int))
|
||||
* @param index - Item index.
|
||||
*/
|
||||
export const separatorColorProperty: CssProperty<Style, Color>;
|
||||
}
|
||||
scrollToIndex(index: number);
|
||||
|
||||
/**
|
||||
* 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: EventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when a View for the data at the specified index should be created.
|
||||
* The result should be returned trough the view property of the event data.
|
||||
* Note, that the view property of the event data can be pre-initialized with
|
||||
* an old instance of a view, so that it can be reused.
|
||||
*/
|
||||
on(event: "itemLoading", callback: (args: ItemEventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when an item inside the ListView is tapped.
|
||||
*/
|
||||
on(event: "itemTap", callback: (args: ItemEventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when the ListView is scrolled so that its last item is visible.
|
||||
*/
|
||||
on(event: "loadMoreItems", callback: (args: EventData) => void, thisArg?: any);
|
||||
}
|
||||
|
||||
/**
|
||||
* Event data containing information for the index and the view associated to a list view item.
|
||||
*/
|
||||
export interface ItemEventData extends EventData {
|
||||
/**
|
||||
* The index of the item, for which the event is raised.
|
||||
*/
|
||||
index: number;
|
||||
|
||||
/**
|
||||
* The view that is associated to the item, for which the event is raised.
|
||||
*/
|
||||
view: View;
|
||||
|
||||
/**
|
||||
* Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/) that represents the user interface where the view is hosted. Valid only when running on iOS.
|
||||
*/
|
||||
ios: any /* UITableViewCell */;
|
||||
|
||||
/**
|
||||
* Gets the native [android widget](http://developer.android.com/reference/android/view/ViewGroup.html) that represents the user interface where the view is hosted. Valid only when running on Android OS.
|
||||
*/
|
||||
android: any /* android.view.ViewGroup */;
|
||||
}
|
||||
|
||||
export interface ItemsSource {
|
||||
length: number;
|
||||
getItem(index: number): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the property backing the items property of each ListView instance.
|
||||
*/
|
||||
export const itemsProperty: Property<ListView, any[] | ItemsSource>;
|
||||
|
||||
/**
|
||||
* Represents the item template property of each ListView instance.
|
||||
*/
|
||||
export const itemTemplateProperty: Property<ListView, string | Template>;
|
||||
|
||||
/**
|
||||
* Represents the items template property of each ListView instance.
|
||||
*/
|
||||
export const itemTemplatesProperty: Property<ListView, string | Array<KeyedTemplate>>;
|
||||
|
||||
/**
|
||||
* Represents the separator color backing property.
|
||||
*/
|
||||
export const separatorColor: Property<ListView, Color>;
|
||||
|
||||
/**
|
||||
* Represents the observable property backing the rowHeight property of each ListView instance.
|
||||
*/
|
||||
export const rowHeightProperty: Property<ListView, Length>;
|
||||
|
||||
/**
|
||||
* Backing property for separator color property.
|
||||
*/
|
||||
export const separatorColorProperty: CssProperty<Style, Color>;
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
{ "name" : "list-view",
|
||||
"main" : "list-view" }
|
||||
{
|
||||
"name" : "list-view",
|
||||
"main" : "list-view",
|
||||
"types" : "list-view.d.ts"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user