Created
February 24, 2026 17:34
-
-
Save kennykerr/6eaf6ebb20fd5a9136523858a1306cfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mod Windows { | |
| mod Foundation { | |
| #[winrt] | |
| mod Collections { | |
| #[repr(i32)] | |
| enum CollectionChange { | |
| Reset = 0, | |
| ItemInserted = 1, | |
| ItemRemoved = 2, | |
| ItemChanged = 3, | |
| } | |
| interface IIterable<T> { | |
| fn First(&self) -> IIterator; | |
| } | |
| interface IIterator<T> { | |
| fn get_Current(&self) -> T; | |
| fn get_HasCurrent(&self) -> bool; | |
| fn MoveNext(&self) -> bool; | |
| fn GetMany(&self, items: [T]) -> u32; | |
| } | |
| interface IKeyValuePair<K, V> { | |
| fn get_Key(&self) -> K; | |
| fn get_Value(&self) -> V; | |
| } | |
| interface IMap<K, V> { | |
| fn Lookup(&self, key: K) -> V; | |
| fn get_Size(&self) -> u32; | |
| fn HasKey(&self, key: K) -> bool; | |
| fn GetView(&self) -> IMapView; | |
| fn Insert(&self, key: K, value: V) -> bool; | |
| fn Remove(&self, key: K); | |
| fn Clear(&self); | |
| } | |
| interface IMapChangedEventArgs<K> { | |
| fn get_CollectionChange(&self) -> CollectionChange; | |
| fn get_Key(&self) -> K; | |
| } | |
| interface IMapView<K, V> { | |
| fn Lookup(&self, key: K) -> V; | |
| fn get_Size(&self) -> u32; | |
| fn HasKey(&self, key: K) -> bool; | |
| fn Split(&self, first: &mut IMapView, second: &mut IMapView); | |
| } | |
| interface IObservableMap<K, V> { | |
| fn add_MapChanged(&self, vhnd: MapChangedEventHandler) -> super::EventRegistrationToken; | |
| fn remove_MapChanged(&self, token: super::EventRegistrationToken); | |
| } | |
| interface IObservableVector<T> { | |
| fn add_VectorChanged(&self, vhnd: VectorChangedEventHandler) -> super::EventRegistrationToken; | |
| fn remove_VectorChanged(&self, token: super::EventRegistrationToken); | |
| } | |
| interface IPropertySet {} | |
| interface IVector<T> { | |
| fn GetAt(&self, index: u32) -> T; | |
| fn get_Size(&self) -> u32; | |
| fn GetView(&self) -> IVectorView; | |
| fn IndexOf(&self, value: T, index: &mut u32) -> bool; | |
| fn SetAt(&self, index: u32, value: T); | |
| fn InsertAt(&self, index: u32, value: T); | |
| fn RemoveAt(&self, index: u32); | |
| fn Append(&self, value: T); | |
| fn RemoveAtEnd(&self); | |
| fn Clear(&self); | |
| fn GetMany(&self, startIndex: u32, items: [T]) -> u32; | |
| fn ReplaceAll(&self, items: [T]); | |
| } | |
| interface IVectorChangedEventArgs { | |
| fn get_CollectionChange(&self) -> CollectionChange; | |
| fn get_Index(&self) -> u32; | |
| } | |
| interface IVectorView<T> { | |
| fn GetAt(&self, index: u32) -> T; | |
| fn get_Size(&self) -> u32; | |
| fn IndexOf(&self, value: T, index: &mut u32) -> bool; | |
| fn GetMany(&self, startIndex: u32, items: [T]) -> u32; | |
| } | |
| delegate fn MapChangedEventHandler<K, V>(sender: IObservableMap, event: IMapChangedEventArgs); | |
| class PropertySet { | |
| #[default] | |
| IPropertySet, | |
| IObservableMap, | |
| IMap, | |
| IIterable, | |
| #[activatable(1)] | |
| super::FoundationContract, | |
| } | |
| class StringMap { | |
| #[default] | |
| IMap, | |
| IIterable, | |
| IObservableMap, | |
| #[activatable(1)] | |
| super::FoundationContract, | |
| } | |
| class ValueSet { | |
| #[default] | |
| IPropertySet, | |
| IObservableMap, | |
| IMap, | |
| IIterable, | |
| #[activatable(1)] | |
| super::FoundationContract, | |
| } | |
| delegate fn VectorChangedEventHandler<T>(sender: IObservableVector, event: IVectorChangedEventArgs); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mod Windows { | |
| #[winrt] | |
| mod Foundation { | |
| delegate fn AsyncActionCompletedHandler(asyncInfo: IAsyncAction, asyncStatus: AsyncStatus); | |
| delegate fn AsyncActionProgressHandler<TProgress>(asyncInfo: IAsyncActionWithProgress, progressInfo: TProgress); | |
| delegate fn AsyncActionWithProgressCompletedHandler<TProgress>(asyncInfo: IAsyncActionWithProgress, asyncStatus: AsyncStatus); | |
| delegate fn AsyncOperationCompletedHandler<TResult>(asyncInfo: IAsyncOperation, asyncStatus: AsyncStatus); | |
| delegate fn AsyncOperationProgressHandler<TResult, TProgress>(asyncInfo: IAsyncOperationWithProgress, progressInfo: TProgress); | |
| delegate fn AsyncOperationWithProgressCompletedHandler<TResult, TProgress>(asyncInfo: IAsyncOperationWithProgress, asyncStatus: AsyncStatus); | |
| #[repr(i32)] | |
| enum AsyncStatus { | |
| Canceled = 2, | |
| Completed = 1, | |
| Error = 3, | |
| Started = 0, | |
| } | |
| struct DateTime { | |
| UniversalTime: i64, | |
| } | |
| class Deferral { | |
| #[default] | |
| IDeferral, | |
| IClosable, | |
| #[activatable(1)] | |
| IDeferralFactory, | |
| } | |
| delegate fn DeferralCompletedHandler(); | |
| delegate fn EventHandler<T>(sender: Object, args: T); | |
| struct EventRegistrationToken { | |
| Value: i64, | |
| } | |
| struct FoundationContract {} | |
| class GuidHelper { | |
| #[statics(1)] | |
| IGuidHelperStatics, | |
| } | |
| struct HResult { | |
| Value: i32, | |
| } | |
| interface IAsyncAction { | |
| fn put_Completed(&self, handler: AsyncActionCompletedHandler); | |
| fn get_Completed(&self) -> AsyncActionCompletedHandler; | |
| fn GetResults(&self); | |
| } | |
| interface IAsyncActionWithProgress<TProgress> { | |
| fn put_Progress(&self, handler: AsyncActionProgressHandler); | |
| fn get_Progress(&self) -> AsyncActionProgressHandler; | |
| fn put_Completed(&self, handler: AsyncActionWithProgressCompletedHandler); | |
| fn get_Completed(&self) -> AsyncActionWithProgressCompletedHandler; | |
| fn GetResults(&self); | |
| } | |
| interface IAsyncInfo { | |
| fn get_Id(&self) -> u32; | |
| fn get_Status(&self) -> AsyncStatus; | |
| fn get_ErrorCode(&self) -> HResult; | |
| fn Cancel(&self); | |
| fn Close(&self); | |
| } | |
| interface IAsyncOperation<TResult> { | |
| fn put_Completed(&self, handler: AsyncOperationCompletedHandler); | |
| fn get_Completed(&self) -> AsyncOperationCompletedHandler; | |
| fn GetResults(&self) -> TResult; | |
| } | |
| interface IAsyncOperationWithProgress<TResult, TProgress> { | |
| fn put_Progress(&self, handler: AsyncOperationProgressHandler); | |
| fn get_Progress(&self) -> AsyncOperationProgressHandler; | |
| fn put_Completed(&self, handler: AsyncOperationWithProgressCompletedHandler); | |
| fn get_Completed(&self) -> AsyncOperationWithProgressCompletedHandler; | |
| fn GetResults(&self) -> TResult; | |
| } | |
| interface IClosable { | |
| fn Close(&self); | |
| } | |
| interface IDeferral { | |
| fn Complete(&self); | |
| } | |
| interface IDeferralFactory { | |
| fn Create(&self, handler: DeferralCompletedHandler) -> Deferral; | |
| } | |
| interface IGetActivationFactory { | |
| fn GetActivationFactory(&self, activatableClassId: String) -> Object; | |
| } | |
| interface IGuidHelperStatics { | |
| fn CreateNewGuid(&self) -> GUID; | |
| fn get_Empty(&self) -> GUID; | |
| fn Equals(&self, target: &GUID, value: &GUID) -> bool; | |
| } | |
| interface IMemoryBuffer { | |
| fn CreateReference(&self) -> IMemoryBufferReference; | |
| } | |
| interface IMemoryBufferFactory { | |
| fn Create(&self, capacity: u32) -> MemoryBuffer; | |
| } | |
| interface IMemoryBufferReference { | |
| fn get_Capacity(&self) -> u32; | |
| fn add_Closed(&self, handler: TypedEventHandler) -> EventRegistrationToken; | |
| fn remove_Closed(&self, cookie: EventRegistrationToken); | |
| } | |
| interface IPropertyValue { | |
| fn get_Type(&self) -> PropertyType; | |
| fn get_IsNumericScalar(&self) -> bool; | |
| fn GetUInt8(&self) -> u8; | |
| fn GetInt16(&self) -> i16; | |
| fn GetUInt16(&self) -> u16; | |
| fn GetInt32(&self) -> i32; | |
| fn GetUInt32(&self) -> u32; | |
| fn GetInt64(&self) -> i64; | |
| fn GetUInt64(&self) -> u64; | |
| fn GetSingle(&self) -> f32; | |
| fn GetDouble(&self) -> f64; | |
| fn GetChar16(&self) -> u16; | |
| fn GetBoolean(&self) -> bool; | |
| fn GetString(&self) -> String; | |
| fn GetGuid(&self) -> GUID; | |
| fn GetDateTime(&self) -> DateTime; | |
| fn GetTimeSpan(&self) -> TimeSpan; | |
| fn GetPoint(&self) -> Point; | |
| fn GetSize(&self) -> Size; | |
| fn GetRect(&self) -> Rect; | |
| fn GetUInt8Array(&self, value: &mut Array<u8>); | |
| fn GetInt16Array(&self, value: &mut Array<i16>); | |
| fn GetUInt16Array(&self, value: &mut Array<u16>); | |
| fn GetInt32Array(&self, value: &mut Array<i32>); | |
| fn GetUInt32Array(&self, value: &mut Array<u32>); | |
| fn GetInt64Array(&self, value: &mut Array<i64>); | |
| fn GetUInt64Array(&self, value: &mut Array<u64>); | |
| fn GetSingleArray(&self, value: &mut Array<f32>); | |
| fn GetDoubleArray(&self, value: &mut Array<f64>); | |
| fn GetChar16Array(&self, value: &mut Array<u16>); | |
| fn GetBooleanArray(&self, value: &mut Array<bool>); | |
| fn GetStringArray(&self, value: &mut Array<String>); | |
| fn GetInspectableArray(&self, value: &mut Array<Object>); | |
| fn GetGuidArray(&self, value: &mut Array<GUID>); | |
| fn GetDateTimeArray(&self, value: &mut Array<DateTime>); | |
| fn GetTimeSpanArray(&self, value: &mut Array<TimeSpan>); | |
| fn GetPointArray(&self, value: &mut Array<Point>); | |
| fn GetSizeArray(&self, value: &mut Array<Size>); | |
| fn GetRectArray(&self, value: &mut Array<Rect>); | |
| } | |
| interface IPropertyValueStatics { | |
| fn CreateEmpty(&self) -> Object; | |
| fn CreateUInt8(&self, value: u8) -> Object; | |
| fn CreateInt16(&self, value: i16) -> Object; | |
| fn CreateUInt16(&self, value: u16) -> Object; | |
| fn CreateInt32(&self, value: i32) -> Object; | |
| fn CreateUInt32(&self, value: u32) -> Object; | |
| fn CreateInt64(&self, value: i64) -> Object; | |
| fn CreateUInt64(&self, value: u64) -> Object; | |
| fn CreateSingle(&self, value: f32) -> Object; | |
| fn CreateDouble(&self, value: f64) -> Object; | |
| fn CreateChar16(&self, value: u16) -> Object; | |
| fn CreateBoolean(&self, value: bool) -> Object; | |
| fn CreateString(&self, value: String) -> Object; | |
| fn CreateInspectable(&self, value: Object) -> Object; | |
| fn CreateGuid(&self, value: GUID) -> Object; | |
| fn CreateDateTime(&self, value: DateTime) -> Object; | |
| fn CreateTimeSpan(&self, value: TimeSpan) -> Object; | |
| fn CreatePoint(&self, value: Point) -> Object; | |
| fn CreateSize(&self, value: Size) -> Object; | |
| fn CreateRect(&self, value: Rect) -> Object; | |
| fn CreateUInt8Array(&self, value: [u8]) -> Object; | |
| fn CreateInt16Array(&self, value: [i16]) -> Object; | |
| fn CreateUInt16Array(&self, value: [u16]) -> Object; | |
| fn CreateInt32Array(&self, value: [i32]) -> Object; | |
| fn CreateUInt32Array(&self, value: [u32]) -> Object; | |
| fn CreateInt64Array(&self, value: [i64]) -> Object; | |
| fn CreateUInt64Array(&self, value: [u64]) -> Object; | |
| fn CreateSingleArray(&self, value: [f32]) -> Object; | |
| fn CreateDoubleArray(&self, value: [f64]) -> Object; | |
| fn CreateChar16Array(&self, value: [u16]) -> Object; | |
| fn CreateBooleanArray(&self, value: [bool]) -> Object; | |
| fn CreateStringArray(&self, value: [String]) -> Object; | |
| fn CreateInspectableArray(&self, value: [Object]) -> Object; | |
| fn CreateGuidArray(&self, value: [GUID]) -> Object; | |
| fn CreateDateTimeArray(&self, value: [DateTime]) -> Object; | |
| fn CreateTimeSpanArray(&self, value: [TimeSpan]) -> Object; | |
| fn CreatePointArray(&self, value: [Point]) -> Object; | |
| fn CreateSizeArray(&self, value: [Size]) -> Object; | |
| fn CreateRectArray(&self, value: [Rect]) -> Object; | |
| } | |
| interface IReference<T> { | |
| fn get_Value(&self) -> T; | |
| } | |
| interface IReferenceArray<T> { | |
| fn get_Value(&self) -> Array<T>; | |
| } | |
| interface IStringable { | |
| fn ToString(&self) -> String; | |
| } | |
| interface IUriEscapeStatics { | |
| fn UnescapeComponent(&self, toUnescape: String) -> String; | |
| fn EscapeComponent(&self, toEscape: String) -> String; | |
| } | |
| interface IUriRuntimeClass { | |
| fn get_AbsoluteUri(&self) -> String; | |
| fn get_DisplayUri(&self) -> String; | |
| fn get_Domain(&self) -> String; | |
| fn get_Extension(&self) -> String; | |
| fn get_Fragment(&self) -> String; | |
| fn get_Host(&self) -> String; | |
| fn get_Password(&self) -> String; | |
| fn get_Path(&self) -> String; | |
| fn get_Query(&self) -> String; | |
| fn get_QueryParsed(&self) -> WwwFormUrlDecoder; | |
| fn get_RawUri(&self) -> String; | |
| fn get_SchemeName(&self) -> String; | |
| fn get_UserName(&self) -> String; | |
| fn get_Port(&self) -> i32; | |
| fn get_Suspicious(&self) -> bool; | |
| fn Equals(&self, pUri: Uri) -> bool; | |
| fn CombineUri(&self, relativeUri: String) -> Uri; | |
| } | |
| interface IUriRuntimeClassFactory { | |
| fn CreateUri(&self, uri: String) -> Uri; | |
| fn CreateWithRelativeUri(&self, baseUri: String, relativeUri: String) -> Uri; | |
| } | |
| interface IUriRuntimeClassWithAbsoluteCanonicalUri { | |
| fn get_AbsoluteCanonicalUri(&self) -> String; | |
| fn get_DisplayIri(&self) -> String; | |
| } | |
| interface IWwwFormUrlDecoderEntry { | |
| fn get_Name(&self) -> String; | |
| fn get_Value(&self) -> String; | |
| } | |
| interface IWwwFormUrlDecoderRuntimeClass { | |
| fn GetFirstValueByName(&self, name: String) -> String; | |
| } | |
| interface IWwwFormUrlDecoderRuntimeClassFactory { | |
| fn CreateWwwFormUrlDecoder(&self, query: String) -> WwwFormUrlDecoder; | |
| } | |
| class MemoryBuffer { | |
| #[default] | |
| IMemoryBuffer, | |
| IClosable, | |
| #[activatable(1)] | |
| IMemoryBufferFactory, | |
| } | |
| struct Point { | |
| X: f32, | |
| Y: f32, | |
| } | |
| #[repr(i32)] | |
| enum PropertyType { | |
| Empty = 0, | |
| UInt8 = 1, | |
| Int16 = 2, | |
| UInt16 = 3, | |
| Int32 = 4, | |
| UInt32 = 5, | |
| Int64 = 6, | |
| UInt64 = 7, | |
| Single = 8, | |
| Double = 9, | |
| Char16 = 10, | |
| Boolean = 11, | |
| String = 12, | |
| Inspectable = 13, | |
| DateTime = 14, | |
| TimeSpan = 15, | |
| Guid = 16, | |
| Point = 17, | |
| Size = 18, | |
| Rect = 19, | |
| OtherType = 20, | |
| UInt8Array = 1025, | |
| Int16Array = 1026, | |
| UInt16Array = 1027, | |
| Int32Array = 1028, | |
| UInt32Array = 1029, | |
| Int64Array = 1030, | |
| UInt64Array = 1031, | |
| SingleArray = 1032, | |
| DoubleArray = 1033, | |
| Char16Array = 1034, | |
| BooleanArray = 1035, | |
| StringArray = 1036, | |
| InspectableArray = 1037, | |
| DateTimeArray = 1038, | |
| TimeSpanArray = 1039, | |
| GuidArray = 1040, | |
| PointArray = 1041, | |
| SizeArray = 1042, | |
| RectArray = 1043, | |
| OtherTypeArray = 1044, | |
| } | |
| class PropertyValue { | |
| #[statics(1)] | |
| IPropertyValueStatics, | |
| } | |
| struct Rect { | |
| X: f32, | |
| Y: f32, | |
| Width: f32, | |
| Height: f32, | |
| } | |
| struct Size { | |
| Width: f32, | |
| Height: f32, | |
| } | |
| struct TimeSpan { | |
| Duration: i64, | |
| } | |
| delegate fn TypedEventHandler<TSender, TResult>(sender: TSender, args: TResult); | |
| struct UniversalApiContract {} | |
| class Uri { | |
| #[default] | |
| IUriRuntimeClass, | |
| IUriRuntimeClassWithAbsoluteCanonicalUri, | |
| IStringable, | |
| #[activatable(1)] | |
| IUriRuntimeClassFactory, | |
| #[statics(1)] | |
| IUriEscapeStatics, | |
| } | |
| class WwwFormUrlDecoder { | |
| #[default] | |
| IWwwFormUrlDecoderRuntimeClass, | |
| Collections::IVectorView, | |
| Collections::IIterable, | |
| #[activatable(1)] | |
| IWwwFormUrlDecoderRuntimeClassFactory, | |
| } | |
| class WwwFormUrlDecoderEntry { | |
| #[default] | |
| IWwwFormUrlDecoderEntry, | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment