31 instantiations of AtsTypeRef
Aspire.Hosting (31)
Ats\AtsCapabilityScanner.cs (31)
689var targetTypeRef = capability.TargetType ?? new AtsTypeRef 719var concreteTypeRef = new AtsTypeRef 977: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 979propertyTypeRef = new AtsTypeRef 1004propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1021var contextTypeRef = new AtsTypeRef 1121var instanceContextTypeRef = new AtsTypeRef 1430? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 1483returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1487returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1495?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1496: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1501?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1527var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1826private static AtsTypeRef CreateVoidTypeRef() => new AtsTypeRef 1878return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 1884return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 1893return new AtsTypeRef 1916return new AtsTypeRef 1939return new AtsTypeRef 1961return new AtsTypeRef 1981return new AtsTypeRef 2009return new AtsTypeRef 2020return new AtsTypeRef 2040return new AtsTypeRef 2056return new AtsTypeRef 2068return new AtsTypeRef 2078return new AtsTypeRef 2158allInterfaces.Add(new AtsTypeRef 2193baseTypes.Add(new AtsTypeRef 2452return new AtsTypeRef
90 references to AtsTypeRef
Aspire.Hosting (64)
Ats\AtsCapabilityInfo.cs (13)
41public AtsTypeRef? ElementType { get; init; } 46public AtsTypeRef? KeyType { get; init; } 51public AtsTypeRef? ValueType { get; init; } 79public IReadOnlyList<AtsTypeRef>? UnionTypes { get; init; } 195public required AtsTypeRef ReturnType { get; init; } 206public AtsTypeRef? TargetType { get; init; } 222public IReadOnlyList<AtsTypeRef> ExpandedTargetTypes { get; set; } = []; 249public AtsTypeRef? Type { get; init; } 277public AtsTypeRef? CallbackReturnType { get; init; } 299public required AtsTypeRef Type { get; init; } 327public IReadOnlyList<AtsTypeRef> ImplementedInterfaces { get; init; } = []; 334public IReadOnlyList<AtsTypeRef> BaseTypeHierarchy { get; init; } = []; 391public required AtsTypeRef Type { get; init; }
Ats\AtsCapabilityScanner.cs (51)
482private static void CollectEnumTypeIds(AtsTypeRef? typeRef, HashSet<string> enumTypeIds) 522private static void ResolveTypeRef(AtsTypeRef? typeRef, HashSet<string> validTypes) 543foreach (var memberType in typeRef.UnionTypes) 618private static string? FindUnknownType(AtsTypeRef? typeRef) 643foreach (var memberType in typeRef.UnionTypes) 689var targetTypeRef = capability.TargetType ?? new AtsTypeRef 706private static Dictionary<string, List<AtsTypeRef>> BuildTypeCompatibilityMap( 709var typeToCompatibleTypes = new Dictionary<string, List<AtsTypeRef>>(); 719var concreteTypeRef = new AtsTypeRef 728foreach (var iface in typeInfo.ImplementedInterfaces) 734foreach (var baseType in typeInfo.BaseTypeHierarchy) 747Dictionary<string, List<AtsTypeRef>> map, 749AtsTypeRef concreteTypeRef) 861var propTypeRef = CreateTypeRef(prop.PropertyType); 957AtsTypeRef? propertyTypeRef; 972var keyTypeRef = CreateTypeRef(propType.GetGenericArguments().First()); 975var valueTypeRef = propertyUnionAttr != null 1021var contextTypeRef = new AtsTypeRef 1121var instanceContextTypeRef = new AtsTypeRef 1234var returnTypeRef = CreateTypeRef(method.ReturnType); 1305AtsTypeRef? extendsTypeRef = null; 1358var returnTypeRef = CreateTypeRef(method.ReturnType); 1390var unionTypeRef = CreateUnionTypeRef(unionAttr, $"parameter '{paramName}'"); 1406var typeRef = CreateTypeRef(paramType); 1418AtsTypeRef? callbackReturnType = null; 1429var finalTypeRef = isCallback 1449private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters, AtsTypeRef? ReturnType) ExtractCallbackSignature( 1466var paramTypeRef = CreateTypeRef(paramType); 1479AtsTypeRef? returnTypeRef; 1511private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters, AtsTypeRef? ReturnType) ExtractWellKnownDelegateSignature( 1527var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1536var paramTypeRef = CreateTypeRef(paramType); 1557var paramTypeRef = CreateTypeRef(paramType); 1569AtsTypeRef returnTypeRef; 1820public static AtsTypeRef? CreateTypeRef(Type? type) => 1826private static AtsTypeRef CreateVoidTypeRef() => new AtsTypeRef 1835private static AtsTypeRef? CreateTypeRef( 1912var keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector); 1913var valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector); 1935var keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector); 1936var valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector); 1958var elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector); 1978var elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector); 2037var elementTypeRef = CreateTypeRef(elementType, enumCollector); 2150private static List<AtsTypeRef> CollectAllInterfaces(Type type) 2152var allInterfaces = new List<AtsTypeRef>(); 2174private static List<AtsTypeRef> CollectBaseTypeHierarchy(Type type) 2176var baseTypes = new List<AtsTypeRef>(); 2427private static AtsTypeRef CreateUnionTypeRef( 2438var unionTypes = new List<AtsTypeRef>(); 2441var typeRef = CreateTypeRef(memberType);
Aspire.Hosting.CodeGeneration.TypeScript (17)
AtsTypeScriptCodeGenerator.cs (17)
20public AtsTypeRef? TargetType { get; init; } 123private static bool IsHandleType(AtsTypeRef? typeRef) => 130private string MapTypeRefToTypeScript(AtsTypeRef? typeRef) 197private string MapUnionTypeToTypeScript(AtsTypeRef typeRef) 261private static bool IsInterfaceHandleType(AtsTypeRef? typeRef) 1145private string GenerateCallbackTypeSignature(IReadOnlyList<AtsCallbackParameterInfo>? callbackParameters, AtsTypeRef? callbackReturnType) 1687private static bool IsDictionaryType(AtsTypeRef? typeRef) 2208var typeRefsByTypeId = new Dictionary<string, AtsTypeRef>(); 2215var targetTypeRef = cap.TargetType; 2234foreach (var expandedType in expandedTypes) 2280var typeRef = typeRefsByTypeId.GetValueOrDefault(typeId); 2313var typeRef = typeRefsByTypeId.GetValueOrDefault(interfaceTypeId); 2382private static Dictionary<string, AtsTypeRef> CollectAllReferencedTypes(IReadOnlyList<AtsCapabilityInfo> capabilities) 2384var typeRefs = new Dictionary<string, AtsTypeRef>(); 2386void CollectFromTypeRef(AtsTypeRef? typeRef) 2404foreach (var unionType in typeRef.UnionTypes) 2514private string? GetPromiseWrapperForReturnType(AtsTypeRef? returnType)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
AtsTypeScriptCodeGeneratorTests.cs (7)
259var testRedisTarget = withOptionalString.ExpandedTargetTypes.FirstOrDefault(t => 418foreach (var expandedType in cap.ExpandedTargetTypes) 482var testRedisExpanded = withConnectionStringDirect.ExpandedTargetTypes 510var testRedisExpanded = withRedisSpecific.ExpandedTargetTypes 536var containerExpanded = withBindMount.ExpandedTargetTypes 632foreach (var expandedType in withConnectionStringDirect.ExpandedTargetTypes) 667var testRedisExpanded = testWithEnvironmentCallback.ExpandedTargetTypes
Aspire.Hosting.RemoteHost (2)
Ats\AtsMarshaller.cs (2)
120public JsonNode? MarshalToJson(object? value, Hosting.Ats.AtsTypeRef typeRef) 177private JsonNode? SerializeArray(object value, Hosting.Ats.AtsTypeRef? elementType)