From f844c0947a137399b8fb0e7135613b9e68797e16 Mon Sep 17 00:00:00 2001 From: Aurelien Souchet Date: Thu, 4 Jun 2015 16:35:13 +0200 Subject: [PATCH 1/2] added new pickers interface / methods to WinRT --- winrt/winrt.d.ts | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index ed4f33e77..8671e62e0 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -44,6 +44,17 @@ declare module Windows { clear(): void; first(): Windows.Foundation.Collections.IIterator>; } + export class ValueSet implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { + size: number; + onmapchanged: any/* TODO */; + lookup(key: string): any; + hasKey(key: string): boolean; + getView(): Windows.Foundation.Collections.IMapView; + insert(key: string, value: any): boolean; + remove(key: string): void; + clear(): void; + first(): Windows.Foundation.Collections.IIterator>; + } export interface IIterable { first(): Windows.Foundation.Collections.IIterator; } @@ -7940,7 +7951,7 @@ declare module Windows { control: Windows.Networking.Sockets.MessageWebSocketControl; information: Windows.Networking.Sockets.MessageWebSocketInformation; onmessagereceived: any/* TODO */; - close(): void; + close(): void; close(code: number, reason: string): void; } export class MessageWebSocketControl implements Windows.Networking.Sockets.IMessageWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { @@ -7980,7 +7991,7 @@ declare module Windows { control: Windows.Networking.Sockets.StreamWebSocketControl; information: Windows.Networking.Sockets.StreamWebSocketInformation; inputStream: Windows.Storage.Streams.IInputStream; - close(): void; + close(): void; close(code: number, reason: string): void; } export class StreamWebSocketControl implements Windows.Networking.Sockets.IStreamWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { @@ -10986,6 +10997,11 @@ declare module Windows { pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } + export interface IFileOpenPicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickMultipleFilesAndContinue(): void; + pickSingleFileAndContinue(): void; + } export interface IFileSavePicker { commitButtonText: string; defaultFileExtension: string; @@ -10996,6 +11012,10 @@ declare module Windows { suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } + export interface IFileSavePicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickSaveFileAndContinue(): void; + } export interface IFolderPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; @@ -11004,16 +11024,23 @@ declare module Windows { viewMode: Windows.Storage.Pickers.PickerViewMode; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } - export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker { + export interface IFolderPicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickFolderAndContinue(): void; + } + export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker, Windows.Storage.Pickers.IFileOpenPicker2 { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + continuationData: Windows.Foundation.Collections.ValueSet; + pickSingleFileAndContinue(): void; pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; + pickMultipleFilesAndContinue(): void; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } - export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker { + export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker, Windows.Storage.Pickers.IFileSavePicker2 { commitButtonText: string; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; @@ -11021,14 +11048,18 @@ declare module Windows { suggestedFileName: string; suggestedSaveFile: Windows.Storage.StorageFile; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; + continuationData: Windows.Foundation.Collections.ValueSet; + pickSaveFileAndContinue(): void; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } - export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker { + export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker, Windows.Storage.Pickers.IFolderPicker2 { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + continuationData: Windows.Foundation.Collections.ValueSet; + pickFolderAndContinue(): void; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } } @@ -14750,4 +14781,4 @@ declare module Windows.Foundation { dispatchEvent?(type: string, details: any): boolean; removeEventListener?(eventType: string, listener: Function, capture?: boolean): void; } -} +} \ No newline at end of file From 743ed605df86ad4e7df91c0f8ae30b763666b5e7 Mon Sep 17 00:00:00 2001 From: Aurelien Souchet Date: Tue, 9 Jun 2015 11:06:18 +0200 Subject: [PATCH 2/2] merging interfaces --- winrt/winrt.d.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 8671e62e0..b8b40f7cd 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -10990,45 +10990,39 @@ declare module Windows { } export interface IFileOpenPicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IFileOpenPicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; pickMultipleFilesAndContinue(): void; + pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; pickSingleFileAndContinue(): void; + pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; } export interface IFileSavePicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; settingsIdentifier: string; suggestedFileName: string; suggestedSaveFile: Windows.Storage.StorageFile; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IFileSavePicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; pickSaveFileAndContinue(): void; + pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } export interface IFolderPicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + pickFolderAndContinue(): void; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } - export interface IFolderPicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; - pickFolderAndContinue(): void; - } - export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker, Windows.Storage.Pickers.IFileOpenPicker2 { + export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; @@ -11040,7 +11034,7 @@ declare module Windows { pickMultipleFilesAndContinue(): void; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } - export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker, Windows.Storage.Pickers.IFileSavePicker2 { + export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker { commitButtonText: string; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; @@ -11052,7 +11046,7 @@ declare module Windows { pickSaveFileAndContinue(): void; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } - export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker, Windows.Storage.Pickers.IFolderPicker2 { + export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string;