From 793e49acba52b148940ef090b67e1347996f7dc6 Mon Sep 17 00:00:00 2001 From: jseanxu Date: Wed, 9 Apr 2014 15:19:02 -0700 Subject: [PATCH] Provided an interface for the currentItem property. Fixed up some minor typing and visibility issues in ListView. --- winjs/winjs.d.ts | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/winjs/winjs.d.ts b/winjs/winjs.d.ts index c968b788b..716939ea0 100644 --- a/winjs/winjs.d.ts +++ b/winjs/winjs.d.ts @@ -3310,6 +3310,31 @@ declare module WinJS.UI { } + /** + * Used by ListView's currentItem API + **/ + interface IListViewItem { + /** + * Gets or sets index of the ListView item. + **/ + index?: number; + + /** + * Gets or sets key of the ListView item. + **/ + key?: string; + + /** + * Gets or sets whether the ListView item is focused. + **/ + hasFocus?: boolean; + + /** + * Gets or sets whether the ListView item is focused and is showing its focus visual. + **/ + showFocus?: boolean; + } + /** * Represents a selection of ListView items. **/ @@ -5330,10 +5355,10 @@ declare module WinJS.UI { **/ removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean): void; - /** - * Triggers the ListView disposal service manually. - **/ - triggerDispose(): void; + /** + * Triggers the ListView disposal service manually. + **/ + static triggerDispose(): void; //#endregion Methods @@ -5344,10 +5369,10 @@ declare module WinJS.UI { **/ automaticallyLoadPages: boolean; - /** - * Gets or sets an object that indicates which item should have keyboard focus and the focus state of that item. - **/ - currentItem: { index: number; key: string; hasFocus: boolean; showFocus: boolean }; + /** + * Gets or sets an IListViewItem that indicates which item should have keyboard focus and the focus state of that item. + **/ + currentItem: IListViewItem; /** * Gets the HTML element that hosts this ListView. @@ -5467,7 +5492,7 @@ declare module WinJS.UI { /** * Gets a ZoomableView that supports semantic zoom functionality. This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code. **/ - zoomableView: IZoomableView; + zoomableView: IZoomableView>; //#endregion Properties