-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTestComponent.idl
More file actions
664 lines (581 loc) · 35.6 KB
/
TestComponent.idl
File metadata and controls
664 lines (581 loc) · 35.6 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// NOTE: The majority of this is derived from https://github.com/microsoft/TestWinRT. The implementation has diverged,
// however because (1) these tests were added in the early phases of development, and (2) the TestWinRT project does not
// cover several scenarios that are interesting to JavaScript.
namespace TestComponent
{
[contractversion(10)]
apicontract TestContract {};
[contract(TestContract, 1)]
enum TestEnum
{
First = 1,
Second = 2,
Third = 3,
Fourth = 4,
};
// All of these are represented as a 'number' in JavaScript
[contract(TestContract, 1)]
struct NumericTypes
{
UInt8 U8;
UInt16 U16;
UInt32 U32;
UInt64 U64;
Int16 S16;
Int32 S32;
Int64 S64;
Single F32;
Double F64;
TestEnum Enum;
// TODO: IReference here and elsewhere? Or as its own?
};
// All of these are represented as 'string' in JavaScript
[contract(TestContract, 1)]
struct StringTypes
{
Char Char;
String String;
Guid Guid;
};
// All of these are represented as 'boolean' in JavaScript
[contract(TestContract, 1)]
struct BooleanTypes
{
Boolean Value;
};
[contract(TestContract, 1)]
struct CompositeType
{
NumericTypes Numerics;
StringTypes Strings;
BooleanTypes Bools;
};
// Used in places where we want to validate returning/accepting/etc. types of an object type
[contract(TestContract, 1)]
runtimeclass TestObject
{
// This is purposefully not no-arg constructible so that we get compilation errors if the code gen gets this wrong
TestObject(Int32 val);
Int32 Value{ get; };
}
[contract(TestContract, 1)]
interface ITestInterface
{
Int32 MagicValue { get; }; // 42
}
// Delegates
delegate Boolean BoolDelegate(Boolean value);
delegate Char CharDelegate(Char value);
delegate Int32 NumericDelegate(Int32 value);
delegate String StringDelegate(String value);
delegate Guid GuidDelegate(Guid value);
delegate TestEnum EnumDelegate(TestEnum value);
delegate CompositeType CompositeStructDelegate(CompositeType value);
delegate Windows.Foundation.IReference<Int32> RefDelegate(Windows.Foundation.IReference<Int32> value);
delegate TestObject ObjectDelegate(TestObject value);
// Delegates with out params
delegate void BoolDelegateWithOutParam(Boolean value, out Boolean outValue);
delegate void CharDelegateWithOutParam(Char value, out Char outValue);
delegate void NumericDelegateWithOutParam(Int32 value, out Int32 outValue);
delegate void StringDelegateWithOutParam(String value, out String outValue);
delegate void GuidDelegateWithOutParam(Guid value, out Guid outValue);
delegate void EnumDelegateWithOutParam(TestEnum value, out TestEnum outValue);
delegate void CompositeStructDelegateWithOutParam(CompositeType value, out CompositeType outValue);
delegate void RefDelegateWithOutParam(Windows.Foundation.IReference<Int32> value, out Windows.Foundation.IReference<Int32> outValue);
delegate void ObjectDelegateWithOutParam(TestObject value, out TestObject outValue);
// Delegates with array types
delegate Boolean[] BoolArrayDelegate(Boolean[] values, ref Boolean[] subset, out Boolean[] outValue);
delegate Char[] CharArrayDelegate(Char[] values, ref Char[] subset, out Char[] outValue);
delegate Int32[] NumericArrayDelegate(Int32[] values, ref Int32[] subset, out Int32[] outValue);
delegate String[] StringArrayDelegate(String[] values, ref String[] subset, out String[] outValue);
delegate Guid[] GuidArrayDelegate(Guid[] values, ref Guid[] subset, out Guid[] outValue);
delegate TestEnum[] EnumArrayDelegate(TestEnum[] values, ref TestEnum[] subset, out TestEnum[] outValue);
delegate CompositeType[] CompositeStructArrayDelegate(CompositeType[] values, ref CompositeType[] subset, out CompositeType[] outValue);
delegate Windows.Foundation.IReference<Int32>[] RefArrayDelegate(
Windows.Foundation.IReference<Int32>[] values,
ref Windows.Foundation.IReference<Int32>[] subset,
out Windows.Foundation.IReference<Int32>[] outValue);
delegate TestObject[] ObjectArrayDelegate(TestObject[] values, ref TestObject[] subset, out TestObject[] outValue);
// Delegate with "interwoven" in/out params
delegate UInt32 InterwovenDelegate(Boolean inBool, out Boolean outBool, Int32 inNumeric, out Int32 outNumeric,
Int32[] inArray, out Int32[] outArray, ref Int32[] fillArray);
[contract(TestContract, 1)]
runtimeclass Test
{
// Constructors
Test();
Test(Int32 val);
Test(Int32 val, String str);
Int32 ConstructorParamCount{ get; }; // To validate which constructor was called
// Infra helpers
static void LogFailures(String failures);
// Static properties
static Boolean StaticBoolProperty { get; };
[contract(TestContract, 2)]
{
static Boolean StaticBoolProperty { set; };
}
static Char StaticCharProperty;
static UInt8 StaticU8Property;
static UInt16 StaticU16Property;
static UInt32 StaticU32Property;
static UInt64 StaticU64Property;
static Int16 StaticS16Property;
static Int32 StaticS32Property;
static Int64 StaticS64Property;
static Single StaticF32Property;
static Double StaticF64Property;
static String StaticStringProperty;
static Guid StaticGuidProperty;
static TestEnum StaticEnumProperty;
static NumericTypes StaticNumericsStructProperty;
static StringTypes StaticStringsStructProperty;
static BooleanTypes StaticBooleansStructProperty;
static CompositeType StaticCompositeStructProperty;
static Windows.Foundation.IReference<Boolean> StaticRefBooleanProperty;
static Windows.Foundation.IReference<Char> StaticRefCharProperty;
static Windows.Foundation.IReference<Int32> StaticRefNumericProperty;
static Windows.Foundation.IReference<TestEnum> StaticRefEnumProperty;
static TestObject StaticObjectProperty;
// Static array properties
static Boolean[] StaticBooleanArrayProperty;
static Char[] StaticCharArrayProperty;
static Int32[] StaticNumericArrayProperty;
static String[] StaticStringArrayProperty;
static Guid[] StaticGuidArrayProperty;
static TestEnum[] StaticEnumArrayProperty;
static CompositeType[] StaticCompositeStructArrayProperty;
static Windows.Foundation.IReference<Int32>[] StaticRefArrayProperty;
static TestObject[] StaticObjectArrayProperty;
// Static functions
static Boolean StaticOr(Boolean lhs, Boolean rhs);
static Boolean StaticOrAll(Boolean[] values);
static Int32 StaticAdd(Int32 lhs, Int32 rhs);
static Int32 StaticAddAll(Int32[] values);
static String StaticAppend(String a, Char b, String c);
static String StaticAppendAll(String[] values);
// Static function overloads
static String StaticArityOverload();
static String StaticArityOverload(String str);
static String StaticArityOverload(String first, String second);
static String StaticDefaultOverload(String str, Boolean val);
[default_overload]
static String StaticDefaultOverload(String str, Int32 repeat);
static String StaticDefaultOverload(String str, UInt32 val);
static String StaticOutParamOverload(String str);
[default_overload]
static String StaticOutParamOverload(String str, out String outParam);
[default_overload]
static String StaticOutParamOverload(String str, String other);
static String StaticContractArityOverload();
static String StaticContractDefaultOverloadV1(String str, Boolean val);
[default_overload]
static String StaticContractDefaultOverloadV1(String str, Int32 repeat);
static String StaticContractDefaultOverloadV1(String str, UInt32 val);
static String StaticContractDefaultOverloadV2(String str, Double val);
static String StaticContractOutParamOverloadV1(String str);
[default_overload]
static String StaticContractOutParamOverloadV1(String str, out String outParam);
[default_overload]
static String StaticContractOutParamOverloadV1(String str, String other);
static String StaticContractOutParamOverloadV2(Char ch);
// "v2" overloads
[contract(TestContract, 2)]
{
[overload("StaticContractArityOverload")]
static String StaticContractArityOverload(String str);
[overload("StaticContractDefaultOverloadV1")]
static String StaticContractDefaultOverloadV1(String str, Double val);
static String StaticContractDefaultOverloadV2(String str, Boolean val);
[default_overload]
static String StaticContractDefaultOverloadV2(String str, Int32 val);
static String StaticContractDefaultOverloadV2(String str, UInt32 val);
[overload("StaticContractOutParamOverloadV1")]
static String StaticContractOutParamOverloadV1(Char ch);
static String StaticContractOutParamOverloadV2(String str);
[default_overload]
static String StaticContractOutParamOverloadV2(String str, out String outParam);
[default_overload]
static String StaticContractOutParamOverloadV2(String str, String other);
}
// Static out params
static Boolean StaticBoolOutParam(Boolean lhs, Boolean rhs, out Boolean andResult, out Boolean orResult);
static Char StaticCharOutParam(Char value, out Char next, out Char prev);
static Int32 StaticNumericOutParam(Int32 value, out Int32 doubledValue, out Int32 tripledValue);
static String StaticStringOutParam(String value, out String lower, out String upper);
static Guid StaticGuidOutParam(Guid value, out Guid zero, out Guid allSet);
static TestEnum StaticEnumOutParam(TestEnum value, out TestEnum plusOne, out TestEnum plusTwo);
static CompositeType StaticCompositeStructOutParam(CompositeType input, out CompositeType first, out CompositeType second);
static Windows.Foundation.IReference<Int32> StaticRefOutParam(
Windows.Foundation.IReference<Int32> value,
out Windows.Foundation.IReference<Int32> doubledValue,
out Windows.Foundation.IReference<Int32> tripledValue);
static TestObject StaticObjectOutParam(TestObject value, out TestObject doubledValue, out TestObject tripledValue);
// Static array out params
static Boolean[] StaticBoolArrayOutParam(Boolean[] values, out Boolean[] rot1, out Boolean[] rot2);
static Char[] StaticCharArrayOutParam(Char[] values, out Char[] rot1, out Char[] rot2);
static Int32[] StaticNumericArrayOutParam(Int32[] values, out Int32[] rot1, out Int32[] rot2);
static String[] StaticStringArrayOutParam(String[] values, out String[] rot1, out String[] rot2);
static Guid[] StaticGuidArrayOutParam(Guid[] values, out Guid[] rot1, out Guid[] rot2);
static TestEnum[] StaticEnumArrayOutParam(TestEnum[] values, out TestEnum[] rot1, out TestEnum[] rot2);
static CompositeType[] StaticCompositeStructArrayOutParam(CompositeType[] values, out CompositeType[] rot1, out CompositeType[] rot2);
static Windows.Foundation.IReference<Int32>[] StaticRefArrayOutParam(
Windows.Foundation.IReference<Int32>[] values,
out Windows.Foundation.IReference<Int32>[] rot1,
out Windows.Foundation.IReference<Int32>[] rot2);
static TestObject[] StaticObjectArrayOutParam(TestObject[] values, out TestObject[] rot1, out TestObject[] rot2);
// Static array fill params
static void StaticBoolFillParam(ref Boolean[] values);
static void StaticCharFillParam(ref Char[] values);
static void StaticNumericFillParam(ref Int32[] values);
static void StaticStringFillParam(ref String[] values);
static void StaticGuidFillParam(ref Guid[] values);
static void StaticEnumFillParam(ref TestEnum[] values);
static void StaticCompositeStructFillParam(ref CompositeType[] values);
static void StaticRefFillParam(ref Windows.Foundation.IReference<Int32>[] values);
static void StaticObjectFillParam(ref TestObject[] values);
// Static "interwoven" in/out params
static UInt32 StaticInterwovenParams(Boolean inBool, out Boolean outBool, Int32 inNumeric, out Int32 outNumeric,
Int32[] inArray, out Int32[] outArray, ref Int32[] refArray);
// Static events
static event Windows.Foundation.EventHandler<Boolean> StaticBoolEventHandler;
static event Windows.Foundation.EventHandler<Char> StaticCharEventHandler;
static event Windows.Foundation.EventHandler<Int32> StaticNumericEventHandler;
static event Windows.Foundation.EventHandler<String> StaticStringEventHandler;
static event Windows.Foundation.EventHandler<Guid> StaticGuidEventHandler;
static event Windows.Foundation.EventHandler<TestEnum> StaticEnumEventHandler;
static event Windows.Foundation.EventHandler<CompositeType> StaticCompositeStructEventHandler;
static event Windows.Foundation.EventHandler<Windows.Foundation.IReference<Int32> > StaticRefEventHandler;
static event Windows.Foundation.EventHandler<TestObject> StaticObjectEventHandler;
// Static event triggers
static void RaiseStaticBoolEvent(Boolean value);
static void RaiseStaticCharEvent(Char value);
static void RaiseStaticNumericEvent(Int32 value);
static void RaiseStaticStringEvent(String value);
static void RaiseStaticGuidEvent(Guid value);
static void RaiseStaticEnumEvent(TestEnum value);
static void RaiseStaticCompositeStructEvent(CompositeType value);
static void RaiseStaticRefEvent(Windows.Foundation.IReference<Int32> value);
static void RaiseStaticObjectEvent(TestObject value);
// Trigger event on a background thread
static Windows.Foundation.IAsyncAction RaiseStaticNumericEventAsync(Int32 value);
// Static delegate invocation
static Boolean StaticInvokeBoolDelegate(Boolean value, BoolDelegate targetFn);
static Char StaticInvokeCharDelegate(Char value, CharDelegate targetFn);
static Int32 StaticInvokeNumericDelegate(Int32 value, NumericDelegate targetFn);
static String StaticInvokeStringDelegate(String value, StringDelegate targetFn);
static Guid StaticInvokeGuidDelegate(Guid value, GuidDelegate targetFn);
static TestEnum StaticInvokeEnumDelegate(TestEnum value, EnumDelegate targetFn);
static CompositeType StaticInvokeCompositeStructDelegate(CompositeType value, CompositeStructDelegate targetFn);
static Windows.Foundation.IReference<Int32> StaticInvokeRefDelegate(Windows.Foundation.IReference<Int32> value, RefDelegate targetFn);
static TestObject StaticInvokeObjectDelegate(TestObject value, ObjectDelegate targetFn);
static Boolean StaticInvokeBoolDelegateWithOutParam(Boolean value, BoolDelegateWithOutParam targetFn);
static Char StaticInvokeCharDelegateWithOutParam(Char value, CharDelegateWithOutParam targetFn);
static Int32 StaticInvokeNumericDelegateWithOutParam(Int32 value, NumericDelegateWithOutParam targetFn);
static String StaticInvokeStringDelegateWithOutParam(String value, StringDelegateWithOutParam targetFn);
static Guid StaticInvokeGuidDelegateWithOutParam(Guid value, GuidDelegateWithOutParam targetFn);
static TestEnum StaticInvokeEnumDelegateWithOutParam(TestEnum value, EnumDelegateWithOutParam targetFn);
static CompositeType StaticInvokeCompositeStructDelegateWithOutParam(CompositeType value, CompositeStructDelegateWithOutParam targetFn);
static Windows.Foundation.IReference<Int32> StaticInvokeRefDelegateWithOutParam(
Windows.Foundation.IReference<Int32> value,
RefDelegateWithOutParam targetFn);
static TestObject StaticInvokeObjectDelegateWithOutParam(TestObject value, ObjectDelegateWithOutParam targetFn);
static Boolean StaticInvokeBoolArrayDelegate(Boolean[] values, BoolArrayDelegate targetFn);
static Boolean StaticInvokeCharArrayDelegate(Char[] values, CharArrayDelegate targetFn);
static Boolean StaticInvokeNumericArrayDelegate(Int32[] values, NumericArrayDelegate targetFn);
static Boolean StaticInvokeStringArrayDelegate(String[] values, StringArrayDelegate targetFn);
static Boolean StaticInvokeGuidArrayDelegate(Guid[] values, GuidArrayDelegate targetFn);
static Boolean StaticInvokeEnumArrayDelegate(TestEnum[] values, EnumArrayDelegate targetFn);
static Boolean StaticInvokeCompositeStructArrayDelegate(CompositeType[] values, CompositeStructArrayDelegate targetFn);
static Boolean StaticInvokeRefArrayDelegate(Windows.Foundation.IReference<Int32>[] values, RefArrayDelegate targetFn);
static Boolean StaticInvokeObjectArrayDelegate(TestObject[] values, ObjectArrayDelegate targetFn);
static Boolean StaticInvokeInterwovenDelegate(Boolean inBool, Int32 inNumeric, Int32[] inArray, InterwovenDelegate targetFn);
// Copy array to IVector
static Windows.Foundation.Collections.IVector<Boolean> CopyBoolsToVector(Boolean[] values);
static Windows.Foundation.Collections.IVector<Char> CopyCharsToVector(Char[] values);
static Windows.Foundation.Collections.IVector<Int32> CopyNumericsToVector(Int32[] values);
static Windows.Foundation.Collections.IVector<String> CopyStringsToVector(String[] values);
static Windows.Foundation.Collections.IVector<Guid> CopyGuidsToVector(Guid[] values);
static Windows.Foundation.Collections.IVector<TestEnum> CopyEnumValuesToVector(TestEnum[] values);
static Windows.Foundation.Collections.IVector<CompositeType> CopyCompositeStructsToVector(CompositeType[] values);
static Windows.Foundation.Collections.IVector<Windows.Foundation.IReference<Int32> > CopyRefsToVector(
Windows.Foundation.IReference<Int32>[] values);
static Windows.Foundation.Collections.IVector<TestObject> CopyObjectsToVector(TestObject[] values);
// TODO: These exist mostly because C++/WinRT's 'GetView' implementation currently returns the 'this' object
static Windows.Foundation.Collections.IVectorView<Boolean> CopyBoolsToVectorView(Boolean[] values);
static Windows.Foundation.Collections.IVectorView<Char> CopyCharsToVectorView(Char[] values);
static Windows.Foundation.Collections.IVectorView<Int32> CopyNumericsToVectorView(Int32[] values);
static Windows.Foundation.Collections.IVectorView<String> CopyStringsToVectorView(String[] values);
static Windows.Foundation.Collections.IVectorView<Guid> CopyGuidsToVectorView(Guid[] values);
static Windows.Foundation.Collections.IVectorView<TestEnum> CopyEnumValuesToVectorView(TestEnum[] values);
static Windows.Foundation.Collections.IVectorView<CompositeType> CopyCompositeStructsToVectorView(CompositeType[] values);
static Windows.Foundation.Collections.IVectorView<Windows.Foundation.IReference<Int32> > CopyRefsToVectorView(
Windows.Foundation.IReference<Int32>[] values);
static Windows.Foundation.Collections.IVectorView<Object> CopyObjectsToVectorView(Object[] values);
// Observable collections
static Windows.Foundation.Collections.IObservableVector<Int32> MakeObservableVector();
static Windows.Foundation.Collections.IObservableMap<String, Int32> MakeObservableMap();
// Convert array to IVector
static Windows.Foundation.Collections.IVector<Boolean> ReturnSameBoolVector(Windows.Foundation.Collections.IVector<Boolean> vector);
static Windows.Foundation.Collections.IVector<Char> ReturnSameCharVector(Windows.Foundation.Collections.IVector<Char> vector);
static Windows.Foundation.Collections.IVector<Int32> ReturnSameNumericVector(Windows.Foundation.Collections.IVector<Int32> vector);
static Windows.Foundation.Collections.IVector<String> ReturnSameStringVector(Windows.Foundation.Collections.IVector<String> vector);
static Windows.Foundation.Collections.IVector<Guid> ReturnSameGuidVector(Windows.Foundation.Collections.IVector<Guid> vector);
static Windows.Foundation.Collections.IVector<TestEnum> ReturnSameEnumVector(Windows.Foundation.Collections.IVector<TestEnum> vector);
static Windows.Foundation.Collections.IVector<CompositeType> ReturnSameCompositeStructVector(Windows.Foundation.Collections.IVector<CompositeType> vector);
static Windows.Foundation.Collections.IVector<Windows.Foundation.IReference<Int32> > ReturnSameRefVector(
Windows.Foundation.Collections.IVector<Windows.Foundation.IReference<Int32> > vector);
static Windows.Foundation.Collections.IVector<TestObject> ReturnSameObjectVector(Windows.Foundation.Collections.IVector<TestObject> vector);
// Convert array to IVectorView
static Windows.Foundation.Collections.IVectorView<Boolean> ReturnSameBoolVectorView(Windows.Foundation.Collections.IVectorView<Boolean> vector);
static Windows.Foundation.Collections.IVectorView<Char> ReturnSameCharVectorView(Windows.Foundation.Collections.IVectorView<Char> vector);
static Windows.Foundation.Collections.IVectorView<Int32> ReturnSameNumericVectorView(Windows.Foundation.Collections.IVectorView<Int32> vector);
static Windows.Foundation.Collections.IVectorView<String> ReturnSameStringVectorView(Windows.Foundation.Collections.IVectorView<String> vector);
static Windows.Foundation.Collections.IVectorView<Guid> ReturnSameGuidVectorView(Windows.Foundation.Collections.IVectorView<Guid> vector);
static Windows.Foundation.Collections.IVectorView<TestEnum> ReturnSameEnumVectorView(Windows.Foundation.Collections.IVectorView<TestEnum> vector);
static Windows.Foundation.Collections.IVectorView<CompositeType> ReturnSameCompositeStructVectorView(Windows.Foundation.Collections.IVectorView<CompositeType> vector);
static Windows.Foundation.Collections.IVectorView<Windows.Foundation.IReference<Int32> > ReturnSameRefVectorView(
Windows.Foundation.Collections.IVectorView<Windows.Foundation.IReference<Int32> > vector);
static Windows.Foundation.Collections.IVectorView<TestObject> ReturnSameObjectVectorView(Windows.Foundation.Collections.IVectorView<TestObject> vector);
// Convert array to IIterable
static Windows.Foundation.Collections.IIterable<Boolean> ReturnSameBoolIterable(Windows.Foundation.Collections.IIterable<Boolean> iterable);
static Windows.Foundation.Collections.IIterable<Char> ReturnSameCharIterable(Windows.Foundation.Collections.IIterable<Char> iterable);
static Windows.Foundation.Collections.IIterable<Int32> ReturnSameNumericIterable(Windows.Foundation.Collections.IIterable<Int32> iterable);
static Windows.Foundation.Collections.IIterable<String> ReturnSameStringIterable(Windows.Foundation.Collections.IIterable<String> iterable);
static Windows.Foundation.Collections.IIterable<Guid> ReturnSameGuidIterable(Windows.Foundation.Collections.IIterable<Guid> iterable);
static Windows.Foundation.Collections.IIterable<TestEnum> ReturnSameEnumIterable(Windows.Foundation.Collections.IIterable<TestEnum> iterable);
static Windows.Foundation.Collections.IIterable<CompositeType> ReturnSameCompositeStructIterable(Windows.Foundation.Collections.IIterable<CompositeType> iterable);
static Windows.Foundation.Collections.IIterable<Windows.Foundation.IReference<Int32> > ReturnSameRefIterable(
Windows.Foundation.Collections.IIterable<Windows.Foundation.IReference<Int32> > iterable);
static Windows.Foundation.Collections.IIterable<TestObject> ReturnSameObjectIterable(Windows.Foundation.Collections.IIterable<TestObject> iterable);
// IMap
static Windows.Foundation.Collections.IMap<String, Int32> CreateStringToNumberMap();
static Windows.Foundation.Collections.IMapView<String, Int32> CopyToMapView(
Windows.Foundation.Collections.IMap<String, Int32> stringToNumberMap);
// Async
static Windows.Foundation.IAsyncAction PauseAsync(Int32 milliseconds);
static Windows.Foundation.IAsyncActionWithProgress<Int32> CountToNumberAsync(Int32 value);
static Windows.Foundation.IAsyncOperation<Int32> AddAsync(Int32 lhs, Int32 rhs);
static Windows.Foundation.IAsyncOperationWithProgress<Int32, Int32> CountDoubleAsync(Int32 value);
static Windows.Foundation.IAsyncAction ThrowAsyncException();
static Windows.Foundation.IAsyncOperation<Int32> ImmediateReturnAsync(Int32 value);
// Member properties
Boolean BoolProperty { get; };
[contract(TestContract, 2)]
{
Boolean BoolProperty { set; };
}
Char CharProperty;
UInt8 U8Property;
UInt16 U16Property;
UInt32 U32Property;
UInt64 U64Property;
Int16 S16Property;
Int32 S32Property;
Int64 S64Property;
Single F32Property;
Double F64Property;
String StringProperty;
Guid GuidProperty;
TestEnum EnumProperty;
NumericTypes NumericsStructProperty;
StringTypes StringsStructProperty;
BooleanTypes BooleansStructProperty;
CompositeType CompositeStructProperty;
Windows.Foundation.IReference<Boolean> RefBooleanProperty;
Windows.Foundation.IReference<Char> RefCharProperty;
Windows.Foundation.IReference<Int32> RefNumericProperty;
Windows.Foundation.IReference<TestEnum> RefEnumProperty;
TestObject ObjectProperty;
Windows.Foundation.DateTime DateTimeProperty;
String DateTimePropertyCppValue();
Windows.Foundation.TimeSpan TimeSpanProperty;
String TimeSpanPropertyCppValue();
HRESULT HResultProperty;
Windows.Foundation.IPropertyValue PropertyValue;
String PropertyValueCppType { get; };
void AssignPropertyValueAsType(Windows.Foundation.IPropertyValue value, String winrtPropertyValueType);
// Member array properties
Boolean[] BooleanArrayProperty;
Char[] CharArrayProperty;
Int32[] NumericArrayProperty;
String[] StringArrayProperty;
Guid[] GuidArrayProperty;
TestEnum[] EnumArrayProperty;
CompositeType[] CompositeStructArrayProperty;
Windows.Foundation.IReference<Int32>[] RefArrayProperty;
TestObject[] ObjectArrayProperty;
// Member functions
Boolean Or(Boolean lhs, Boolean rhs);
Boolean OrAll(Boolean[] values);
Int32 Add(Int32 lhs, Int32 rhs);
Int32 AddAll(Int32[] values);
String Append(String a, Char b, String c);
String AppendAll(String[] values);
// Static function overloads
String ArityOverload();
String ArityOverload(String str);
String ArityOverload(String first, String second);
String DefaultOverload(String str, Boolean val);
[default_overload]
String DefaultOverload(String str, Int32 repeat);
String DefaultOverload(String str, UInt32 val);
String OutParamOverload(String str);
[default_overload]
String OutParamOverload(String str, out String outParam);
[default_overload]
String OutParamOverload(String str, String other);
String ContractArityOverload();
String ContractDefaultOverloadV1(String str, Boolean val);
[default_overload]
String ContractDefaultOverloadV1(String str, Int32 repeat);
String ContractDefaultOverloadV1(String str, UInt32 val);
String ContractDefaultOverloadV2(String str, Double val);
String ContractOutParamOverloadV1(String str);
[default_overload]
String ContractOutParamOverloadV1(String str, out String outParam);
[default_overload]
String ContractOutParamOverloadV1(String str, String other);
String ContractOutParamOverloadV2(Char ch);
// "v2" overloads
[contract(TestContract, 2)]
{
[overload("ContractArityOverload")]
String ContractArityOverload(String str);
[overload("ContractDefaultOverloadV1")]
String ContractDefaultOverloadV1(String str, Double val);
String ContractDefaultOverloadV2(String str, Boolean val);
[default_overload]
String ContractDefaultOverloadV2(String str, Int32 val);
String ContractDefaultOverloadV2(String str, UInt32 val);
[overload("ContractOutParamOverloadV1")]
String ContractOutParamOverloadV1(Char ch);
String ContractOutParamOverloadV2(String str);
[default_overload]
String ContractOutParamOverloadV2(String str, out String outParam);
[default_overload]
String ContractOutParamOverloadV2(String str, String other);
}
// Member out params
Boolean BoolOutParam(Boolean lhs, Boolean rhs, out Boolean andResult, out Boolean orResult);
Char CharOutParam(Char value, out Char next, out Char prev);
Int32 NumericOutParam(Int32 value, out Int32 doubledValue, out Int32 tripledValue);
String StringOutParam(String value, out String lower, out String upper);
Guid GuidOutParam(Guid value, out Guid zero, out Guid allSet);
TestEnum EnumOutParam(TestEnum value, out TestEnum plusOne, out TestEnum plusTwo);
CompositeType CompositeStructOutParam(CompositeType input, out CompositeType first, out CompositeType second);
Windows.Foundation.IReference<Int32> RefOutParam(
Windows.Foundation.IReference<Int32> value,
out Windows.Foundation.IReference<Int32> doubledValue,
out Windows.Foundation.IReference<Int32> tripledValue);
TestObject ObjectOutParam(TestObject value, out TestObject doubledValue, out TestObject tripledValue);
// Member array out params
Boolean[] BoolArrayOutParam(Boolean[] values, out Boolean[] rot1, out Boolean[] rot2);
Char[] CharArrayOutParam(Char[] values, out Char[] rot1, out Char[] rot2);
Int32[] NumericArrayOutParam(Int32[] values, out Int32[] rot1, out Int32[] rot2);
String[] StringArrayOutParam(String[] values, out String[] rot1, out String[] rot2);
Guid[] GuidArrayOutParam(Guid[] values, out Guid[] rot1, out Guid[] rot2);
TestEnum[] EnumArrayOutParam(TestEnum[] values, out TestEnum[] rot1, out TestEnum[] rot2);
CompositeType[] CompositeStructArrayOutParam(CompositeType[] values, out CompositeType[] rot1, out CompositeType[] rot2);
Windows.Foundation.IReference<Int32>[] RefArrayOutParam(
Windows.Foundation.IReference<Int32>[] values,
out Windows.Foundation.IReference<Int32>[] rot1,
out Windows.Foundation.IReference<Int32>[] rot2);
TestObject[] ObjectArrayOutParam(TestObject[] values, out TestObject[] rot1, out TestObject[] rot2);
// Member array fill params
void BoolFillParam(ref Boolean[] values);
void CharFillParam(ref Char[] values);
void NumericFillParam(ref Int32[] values);
void StringFillParam(ref String[] values);
void GuidFillParam(ref Guid[] values);
void EnumFillParam(ref TestEnum[] values);
void CompositeStructFillParam(ref CompositeType[] values);
void RefFillParam(ref Windows.Foundation.IReference<Int32>[] values);
void ObjectFillParam(ref TestObject[] values);
// Member "interwoven" in/out params
UInt32 InterwovenParams(Boolean inBool, out Boolean outBool, Int32 inNumeric, out Int32 outNumeric,
Int32[] inArray, out Int32[] outArray, ref Int32[] refArray);
// Member events
event Windows.Foundation.TypedEventHandler<Test, Boolean> BoolEventHandler;
event Windows.Foundation.TypedEventHandler<Test, Char> CharEventHandler;
event Windows.Foundation.TypedEventHandler<Test, Int32> NumericEventHandler;
event Windows.Foundation.TypedEventHandler<Test, String> StringEventHandler;
event Windows.Foundation.TypedEventHandler<Test, Guid> GuidEventHandler;
event Windows.Foundation.TypedEventHandler<Test, TestEnum> EnumEventHandler;
event Windows.Foundation.TypedEventHandler<Test, CompositeType> CompositeStructEventHandler;
event Windows.Foundation.TypedEventHandler<Test, Windows.Foundation.IReference<Int32> > RefEventHandler;
event Windows.Foundation.TypedEventHandler<Test, TestObject> ObjectEventHandler;
// Member event triggers
void RaiseBoolEvent(Boolean value);
void RaiseCharEvent(Char value);
void RaiseNumericEvent(Int32 value);
void RaiseStringEvent(String value);
void RaiseGuidEvent(Guid value);
void RaiseEnumEvent(TestEnum value);
void RaiseCompositeStructEvent(CompositeType value);
void RaiseRefEvent(Windows.Foundation.IReference<Int32> value);
void RaiseObjectEvent(TestObject value);
// Used to validate the fix to https://github.com/microsoft/react-native-winrt/issues/119
static Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<ITestInterface> > GetObjectsAsync();
}
[contract(TestContract, 1)]
runtimeclass StaticOnlyTest
{
// Static properties
static Boolean BoolProperty;
static Char CharProperty;
static UInt8 U8Property;
static UInt16 U16Property;
static UInt32 U32Property;
static UInt64 U64Property;
static Int16 S16Property;
static Int32 S32Property;
static Int64 S64Property;
static Single F32Property;
static Double F64Property;
static String StringProperty;
static Guid GuidProperty;
static TestEnum EnumProperty;
static NumericTypes NumericsStructProperty;
static StringTypes StringsStructProperty;
static BooleanTypes BooleansStructProperty;
static CompositeType CompositeStructProperty;
static Windows.Foundation.IReference<Boolean> RefBooleanProperty;
static Windows.Foundation.IReference<Char> RefCharProperty;
static Windows.Foundation.IReference<Int32> RefNumericProperty;
static Windows.Foundation.IReference<TestEnum> RefEnumProperty;
static TestObject ObjectProperty;
static HRESULT HResultProperty;
//Static Method
static String CopyString(String value);
//Event
static event Windows.Foundation.EventHandler<TestObject> ObjectEventHandler;
static void RaiseObjectEvent(TestObject value);
}
[contract(TestContract, 2)]
[exclusiveto(HierarchyBase)]
interface IHierarchyV2Contract
{
String IHierarchyV2ContractMethod();
};
[contract(TestContract, 1)]
unsealed runtimeclass HierarchyBase : IHierarchyV2Contract
{
HierarchyBase();
String OverriddenHierarchyBaseMethod();
overridable String OverriddenHierarchyBaseMethodOverride();
String NonOverriddenHierarchyBaseMethod();
String OverloadedHierarchyBaseMethod(String param1);
protected void InaccessibleHierarchyBaseMethod();
static String StaticHierarchyBaseMethod();
}
[contract(TestContract, 1)]
unsealed runtimeclass HierarchyDerived : HierarchyBase
{
HierarchyDerived(String name);
String HierarchyDerivedMethod();
String OverloadedHierarchyBaseMethod(String param1, String param2);
}
}