@glutinum/cli 1.0.0-beta.7 → 1.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Glutinum.Converter/Hosting.js +2 -2
- package/dist/Glutinum.Converter/Packages.js +12 -21
- package/dist/Glutinum.Converter/Reader/ConditionalTypeNode.js +90 -0
- package/dist/Glutinum.Converter/Reader/Deferred.js +706 -0
- package/dist/Glutinum.Converter/Reader/ExpressionWithTypeArguments.js +59 -0
- package/dist/Glutinum.Converter/Reader/IntersectionTypeNode.js +178 -0
- package/dist/Glutinum.Converter/Reader/MemberTypes.js +126 -0
- package/dist/Glutinum.Converter/Reader/TypeNode.js +48 -1941
- package/dist/Glutinum.Converter/Reader/UtilityType.js +811 -0
- package/dist/Glutinum.Converter/Reader/Utils.js +87 -47
- package/dist/Glutinum.Converter/Transform.js +563 -1294
- package/dist/Glutinum.Converter/Transformer/Context.js +4 -3
- package/dist/Glutinum.Converter/Transformer/Exports.js +704 -0
- package/dist/Glutinum.Converter/Transformer/TypeParameter.js +219 -0
- package/dist/Glutinum.Converter/Transformer/UnionOverloads.js +5 -2
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
import { defaultArg, orElse } from "../../fable_modules/fable-library-js.5.17.2/Option.js";
|
|
3
|
+
import { Operators_IsNull } from "../../fable_modules/fable-library-js.5.17.2/FSharp.Core.js";
|
|
4
|
+
import { resolvedBaseTypeArguments, typeNodeBuilderFlags, readTypeArguments, landingOf, crossesNamespace, modulePathForSymbol, isLibraryName, resolveValueAlias, knownExternalTypeNames, isExternalToPackages, declaredName, getFullNameOrEmpty, isFromEs5Lib } from "./Utils.js";
|
|
5
|
+
import { readPick, readOmit } from "./UtilityType.js";
|
|
6
|
+
import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
|
|
7
|
+
import { GlueTypeReference, GlueType } from "../GlueAST.js";
|
|
8
|
+
import { sanitizeTypeName } from "../Utils/Naming.js";
|
|
9
|
+
import { map, isEmpty, empty } from "../../fable_modules/fable-library-js.5.17.2/List.js";
|
|
10
|
+
import { toList } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
11
|
+
|
|
12
|
+
export function readExpressionWithTypeArguments(reader, typeNode) {
|
|
13
|
+
let symbol, symbol_2, symbol_3, symbol_4, matchValue_2, option_4, symbol_6, matchValue_3, ofAlias, matchValue_4, matchValue_5, alias, written, option_6;
|
|
14
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
15
|
+
const expression = typeNode;
|
|
16
|
+
const typ = checker.getTypeFromTypeNode(expression);
|
|
17
|
+
const symbolOpt = orElse(orElse(typ.aliasSymbol, Operators_IsNull(typ.symbol) ? undefined : typ.symbol), checker.getSymbolAtLocation(expression.expression));
|
|
18
|
+
const isFromEs5 = isFromEs5Lib(symbolOpt);
|
|
19
|
+
const matchValue = getFullNameOrEmpty(checker, expression.expression);
|
|
20
|
+
let matchResult;
|
|
21
|
+
if (isFromEs5) {
|
|
22
|
+
switch (matchValue) {
|
|
23
|
+
case "Omit": {
|
|
24
|
+
matchResult = 0;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case "Pick": {
|
|
28
|
+
matchResult = 1;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
default:
|
|
32
|
+
matchResult = 2;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
matchResult = 2;
|
|
37
|
+
}
|
|
38
|
+
switch (matchResult) {
|
|
39
|
+
case 0:
|
|
40
|
+
return readOmit(reader, expression);
|
|
41
|
+
case 1:
|
|
42
|
+
return readPick(reader, expression);
|
|
43
|
+
default: {
|
|
44
|
+
const isQualified = expression.expression.kind === 212;
|
|
45
|
+
const name = (symbolOpt != null) ? (((symbol = symbolOpt, symbol.name === "default")) ? ((symbol_2 = symbolOpt, defaultArg(declaredName(symbol_2), symbol_2.name))) : ((!isFromEs5) ? ((symbol_3 = symbolOpt, symbol_3.name)) : (isQualified ? expression.expression.name.text : expression.expression.getText()))) : (isQualified ? expression.expression.name.text : expression.expression.getText());
|
|
46
|
+
const isExternal = isExternalToPackages(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt);
|
|
47
|
+
if (((symbolOpt == null) ? false : ((symbol_4 = symbolOpt, (symbol_4.name === "__type") ? true : (symbol_4.name === "__object")))) ? true : ((isExternal && !FSharpSet__Contains(knownExternalTypeNames, name)) && !(isFromEs5 && (name === "Partial")))) {
|
|
48
|
+
return GlueType.Discard;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return new GlueType(/* TypeReference */ 13, [new GlueTypeReference((name.indexOf(".") >= 0) ? name : sanitizeTypeName(name), (matchValue_2 = ((option_4 = symbolOpt, (option_4 != null) ? resolveValueAlias(checker, option_4) : undefined)), (matchValue_2 == null) ? getFullNameOrEmpty(checker, expression.expression) : ((symbol_6 = matchValue_2, checker.getFullyQualifiedName(symbol_6)))), isLibraryName(reader, name) ? empty() : modulePathForSymbol(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), isQualified ? true : crossesNamespace(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt, landingOf(reader, expression)), symbolOpt), (matchValue_3 = readTypeArguments(reader, expression), isEmpty(matchValue_3) ? ((ofAlias = (((matchValue_4 = checker.getSymbolAtLocation(expression.expression), (matchValue_5 = typ.aliasSymbol, (matchValue_4 != null) && ((matchValue_5 != null) && ((alias = matchValue_5, (written = matchValue_4, !(written === alias)))))))) ? defaultArg((option_6 = typ.aliasTypeArguments, (option_6 != null) ? toList(option_6) : undefined), empty()) : empty()), map((argument) => {
|
|
52
|
+
const typNode = checker.typeToTypeNode(argument, undefined, typeNodeBuilderFlags);
|
|
53
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode);
|
|
54
|
+
}, isEmpty(ofAlias) ? resolvedBaseTypeArguments(checker, expression) : ofAlias))) : matchValue_3), (isFromEs5 ? true : isExternal) ? true : isLibraryName(reader, name))]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
|
|
2
|
+
import { Exception, stringHash, structuralHash, equals, disposeSafe } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
3
|
+
import { head, tail, append, forAll as forAll_1, filter, empty, exists as exists_1, collect, isEmpty, map, concat, choose } from "../../fable_modules/fable-library-js.5.17.2/List.js";
|
|
4
|
+
import { readInstantiatedMember, readPropertyWithoutDeclaration, IntersectionTypePropertyResult } from "./MemberTypes.js";
|
|
5
|
+
import { item } from "../../fable_modules/fable-library-js.5.17.2/Array.js";
|
|
6
|
+
import { filter as filter_1, exists, toList, forAll } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
7
|
+
import { List_distinctBy, List_distinct } from "../../fable_modules/fable-library-js.5.17.2/Seq2.js";
|
|
8
|
+
import { withInProgress, typeNodeBuilderFlags } from "./Utils.js";
|
|
9
|
+
import { GluePrimitive, GlueType } from "../GlueAST.js";
|
|
10
|
+
|
|
11
|
+
function readIntersectionConstituents(reader, typeNode) {
|
|
12
|
+
let matchValue;
|
|
13
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
14
|
+
const intersectionTypeNode = typeNode;
|
|
15
|
+
const unionOrIntersectionType = checker.getTypeAtLocation(intersectionTypeNode);
|
|
16
|
+
void (reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_InProgress"]().Intersections.push(unionOrIntersectionType));
|
|
17
|
+
const _guard = {
|
|
18
|
+
Dispose() {
|
|
19
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_InProgress"]().Intersections.splice(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_InProgress"]().Intersections.length - 1, 1);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
const properties_1 = choose((property_1) => {
|
|
24
|
+
const matchValue_1 = property_1.declarations;
|
|
25
|
+
if (matchValue_1 == null) {
|
|
26
|
+
return new IntersectionTypePropertyResult(/* WithoutDeclaration */ 1, [property_1]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const declarations = matchValue_1;
|
|
30
|
+
if (declarations.length === 1) {
|
|
31
|
+
return new IntersectionTypePropertyResult(/* Single */ 0, [property_1, item(0, declarations)]);
|
|
32
|
+
}
|
|
33
|
+
else if (forAll((declaration) => {
|
|
34
|
+
if (declaration.kind === 172) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return declaration.kind === 173;
|
|
39
|
+
}
|
|
40
|
+
}, declarations)) {
|
|
41
|
+
return new IntersectionTypePropertyResult(/* WithoutDeclaration */ 1, [property_1]);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return IntersectionTypePropertyResult.ForceAny;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, unionOrIntersectionType.isUnion() ? List_distinct(concat(map((arg) => toList(checker.getPropertiesOfType(arg)), toList(unionOrIntersectionType.types))), {
|
|
48
|
+
Equals: equals,
|
|
49
|
+
GetHashCode: (x) => (structuralHash(x) | 0),
|
|
50
|
+
}) : ((matchValue = toList(unionOrIntersectionType.getProperties()), isEmpty(matchValue) ? ((intersectionTypeNode.pos >= 0) ? List_distinctBy((property) => property.name, collect((constituent) => {
|
|
51
|
+
let type_1;
|
|
52
|
+
return toList((type_1 = checker.getTypeAtLocation(constituent), checker.getPropertiesOfType(type_1)));
|
|
53
|
+
}, toList(intersectionTypeNode.types)), {
|
|
54
|
+
Equals: (x_1, y_1) => (x_1 === y_1),
|
|
55
|
+
GetHashCode: (x_1) => (stringHash(x_1) | 0),
|
|
56
|
+
}) : matchValue) : matchValue)));
|
|
57
|
+
const intersectsATypeQuery = exists((constituent_1) => (constituent_1.kind === 187), intersectionTypeNode.types);
|
|
58
|
+
const everyConstituentIsAReference = forAll((constituent_2) => (constituent_2.kind === 184), intersectionTypeNode.types);
|
|
59
|
+
const hasUnsupportedProperties = intersectsATypeQuery ? true : exists_1((property_2) => {
|
|
60
|
+
switch (property_2.tag) {
|
|
61
|
+
case 1:
|
|
62
|
+
return false;
|
|
63
|
+
case 0:
|
|
64
|
+
if (everyConstituentIsAReference) {
|
|
65
|
+
return property_2.fields[1].kind === 175;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}, properties_1);
|
|
74
|
+
const callSignatures = unionOrIntersectionType.isUnion() ? empty() : choose((signature) => {
|
|
75
|
+
const synthesized = checker.signatureToSignatureDeclaration(signature, 180, typeNode, typeNodeBuilderFlags);
|
|
76
|
+
if (synthesized == null) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const declaration_2 = synthesized;
|
|
81
|
+
declaration_2.parent = typeNode;
|
|
82
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
83
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](declaration_2);
|
|
84
|
+
try {
|
|
85
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_2);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, toList(checker.getSignaturesOfType(unionOrIntersectionType, 0)));
|
|
92
|
+
if (hasUnsupportedProperties) {
|
|
93
|
+
const references = map((constituent_3) => {
|
|
94
|
+
if (constituent_3.kind === 184) {
|
|
95
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constituent_3);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return GlueType.Discard;
|
|
99
|
+
}
|
|
100
|
+
}, toList(intersectionTypeNode.types));
|
|
101
|
+
const literalMembers = collect((constituent_4) => {
|
|
102
|
+
if (constituent_4.kind === 188) {
|
|
103
|
+
const matchValue_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constituent_4);
|
|
104
|
+
if (matchValue_2.tag === 22) {
|
|
105
|
+
return matchValue_2.fields[0].Members;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return empty();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return empty();
|
|
113
|
+
}
|
|
114
|
+
}, toList(intersectionTypeNode.types));
|
|
115
|
+
const inheritable = filter((reference) => !equals(reference, GlueType.Discard), references);
|
|
116
|
+
return (!isEmpty(inheritable) && forAll_1((_arg) => {
|
|
117
|
+
if (_arg.tag === 13) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}, inheritable)) ? (new GlueType(/* IntersectionOfReferences */ 21, [inheritable, literalMembers])) : (new GlueType(/* Primitive */ 3, [GluePrimitive.Any]));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return new GlueType(/* IntersectionType */ 20, [append(withInProgress(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_InProgress"]().Landing, typeNode, () => choose((_arg_1) => {
|
|
127
|
+
switch (_arg_1.tag) {
|
|
128
|
+
case 1:
|
|
129
|
+
return readPropertyWithoutDeclaration(reader, typeNode, _arg_1.fields[0]);
|
|
130
|
+
case 2:
|
|
131
|
+
throw new Exception("Should not happen here");
|
|
132
|
+
default:
|
|
133
|
+
return readInstantiatedMember(reader, typeNode, _arg_1.fields[0], _arg_1.fields[1]);
|
|
134
|
+
}
|
|
135
|
+
}, properties_1)), append(callSignatures, collect((constituent_5) => {
|
|
136
|
+
if (constituent_5.kind === 188) {
|
|
137
|
+
return map((declaration_4) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_4), filter((element) => (element.kind === 182), toList(constituent_5.members)));
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return empty();
|
|
141
|
+
}
|
|
142
|
+
}, toList(intersectionTypeNode.types))))]);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
disposeSafe(_guard);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* `DateArg<Date> & {}` is `DateArg<Date>`, the empty type literal only bars `null`
|
|
152
|
+
*/
|
|
153
|
+
export function readIntersectionType(reader, typeNode) {
|
|
154
|
+
const constituents = toList(filter_1((arg) => {
|
|
155
|
+
let constituent, this$;
|
|
156
|
+
return !((constituent = arg, (constituent.kind === 188) && (((this$ = constituent.members, ~~this$.length)) === 0)));
|
|
157
|
+
}, typeNode.types));
|
|
158
|
+
let matchResult, single;
|
|
159
|
+
if (!isEmpty(constituents)) {
|
|
160
|
+
if (isEmpty(tail(constituents))) {
|
|
161
|
+
matchResult = 0;
|
|
162
|
+
single = head(constituents);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
matchResult = 1;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
matchResult = 1;
|
|
170
|
+
}
|
|
171
|
+
switch (matchResult) {
|
|
172
|
+
case 0:
|
|
173
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](single);
|
|
174
|
+
default:
|
|
175
|
+
return readIntersectionConstituents(reader, typeNode);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
import { Union } from "../../fable_modules/fable-library-js.5.17.2/Types.js";
|
|
3
|
+
import { union_type, class_type } from "../../fable_modules/fable-library-js.5.17.2/Reflection.js";
|
|
4
|
+
import { enclosingDeclarationOf, $007CHasSymbolFlags$007C_$007C, typeNodeBuilderFlags } from "./Utils.js";
|
|
5
|
+
import { Report_readerError_Z19516DCE } from "./Report.js";
|
|
6
|
+
import { concat } from "../../fable_modules/fable-library-js.5.17.2/String.js";
|
|
7
|
+
import { empty } from "../../fable_modules/fable-library-js.5.17.2/List.js";
|
|
8
|
+
import { GlueMethod, GlueMethodSignature, GlueMember, GlueProperty, GlueAccessor } from "../GlueAST.js";
|
|
9
|
+
import { Operators_IsNull } from "../../fable_modules/fable-library-js.5.17.2/FSharp.Core.js";
|
|
10
|
+
|
|
11
|
+
export class IntersectionTypePropertyResult extends Union {
|
|
12
|
+
constructor(tag, fields) {
|
|
13
|
+
super();
|
|
14
|
+
this.tag = tag;
|
|
15
|
+
this.fields = fields;
|
|
16
|
+
}
|
|
17
|
+
cases() {
|
|
18
|
+
return ["Single", "WithoutDeclaration", "ForceAny"];
|
|
19
|
+
}
|
|
20
|
+
static ForceAny = new IntersectionTypePropertyResult(2, []);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function IntersectionTypePropertyResult_$reflection() {
|
|
24
|
+
return union_type("Glutinum.Converter.Reader.MemberTypes.IntersectionTypePropertyResult", [], IntersectionTypePropertyResult, () => [[["Item1", class_type("TypeScript.Ts.Symbol")], ["Item2", class_type("TypeScript.Ts.Declaration")]], [["Item", class_type("TypeScript.Ts.Symbol")]], []]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function readPropertyWithoutDeclaration(reader, contextNode, property) {
|
|
28
|
+
let matchValue_1;
|
|
29
|
+
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeOfSymbol(property);
|
|
30
|
+
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, typeNodeBuilderFlags);
|
|
31
|
+
if (matchValue == null) {
|
|
32
|
+
const item = Report_readerError_Z19516DCE("type node", concat("Could not resolve the type of the property \'", property.name, "\'"), contextNode, "/_//src/Glutinum.Converter/Reader/MemberTypes.fs", 52);
|
|
33
|
+
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
34
|
+
void (objectArg.push(item));
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const typeNode = matchValue;
|
|
39
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
40
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](contextNode);
|
|
41
|
+
let propertyType;
|
|
42
|
+
try {
|
|
43
|
+
propertyType = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
47
|
+
}
|
|
48
|
+
return new GlueMember(/* Property */ 1, [new GlueProperty(property.name, empty(), propertyType, false, (matchValue_1 = property.flags, $007CHasSymbolFlags$007C_$007C(16777216, matchValue_1) != null), GlueAccessor.ReadWrite, false)]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function readInstantiatedMember(reader, contextNode, property, declaration) {
|
|
53
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
54
|
+
const instantiatedType = checker.getTypeOfSymbol(property);
|
|
55
|
+
const isInstantiated = !Operators_IsNull(declaration.symbol) && !(instantiatedType === checker.getTypeOfSymbol(declaration.symbol));
|
|
56
|
+
const declaredMember = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration);
|
|
57
|
+
if (!isInstantiated) {
|
|
58
|
+
return declaredMember;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const matchValue = checker.typeToTypeNode(instantiatedType, enclosingDeclarationOf(contextNode), typeNodeBuilderFlags);
|
|
62
|
+
if (matchValue != null) {
|
|
63
|
+
const typeNode = matchValue;
|
|
64
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
65
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](contextNode);
|
|
66
|
+
let instantiatedMember;
|
|
67
|
+
try {
|
|
68
|
+
instantiatedMember = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode);
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
72
|
+
}
|
|
73
|
+
let matchResult, info, typ, functionType, info_1, functionType_1, info_2, declaredMember_1;
|
|
74
|
+
switch (declaredMember.tag) {
|
|
75
|
+
case 1: {
|
|
76
|
+
matchResult = 0;
|
|
77
|
+
info = declaredMember.fields[0];
|
|
78
|
+
typ = instantiatedMember;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 6: {
|
|
82
|
+
if (instantiatedMember.tag === 15) {
|
|
83
|
+
matchResult = 1;
|
|
84
|
+
functionType = instantiatedMember.fields[0];
|
|
85
|
+
info_1 = declaredMember.fields[0];
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
matchResult = 3;
|
|
89
|
+
declaredMember_1 = declaredMember;
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case 0: {
|
|
94
|
+
if (instantiatedMember.tag === 15) {
|
|
95
|
+
matchResult = 2;
|
|
96
|
+
functionType_1 = instantiatedMember.fields[0];
|
|
97
|
+
info_2 = declaredMember.fields[0];
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
matchResult = 3;
|
|
101
|
+
declaredMember_1 = declaredMember;
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
default: {
|
|
106
|
+
matchResult = 3;
|
|
107
|
+
declaredMember_1 = declaredMember;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
switch (matchResult) {
|
|
111
|
+
case 0:
|
|
112
|
+
return new GlueMember(/* Property */ 1, [new GlueProperty(info.Name, info.Documentation, typ, info.IsStatic, info.IsOptional, info.Accessor, info.IsPrivate)]);
|
|
113
|
+
case 1:
|
|
114
|
+
return new GlueMember(/* MethodSignature */ 6, [new GlueMethodSignature(info_1.Name, info_1.Documentation, info_1.TypeParameters, functionType.Parameters, functionType.Type, info_1.IsOptional)]);
|
|
115
|
+
case 2:
|
|
116
|
+
return new GlueMember(/* Method */ 0, [new GlueMethod(info_2.Name, info_2.Documentation, info_2.TypeParameters, functionType_1.Parameters, functionType_1.Type, info_2.IsOptional, info_2.IsStatic)]);
|
|
117
|
+
default:
|
|
118
|
+
return declaredMember_1;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return declaredMember;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|