@glutinum/cli 0.13.0 → 0.14.0
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/README.md +19 -1
- package/dist/Glutinum.Converter/Abbreviations.js +246 -0
- package/dist/Glutinum.Converter/FsharpAST.js +87 -28
- package/dist/Glutinum.Converter/Generate.js +55 -8
- package/dist/Glutinum.Converter/GlueAST.js +333 -34
- package/dist/Glutinum.Converter/Log.js +7 -8
- package/dist/Glutinum.Converter/Merge.js +683 -31
- package/dist/Glutinum.Converter/Packages.js +308 -0
- package/dist/Glutinum.Converter/Printer.js +323 -186
- package/dist/Glutinum.Converter/Read.js +279 -6
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
- package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
- package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
- package/dist/Glutinum.Converter/Reader/Node.js +24 -10
- package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
- package/dist/Glutinum.Converter/Reader/Report.js +31 -12
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
- package/dist/Glutinum.Converter/Reader/Types.js +180 -0
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
- package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
- package/dist/Glutinum.Converter/Transform.js +8292 -1119
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
- package/dist/Glutinum.Converter/TypeScript.js +3 -3
- package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
- package/dist/Glutinum.Converter/Utils/List.js +3 -3
- package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
- package/dist/Glutinum.Converter/Utils/String.js +7 -3
- package/dist/Program.js +230 -72
- package/package.json +4 -4
- package/src/Glutinum.Converter/js/bootstrap.js +109 -2
- package/src/Glutinum.Converter/js/host.js +144 -0
- package/src/Glutinum.Converter/js/npm.js +137 -0
- package/src/Glutinum.Converter/js/resolve.js +402 -0
- package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
- package/dist/Glutinum.Converter/Generate.js.map +0 -1
- package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
- package/dist/Glutinum.Converter/Log.js.map +0 -1
- package/dist/Glutinum.Converter/Merge.js.map +0 -1
- package/dist/Glutinum.Converter/Printer.js.map +0 -1
- package/dist/Glutinum.Converter/Read.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
- package/dist/Glutinum.Converter/Transform.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
- package/dist/Program.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +0 -105
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +0 -766
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +0 -218
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +0 -31
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +0 -207
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +0 -127
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +0 -81
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +0 -183
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +0 -37
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +0 -439
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +0 -217
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +0 -75
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs +0 -238
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +0 -190
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +0 -194
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +0 -35
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs +0 -218
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +0 -358
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +0 -331
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionOp.fs +0 -21
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +0 -644
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +0 -45
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs +0 -155
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +0 -23
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +0 -45
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +0 -201
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +0 -65
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs +0 -146
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +0 -57
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Validation.fs +0 -172
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +0 -148
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +0 -35
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +0 -151
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
- package/dist/fable_modules/fable-library-js.4.14.0/Array.js +0 -1242
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Async.js +0 -158
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +0 -183
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +0 -282
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +0 -138
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +0 -21
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
- package/dist/fable_modules/fable-library-js.4.14.0/Char.js +0 -169
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +0 -184
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
- package/dist/fable_modules/fable-library-js.4.14.0/Date.js +0 -749
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +0 -268
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +0 -124
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +0 -212
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
- package/dist/fable_modules/fable-library-js.4.14.0/Double.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +0 -173
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
- package/dist/fable_modules/fable-library-js.4.14.0/Event.js +0 -93
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +0 -142
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +0 -135
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
- package/dist/fable_modules/fable-library-js.4.14.0/List.js +0 -1273
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +0 -93
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
- package/dist/fable_modules/fable-library-js.4.14.0/Map.js +0 -1396
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +0 -112
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +0 -327
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +0 -233
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +0 -71
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +0 -113
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Option.js +0 -96
- package/dist/fable_modules/fable-library-js.4.14.0/README.md +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Random.js +0 -170
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Range.js +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +0 -461
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +0 -132
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Result.js +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +0 -1379
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +0 -111
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
- package/dist/fable_modules/fable-library-js.4.14.0/Set.js +0 -1789
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
- package/dist/fable_modules/fable-library-js.4.14.0/String.js +0 -543
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +0 -317
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +0 -162
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +0 -122
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +0 -177
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +0 -67
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
- package/dist/fable_modules/fable-library-js.4.14.0/Types.js +0 -208
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +0 -4
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +0 -142
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
- package/dist/fable_modules/fable-library-js.4.14.0/Util.js +0 -770
- package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +0 -338
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +0 -826
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
- package/dist/fable_modules/project_cracked.json +0 -1
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { GlueThisType, GlueTypeLiteral, GlueFunctionType, GlueTypeReference, GlueReadonly, GlueRecord, GlueUtilityType, GlueInterface, GlueTypeUnion, GlueLiteral, GlueClassDeclaration, GlueType, GluePrimitive } from "../GlueAST.js";
|
|
5
|
-
import { exists, concat as concat_1, map as map_2, item as item_3, choose, singleton, empty } from "../../fable_modules/fable-library-js.4.14.0/List.js";
|
|
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";
|
|
6
4
|
import { Report_readerError_Z19516DCE } from "./Report.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { concat } from "../../fable_modules/fable-library-js.5.17.2/String.js";
|
|
6
|
+
import { concat as concat_2, exists as exists_1, head, tail, fold, item as item_5, contains, filter, map as map_1, append as append_1, collect as collect_1, isEmpty, choose, singleton as singleton_1, length, truncate, empty } from "../../fable_modules/fable-library-js.5.17.2/List.js";
|
|
7
|
+
import { resolvedBaseTypeArguments, tryReadLiteral, declaredName, isFromEsLib, isFromEs5Lib, modulePathForSymbol, knownExternalTypeNames, isExternalToPackages, importedName, readTypeArguments, getFullNameOrEmpty, defaultTypeArguments, identifierText, symbolAtLocation, isTupleType, Type_NumberLiteral_$007CInt$007CFloat$007COther$007C, Type_StringLiteral_$007CString$007COther$007C, entityNameText, mainDeclaration, resolveAlias, $007CHasTypeFlags$007C_$007C, $007CHasSymbolFlags$007C_$007C } from "./Utils.js";
|
|
8
|
+
import { GlueThisType, GlueConditionalType, GlueSubstitution_substitute, GlueConstructSignature, GlueFunctionType, GlueTypeReference, GlueReadonly, GlueRecord, GlueUtilityType, GlueInterface, GlueSubstitution_substituteMember, GlueSubstitution_mentionedTypeParameters, GlueTypeLiteral, GlueTypeUnion, GlueLiteral, GlueClassDeclaration, GluePrimitive, GlueType, 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
|
+
import { sortByDescending, contains as contains_1, filter as filter_1, choose as choose_1, ofList as ofList_1, exists, map, concat as concat_1, forAll, tryHead, tryFindIndex, collect, empty as empty_1, singleton, append, delay, toList } from "../../fable_modules/fable-library-js.5.17.2/Seq.js";
|
|
11
|
+
import { item as item_4 } from "../../fable_modules/fable-library-js.5.17.2/Array.js";
|
|
12
|
+
import { unwrap, orElse, value as value_8, defaultArg } from "../../fable_modules/fable-library-js.5.17.2/Option.js";
|
|
13
|
+
import { structuralHash, disposeSafe, comparePrimitives, stringHash, safeHash, equals, Exception } from "../../fable_modules/fable-library-js.5.17.2/Util.js";
|
|
14
|
+
import { List_distinctBy, List_distinct, distinct } from "../../fable_modules/fable-library-js.5.17.2/Seq2.js";
|
|
15
|
+
import { FSharpMap__get_IsEmpty, FSharpMap__ContainsKey, ofList } from "../../fable_modules/fable-library-js.5.17.2/Map.js";
|
|
16
|
+
import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.17.2/Set.js";
|
|
17
|
+
import { sanitizeTypeName } from "../Utils/Naming.js";
|
|
11
18
|
import { readTypeQueryNode } from "./TypeQueryNode.js";
|
|
19
|
+
import { ts } from "@ts-morph/bootstrap";
|
|
12
20
|
import { TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name } from "../TypeScript.Extensions.js";
|
|
13
21
|
|
|
14
22
|
class IntersectionTypePropertyResult extends Union {
|
|
@@ -18,201 +26,1043 @@ class IntersectionTypePropertyResult extends Union {
|
|
|
18
26
|
this.fields = fields;
|
|
19
27
|
}
|
|
20
28
|
cases() {
|
|
21
|
-
return ["Single", "ForceAny"];
|
|
29
|
+
return ["Single", "WithoutDeclaration", "ForceAny"];
|
|
22
30
|
}
|
|
31
|
+
static ForceAny = new IntersectionTypePropertyResult(2, []);
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
function IntersectionTypePropertyResult_$reflection() {
|
|
26
|
-
return union_type("Glutinum.Converter.Reader.TypeNode.IntersectionTypePropertyResult", [], IntersectionTypePropertyResult, () => [[["
|
|
35
|
+
return union_type("Glutinum.Converter.Reader.TypeNode.IntersectionTypePropertyResult", [], IntersectionTypePropertyResult, () => [[["Item1", class_type("TypeScript.Ts.Symbol")], ["Item2", class_type("TypeScript.Ts.Declaration")]], [["Item", class_type("TypeScript.Ts.Symbol")]], []]);
|
|
27
36
|
}
|
|
28
37
|
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
function readPropertyWithoutDeclaration(reader, contextNode, property) {
|
|
39
|
+
let matchValue_1;
|
|
40
|
+
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeOfSymbol(property);
|
|
41
|
+
const flags = 1 | 16384;
|
|
42
|
+
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, flags);
|
|
43
|
+
if (matchValue == null) {
|
|
44
|
+
const item = Report_readerError_Z19516DCE("type node", concat("Could not resolve the type of the property \'", property.name, "\'"), contextNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 56);
|
|
45
|
+
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
46
|
+
void (objectArg.push(item));
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const typeNode = matchValue;
|
|
51
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
52
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](contextNode);
|
|
53
|
+
let propertyType;
|
|
54
|
+
try {
|
|
55
|
+
propertyType = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode);
|
|
35
56
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
finally {
|
|
58
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
59
|
+
}
|
|
60
|
+
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)]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function readInstantiatedMember(reader, contextNode, property, declaration) {
|
|
65
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
66
|
+
const instantiatedType = checker.getTypeOfSymbol(property);
|
|
67
|
+
const isInstantiated = !Operators_IsNull(declaration.symbol) && !(instantiatedType === checker.getTypeOfSymbol(declaration.symbol));
|
|
68
|
+
const declaredMember = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration);
|
|
69
|
+
if (!isInstantiated) {
|
|
70
|
+
return declaredMember;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const flags = 1 | 16384;
|
|
74
|
+
const enclosingDeclaration = (contextNode.pos < 0) ? undefined : contextNode;
|
|
75
|
+
const matchValue = checker.typeToTypeNode(instantiatedType, enclosingDeclaration, flags);
|
|
76
|
+
if (matchValue != null) {
|
|
77
|
+
const typeNode = matchValue;
|
|
78
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
79
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](contextNode);
|
|
80
|
+
let instantiatedMember;
|
|
81
|
+
try {
|
|
82
|
+
instantiatedMember = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
86
|
+
}
|
|
87
|
+
let matchResult, info, typ, functionType, info_1, functionType_1, info_2, declaredMember_1;
|
|
88
|
+
switch (declaredMember.tag) {
|
|
89
|
+
case 1: {
|
|
90
|
+
matchResult = 0;
|
|
91
|
+
info = declaredMember.fields[0];
|
|
92
|
+
typ = instantiatedMember;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case 6: {
|
|
96
|
+
if (instantiatedMember.tag === 15) {
|
|
97
|
+
matchResult = 1;
|
|
98
|
+
functionType = instantiatedMember.fields[0];
|
|
99
|
+
info_1 = declaredMember.fields[0];
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
matchResult = 3;
|
|
103
|
+
declaredMember_1 = declaredMember;
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case 0: {
|
|
108
|
+
if (instantiatedMember.tag === 15) {
|
|
109
|
+
matchResult = 2;
|
|
110
|
+
functionType_1 = instantiatedMember.fields[0];
|
|
111
|
+
info_2 = declaredMember.fields[0];
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
matchResult = 3;
|
|
115
|
+
declaredMember_1 = declaredMember;
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
default: {
|
|
120
|
+
matchResult = 3;
|
|
121
|
+
declaredMember_1 = declaredMember;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
switch (matchResult) {
|
|
125
|
+
case 0:
|
|
126
|
+
return new GlueMember(/* Property */ 1, [new GlueProperty(info.Name, info.Documentation, typ, info.IsStatic, info.IsOptional, info.Accessor, info.IsPrivate)]);
|
|
127
|
+
case 1:
|
|
128
|
+
return new GlueMember(/* MethodSignature */ 6, [new GlueMethodSignature(info_1.Name, info_1.Documentation, info_1.TypeParameters, functionType.Parameters, functionType.Type)]);
|
|
129
|
+
case 2:
|
|
130
|
+
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)]);
|
|
45
131
|
default:
|
|
46
|
-
return
|
|
132
|
+
return declaredMember_1;
|
|
47
133
|
}
|
|
48
134
|
}
|
|
135
|
+
else {
|
|
136
|
+
return declaredMember;
|
|
137
|
+
}
|
|
49
138
|
}
|
|
50
|
-
|
|
51
|
-
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const intersectionsInProgress = [];
|
|
142
|
+
|
|
143
|
+
function isLibraryName(reader, name) {
|
|
144
|
+
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"]();
|
|
145
|
+
if (matchValue == null) {
|
|
146
|
+
return false;
|
|
52
147
|
}
|
|
53
|
-
else
|
|
54
|
-
return
|
|
148
|
+
else {
|
|
149
|
+
return matchValue.IsLibraryName(name);
|
|
55
150
|
}
|
|
56
|
-
|
|
57
|
-
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function isDeferredConditional(typ) {
|
|
154
|
+
const matchValue = typ.flags;
|
|
155
|
+
if ($007CHasTypeFlags$007C_$007C(16777216, matchValue) != null) {
|
|
156
|
+
return true;
|
|
58
157
|
}
|
|
59
|
-
else
|
|
60
|
-
return
|
|
158
|
+
else {
|
|
159
|
+
return false;
|
|
61
160
|
}
|
|
62
|
-
|
|
63
|
-
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function inferTypeNodes(node) {
|
|
164
|
+
return toList(delay(() => append((node.kind === 195) ? singleton(node) : empty_1(), delay(() => collect(inferTypeNodes, node.getChildren())))));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function inferredConstraint(reader, inferTypeNode) {
|
|
168
|
+
const matchValue_1 = inferTypeNode.typeParameter.constraint;
|
|
169
|
+
if (matchValue_1 == null) {
|
|
170
|
+
let atPosition;
|
|
171
|
+
if (inferTypeNode.parent.kind === 183) {
|
|
172
|
+
const typeReferenceNode = inferTypeNode.parent;
|
|
173
|
+
let position;
|
|
174
|
+
const option_1 = typeReferenceNode.typeArguments;
|
|
175
|
+
position = ((option_1 != null) ? tryFindIndex((typeArgument) => (typeArgument === inferTypeNode), option_1) : undefined);
|
|
176
|
+
let option_13;
|
|
177
|
+
let option_9;
|
|
178
|
+
let option_7;
|
|
179
|
+
let option_5;
|
|
180
|
+
const option_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(typeReferenceNode.typeName);
|
|
181
|
+
let binder_2;
|
|
182
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
183
|
+
binder_2 = ((symbol) => resolveAlias(checker, symbol));
|
|
184
|
+
const option_3 = option_2;
|
|
185
|
+
option_5 = ((option_3 != null) ? binder_2(option_3) : undefined);
|
|
186
|
+
if (option_5 != null) {
|
|
187
|
+
const symbol_1 = option_5;
|
|
188
|
+
option_7 = symbol_1.declarations;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
option_7 = undefined;
|
|
192
|
+
}
|
|
193
|
+
option_9 = ((option_7 != null) ? tryHead(option_7) : undefined);
|
|
194
|
+
if (option_9 != null) {
|
|
195
|
+
const declaration = option_9;
|
|
196
|
+
const matchValue = declaration.kind;
|
|
197
|
+
option_13 = ((matchValue === 263) ? declaration.typeParameters : ((matchValue === 264) ? declaration.typeParameters : ((matchValue === 265) ? declaration.typeParameters : undefined)));
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
option_13 = undefined;
|
|
201
|
+
}
|
|
202
|
+
if (option_13 != null) {
|
|
203
|
+
const typeParameters = option_13;
|
|
204
|
+
const option_11 = position;
|
|
205
|
+
if (option_11 != null) {
|
|
206
|
+
const position_1 = option_11 | 0;
|
|
207
|
+
atPosition = ((position_1 < typeParameters.length) ? item_4(position_1, typeParameters).constraint : undefined);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
atPosition = undefined;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
atPosition = undefined;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
atPosition = undefined;
|
|
219
|
+
}
|
|
220
|
+
if (atPosition == null) {
|
|
221
|
+
return GlueType.Unknown;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
const constraintNode_1 = atPosition;
|
|
225
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constraintNode_1);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
const constraintNode = matchValue_1;
|
|
230
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constraintNode);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function truncateToDeclaredArity(reader, symbolOpt, typeArguments) {
|
|
235
|
+
let option_5, _arg;
|
|
236
|
+
let declaredArity;
|
|
237
|
+
let option_8;
|
|
238
|
+
let option_2;
|
|
239
|
+
let binder;
|
|
240
|
+
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
241
|
+
binder = ((symbol) => resolveAlias(checker, symbol));
|
|
242
|
+
const option_1 = symbolOpt;
|
|
243
|
+
option_2 = ((option_1 != null) ? binder(option_1) : undefined);
|
|
244
|
+
let binder_2;
|
|
245
|
+
const packageContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"]();
|
|
246
|
+
binder_2 = ((symbol_1) => mainDeclaration(packageContext, symbol_1));
|
|
247
|
+
const option_3 = option_2;
|
|
248
|
+
option_8 = ((option_3 != null) ? binder_2(option_3) : undefined);
|
|
249
|
+
if (option_8 != null) {
|
|
250
|
+
const declaration = option_8;
|
|
251
|
+
const matchValue = declaration.kind;
|
|
252
|
+
switch (matchValue) {
|
|
253
|
+
case 263:
|
|
254
|
+
case 264:
|
|
255
|
+
case 265: {
|
|
256
|
+
declaredArity = defaultArg((option_5 = declaration.typeParameters, (option_5 != null) ? ((_arg = option_5, _arg.length)) : undefined), 0);
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
default:
|
|
260
|
+
declaredArity = undefined;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
declaredArity = undefined;
|
|
265
|
+
}
|
|
266
|
+
let matchResult, arity_1;
|
|
267
|
+
if (declaredArity != null) {
|
|
268
|
+
if (declaredArity < length(typeArguments)) {
|
|
269
|
+
matchResult = 0;
|
|
270
|
+
arity_1 = declaredArity;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
matchResult = 1;
|
|
274
|
+
}
|
|
64
275
|
}
|
|
65
276
|
else {
|
|
66
|
-
|
|
277
|
+
matchResult = 1;
|
|
278
|
+
}
|
|
279
|
+
switch (matchResult) {
|
|
280
|
+
case 0:
|
|
281
|
+
return truncate(arity_1, typeArguments);
|
|
282
|
+
default:
|
|
283
|
+
return typeArguments;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function isGlobalThisQuery(typeNode) {
|
|
288
|
+
if (typeNode.kind === 186) {
|
|
289
|
+
return entityNameText(typeNode.exprName) === "globalThis";
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function readTypeUsingFlags(reader, typ) {
|
|
297
|
+
let declarations;
|
|
298
|
+
const matchValue = typ.flags;
|
|
299
|
+
let matchResult;
|
|
300
|
+
if ($007CHasTypeFlags$007C_$007C(524288, matchValue) != null) {
|
|
301
|
+
if (Operators_IsNull(typ.symbol)) {
|
|
302
|
+
matchResult = 0;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
matchResult = 1;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
matchResult = 1;
|
|
310
|
+
}
|
|
311
|
+
switch (matchResult) {
|
|
312
|
+
case 0:
|
|
313
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
314
|
+
default:
|
|
315
|
+
if ($007CHasTypeFlags$007C_$007C(524288, matchValue) != null) {
|
|
316
|
+
const matchValue_1 = typ.symbol.declarations;
|
|
317
|
+
if (matchValue_1 == null) {
|
|
318
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
319
|
+
}
|
|
320
|
+
else if ((declarations = matchValue_1, declarations.length > 0)) {
|
|
321
|
+
const declarations_1 = matchValue_1;
|
|
322
|
+
const declaration = item_4(0, declarations_1);
|
|
323
|
+
const matchValue_2 = declaration.kind;
|
|
324
|
+
switch (matchValue_2) {
|
|
325
|
+
case 263:
|
|
326
|
+
return new GlueType(/* ClassDeclaration */ 12, [new GlueClassDeclaration(empty(), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getFullyQualifiedName(typ.symbol), typ.symbol.name, empty(), empty(), empty(), empty(), true)]);
|
|
327
|
+
case 264:
|
|
328
|
+
case 265: {
|
|
329
|
+
const flags = 1 | 16384;
|
|
330
|
+
const matchValue_3 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, flags);
|
|
331
|
+
if (matchValue_3 == null) {
|
|
332
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
const typeNode = matchValue_3;
|
|
336
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
case 267:
|
|
340
|
+
return GlueType.Discard;
|
|
341
|
+
default:
|
|
342
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055"](declaration);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
throw new Exception("Match failure: Microsoft.FSharp.Core.FSharpOption`1");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
else if ($007CHasTypeFlags$007C_$007C(4, matchValue) != null) {
|
|
350
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.String$]);
|
|
351
|
+
}
|
|
352
|
+
else if ($007CHasTypeFlags$007C_$007C(8, matchValue) != null) {
|
|
353
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Number$]);
|
|
354
|
+
}
|
|
355
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue) != null) {
|
|
356
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Bool]);
|
|
357
|
+
}
|
|
358
|
+
else if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
359
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
360
|
+
}
|
|
361
|
+
else if ($007CHasTypeFlags$007C_$007C(16384, matchValue) != null) {
|
|
362
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Unit]);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
366
|
+
}
|
|
67
367
|
}
|
|
68
368
|
}
|
|
69
369
|
|
|
70
370
|
export function UtilityType_readExclude(reader, typeReferenceNode) {
|
|
71
|
-
let
|
|
371
|
+
let matchValue_1, activePatternResult_4, item, objectArg, activePatternResult_6, item_1, objectArg_1, matchValue_3, typeArguments, typeArguments_1, excluded, isNullish, matchValue_5, symbol, matchValue_6, matchValue_7, typeArguments_2, typeArguments_3, excluded_1, isNullish_1, matchValue_9, symbol_1, matchValue_10, matchValue_11, typeArguments_4, typeArguments_5, excluded_2, isNullish_2, matchValue_13, symbol_2, matchValue_14;
|
|
72
372
|
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
373
|
+
const matchValue = typ.flags;
|
|
374
|
+
let matchResult;
|
|
375
|
+
if ($007CHasTypeFlags$007C_$007C(128, matchValue) != null) {
|
|
376
|
+
matchResult = 0;
|
|
377
|
+
}
|
|
378
|
+
else if ($007CHasTypeFlags$007C_$007C(256, matchValue) != null) {
|
|
379
|
+
matchResult = 0;
|
|
380
|
+
}
|
|
381
|
+
else if ($007CHasTypeFlags$007C_$007C(1048576, matchValue) != null) {
|
|
382
|
+
matchResult = 0;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
matchResult = 1;
|
|
386
|
+
}
|
|
387
|
+
switch (matchResult) {
|
|
388
|
+
case 0:
|
|
389
|
+
return new GlueType(/* Union */ 7, [new GlueTypeUnion((matchValue_1 = typ.flags, ($007CHasTypeFlags$007C_$007C(128, matchValue_1) != null) ? ((activePatternResult_4 = Type_StringLiteral_$007CString$007COther$007C(typ), (activePatternResult_4.tag === 1) ? (((item = Report_readerError_Z19516DCE("Exclude", "Expected a string literal", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 295), (objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"](), void (objectArg.push(item)))), empty())) : singleton_1(new GlueType(/* Literal */ 8, [new GlueLiteral(/* String */ 0, [activePatternResult_4.fields[0]])])))) : (($007CHasTypeFlags$007C_$007C(256, matchValue_1) != null) ? ((activePatternResult_6 = Type_NumberLiteral_$007CInt$007CFloat$007COther$007C(typ), (activePatternResult_6.tag === 1) ? singleton_1(new GlueType(/* Literal */ 8, [new GlueLiteral(/* Float */ 2, [activePatternResult_6.fields[0]])])) : ((activePatternResult_6.tag === 2) ? (((item_1 = Report_readerError_Z19516DCE("Exclude", "Expected a number literal", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 310), (objectArg_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"](), void (objectArg_1.push(item_1)))), empty())) : singleton_1(new GlueType(/* Literal */ 8, [new GlueLiteral(/* Int */ 1, [activePatternResult_6.fields[0]])]))))) : choose((typ_1) => {
|
|
390
|
+
const matchValue_2 = typ_1.flags;
|
|
391
|
+
if ($007CHasTypeFlags$007C_$007C(128, matchValue_2) != null) {
|
|
392
|
+
const literalType = typ_1;
|
|
393
|
+
return new GlueType(/* Literal */ 8, [new GlueLiteral(/* String */ 0, [literalType.value])]);
|
|
394
|
+
}
|
|
395
|
+
else if ($007CHasTypeFlags$007C_$007C(256, matchValue_2) != null) {
|
|
396
|
+
const activePatternResult_9 = Type_NumberLiteral_$007CInt$007CFloat$007COther$007C(typ_1);
|
|
397
|
+
switch (activePatternResult_9.tag) {
|
|
398
|
+
case 1:
|
|
399
|
+
return new GlueType(/* Literal */ 8, [new GlueLiteral(/* Float */ 2, [activePatternResult_9.fields[0]])]);
|
|
400
|
+
case 2: {
|
|
401
|
+
const item_2 = Report_readerError_Z19516DCE("Exclude", "Expected a number literal", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 337);
|
|
402
|
+
const objectArg_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
403
|
+
void (objectArg_2.push(item_2));
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
default:
|
|
407
|
+
return new GlueType(/* Literal */ 8, [new GlueLiteral(/* Int */ 1, [activePatternResult_9.fields[0]])]);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
return undefined;
|
|
412
|
+
}
|
|
413
|
+
}, toList(typ.types)))))]);
|
|
414
|
+
default: {
|
|
415
|
+
let matchResult_1;
|
|
416
|
+
if ($007CHasTypeFlags$007C_$007C(16777216, matchValue) != null) {
|
|
417
|
+
if ((matchValue_3 = typeReferenceNode.typeArguments, (matchValue_3 != null) && (((typeArguments = matchValue_3, typeArguments.length > 1)) && ((typeArguments_1 = matchValue_3, (excluded = item_4(0, typeArguments_1), (isNullish = ((typeNode) => {
|
|
418
|
+
const matchValue_4 = typeNode.kind;
|
|
419
|
+
switch (matchValue_4) {
|
|
420
|
+
case 157:
|
|
421
|
+
return true;
|
|
422
|
+
case 192:
|
|
423
|
+
return forAll(isNullish, typeNode.types);
|
|
424
|
+
case 201:
|
|
425
|
+
return typeNode.literal.kind === 106;
|
|
426
|
+
default:
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
}), (isNullish(item_4(1, typeArguments_1)) ? true : (excluded.kind === 199)) ? true : ((excluded.kind === 183) && ((matchValue_5 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(excluded.typeName), (matchValue_5 == null) ? false : ((symbol = matchValue_5, (matchValue_6 = symbol.flags, $007CHasSymbolFlags$007C_$007C(262144, matchValue_6) != null))))))))))))) {
|
|
430
|
+
matchResult_1 = 0;
|
|
431
|
+
}
|
|
432
|
+
else if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
433
|
+
if ((matchValue_7 = typeReferenceNode.typeArguments, (matchValue_7 != null) && (((typeArguments_2 = matchValue_7, typeArguments_2.length > 1)) && ((typeArguments_3 = matchValue_7, (excluded_1 = item_4(0, typeArguments_3), (isNullish_1 = ((typeNode_1) => {
|
|
434
|
+
const matchValue_8 = typeNode_1.kind;
|
|
435
|
+
switch (matchValue_8) {
|
|
436
|
+
case 157:
|
|
437
|
+
return true;
|
|
438
|
+
case 192:
|
|
439
|
+
return forAll(isNullish_1, typeNode_1.types);
|
|
440
|
+
case 201:
|
|
441
|
+
return typeNode_1.literal.kind === 106;
|
|
442
|
+
default:
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
}), (isNullish_1(item_4(1, typeArguments_3)) ? true : (excluded_1.kind === 199)) ? true : ((excluded_1.kind === 183) && ((matchValue_9 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(excluded_1.typeName), (matchValue_9 == null) ? false : ((symbol_1 = matchValue_9, (matchValue_10 = symbol_1.flags, $007CHasSymbolFlags$007C_$007C(262144, matchValue_10) != null))))))))))))) {
|
|
446
|
+
matchResult_1 = 0;
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
matchResult_1 = 1;
|
|
450
|
+
}
|
|
89
451
|
}
|
|
452
|
+
else {
|
|
453
|
+
matchResult_1 = 1;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
else if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
457
|
+
if ((matchValue_11 = typeReferenceNode.typeArguments, (matchValue_11 != null) && (((typeArguments_4 = matchValue_11, typeArguments_4.length > 1)) && ((typeArguments_5 = matchValue_11, (excluded_2 = item_4(0, typeArguments_5), (isNullish_2 = ((typeNode_2) => {
|
|
458
|
+
const matchValue_12 = typeNode_2.kind;
|
|
459
|
+
switch (matchValue_12) {
|
|
460
|
+
case 157:
|
|
461
|
+
return true;
|
|
462
|
+
case 192:
|
|
463
|
+
return forAll(isNullish_2, typeNode_2.types);
|
|
464
|
+
case 201:
|
|
465
|
+
return typeNode_2.literal.kind === 106;
|
|
466
|
+
default:
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
}), (isNullish_2(item_4(1, typeArguments_5)) ? true : (excluded_2.kind === 199)) ? true : ((excluded_2.kind === 183) && ((matchValue_13 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(excluded_2.typeName), (matchValue_13 == null) ? false : ((symbol_2 = matchValue_13, (matchValue_14 = symbol_2.flags, $007CHasSymbolFlags$007C_$007C(262144, matchValue_14) != null))))))))))))) {
|
|
470
|
+
matchResult_1 = 0;
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
matchResult_1 = 1;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
matchResult_1 = 1;
|
|
478
|
+
}
|
|
479
|
+
switch (matchResult_1) {
|
|
480
|
+
case 0:
|
|
481
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
90
482
|
default:
|
|
91
|
-
|
|
483
|
+
if ($007CHasTypeFlags$007C_$007C(4, matchValue) != null) {
|
|
484
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.String$]);
|
|
485
|
+
}
|
|
486
|
+
else if ($007CHasTypeFlags$007C_$007C(8, matchValue) != null) {
|
|
487
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Number$]);
|
|
488
|
+
}
|
|
489
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue) != null) {
|
|
490
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Bool]);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
const item_3 = Report_readerError_Z19516DCE("Exclude", "Was expecting the resolved type to be a literal or a union", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 391);
|
|
494
|
+
const objectArg_3 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
495
|
+
void (objectArg_3.push(item_3));
|
|
496
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
497
|
+
}
|
|
92
498
|
}
|
|
93
499
|
}
|
|
94
|
-
|
|
95
|
-
return void 0;
|
|
96
|
-
}
|
|
97
|
-
}, toList(typ.types)))))]);
|
|
500
|
+
}
|
|
98
501
|
}
|
|
99
502
|
|
|
100
503
|
function UtilityType_readMembers(reader, contextNode, typ) {
|
|
101
504
|
let objectArg;
|
|
102
|
-
return toList(distinct(
|
|
505
|
+
return toList(distinct(concat_1(choose((property) => {
|
|
103
506
|
const matchValue = property.declarations;
|
|
104
507
|
if (matchValue == null) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
508
|
+
const option_1 = readPropertyWithoutDeclaration(reader, contextNode, property);
|
|
509
|
+
if (option_1 != null) {
|
|
510
|
+
return singleton(option_1);
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
return undefined;
|
|
514
|
+
}
|
|
109
515
|
}
|
|
110
516
|
else {
|
|
111
|
-
return map((declaration) => reader
|
|
517
|
+
return map((declaration) => readInstantiatedMember(reader, contextNode, property, declaration), matchValue);
|
|
112
518
|
}
|
|
113
519
|
}, toList((objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), objectArg.getPropertiesOfType(typ))))), {
|
|
114
520
|
Equals: equals,
|
|
115
|
-
GetHashCode: safeHash,
|
|
521
|
+
GetHashCode: (x) => (safeHash(x) | 0),
|
|
116
522
|
}));
|
|
117
523
|
}
|
|
118
524
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
525
|
+
const UtilityType_expansionsInProgress = [];
|
|
526
|
+
|
|
527
|
+
export function UtilityType_tryExpandAnonymousObjectApplication(reader, typeReferenceNode) {
|
|
528
|
+
let matchValue, typeArguments, typNode;
|
|
529
|
+
if (!((matchValue = typeReferenceNode.typeArguments, (matchValue == null) ? false : ((typeArguments = matchValue, typeArguments.length > 0))))) {
|
|
530
|
+
return undefined;
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
|
|
534
|
+
let isNamedDeclaration;
|
|
535
|
+
if (Operators_IsNull(typ.symbol)) {
|
|
536
|
+
isNamedDeclaration = false;
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
const matchValue_1 = typ.symbol.declarations;
|
|
540
|
+
isNamedDeclaration = ((matchValue_1 == null) ? false : exists((declaration) => {
|
|
541
|
+
const matchValue_2 = declaration.kind;
|
|
542
|
+
switch (matchValue_2) {
|
|
543
|
+
case 263:
|
|
544
|
+
case 264:
|
|
545
|
+
return true;
|
|
546
|
+
default:
|
|
547
|
+
return false;
|
|
548
|
+
}
|
|
549
|
+
}, matchValue_1));
|
|
550
|
+
}
|
|
551
|
+
let isTypeAliasApplication;
|
|
552
|
+
const matchValue_3 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(typeReferenceNode.typeName);
|
|
553
|
+
if (matchValue_3 == null) {
|
|
554
|
+
isTypeAliasApplication = false;
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
const symbol = matchValue_3;
|
|
558
|
+
const matchValue_4 = symbol.flags;
|
|
559
|
+
isTypeAliasApplication = ($007CHasSymbolFlags$007C_$007C(524288, matchValue_4) != null);
|
|
560
|
+
}
|
|
561
|
+
const isInProgress = exists((inProgress) => (inProgress === typ), UtilityType_expansionsInProgress);
|
|
562
|
+
let isGenericMapped;
|
|
563
|
+
const matchValue_5 = typ.flags;
|
|
564
|
+
isGenericMapped = (($007CHasTypeFlags$007C_$007C(524288, matchValue_5) != null) && (((typ.objectFlags & 32) !== 0) && exists((argument) => {
|
|
565
|
+
const matchValue_6 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(argument).flags;
|
|
566
|
+
if ($007CHasTypeFlags$007C_$007C(262144, matchValue_6) != null) {
|
|
567
|
+
return true;
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
}, value_8(typeReferenceNode.typeArguments))));
|
|
573
|
+
const isArrayLike = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().isArrayLikeType(typ);
|
|
574
|
+
const matchValue_7 = typ.flags;
|
|
575
|
+
let matchResult;
|
|
576
|
+
if ($007CHasTypeFlags$007C_$007C(524288, matchValue_7) != null) {
|
|
577
|
+
if ((isTupleType(typ) ? true : (isArrayLike && !isNamedDeclaration)) && !isInProgress) {
|
|
578
|
+
matchResult = 0;
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
matchResult = 1;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
matchResult = 1;
|
|
586
|
+
}
|
|
587
|
+
switch (matchResult) {
|
|
588
|
+
case 0: {
|
|
589
|
+
const flags = 1 | 16384;
|
|
590
|
+
const option_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, flags);
|
|
591
|
+
if (option_1 != null) {
|
|
592
|
+
return (typNode = option_1, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode));
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
return undefined;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
default: {
|
|
599
|
+
let matchResult_1;
|
|
600
|
+
if ($007CHasTypeFlags$007C_$007C(524288, matchValue_7) != null) {
|
|
601
|
+
if ((!isNamedDeclaration && !isInProgress) && !isGenericMapped) {
|
|
602
|
+
matchResult_1 = 0;
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
matchResult_1 = 1;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
matchResult_1 = 1;
|
|
610
|
+
}
|
|
611
|
+
switch (matchResult_1) {
|
|
612
|
+
case 0: {
|
|
613
|
+
void (UtilityType_expansionsInProgress.push(typ));
|
|
614
|
+
let members;
|
|
615
|
+
try {
|
|
616
|
+
members = UtilityType_readMembers(reader, typeReferenceNode, typ);
|
|
617
|
+
}
|
|
618
|
+
finally {
|
|
619
|
+
UtilityType_expansionsInProgress.splice(UtilityType_expansionsInProgress.length - 1, 1);
|
|
620
|
+
}
|
|
621
|
+
if (isEmpty(members)) {
|
|
622
|
+
return undefined;
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
return new GlueType(/* TypeLiteral */ 21, [new GlueTypeLiteral(members)]);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
default: {
|
|
629
|
+
let matchResult_2;
|
|
630
|
+
if ($007CHasTypeFlags$007C_$007C(4, matchValue_7) != null) {
|
|
631
|
+
if (isTypeAliasApplication) {
|
|
632
|
+
matchResult_2 = 0;
|
|
633
|
+
}
|
|
634
|
+
else if ($007CHasTypeFlags$007C_$007C(8, matchValue_7) != null) {
|
|
635
|
+
if (isTypeAliasApplication) {
|
|
636
|
+
matchResult_2 = 0;
|
|
637
|
+
}
|
|
638
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_7) != null) {
|
|
639
|
+
if (isTypeAliasApplication) {
|
|
640
|
+
matchResult_2 = 0;
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
matchResult_2 = 1;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
else {
|
|
647
|
+
matchResult_2 = 1;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_7) != null) {
|
|
651
|
+
if (isTypeAliasApplication) {
|
|
652
|
+
matchResult_2 = 0;
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
matchResult_2 = 1;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
matchResult_2 = 1;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
else if ($007CHasTypeFlags$007C_$007C(8, matchValue_7) != null) {
|
|
663
|
+
if (isTypeAliasApplication) {
|
|
664
|
+
matchResult_2 = 0;
|
|
665
|
+
}
|
|
666
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_7) != null) {
|
|
667
|
+
if (isTypeAliasApplication) {
|
|
668
|
+
matchResult_2 = 0;
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
matchResult_2 = 1;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
matchResult_2 = 1;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
else if ($007CHasTypeFlags$007C_$007C(16, matchValue_7) != null) {
|
|
679
|
+
if (isTypeAliasApplication) {
|
|
680
|
+
matchResult_2 = 0;
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
matchResult_2 = 1;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
matchResult_2 = 1;
|
|
688
|
+
}
|
|
689
|
+
switch (matchResult_2) {
|
|
690
|
+
case 0:
|
|
691
|
+
return readTypeUsingFlags(reader, typ);
|
|
692
|
+
default:
|
|
693
|
+
return undefined;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const UtilityType_partialsBeingRead = [];
|
|
703
|
+
|
|
704
|
+
function UtilityType_baseTypeOf(reader, typeNode) {
|
|
705
|
+
let option_2, option, binder, checker, option_1, mapping, objectArg, option_3;
|
|
706
|
+
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeNode);
|
|
707
|
+
const matchValue = typ.flags;
|
|
708
|
+
let matchResult;
|
|
126
709
|
if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
710
|
+
if ((typeNode.pos < 0) && (typeNode.kind === 183)) {
|
|
711
|
+
matchResult = 0;
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
matchResult = 1;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
matchResult = 1;
|
|
719
|
+
}
|
|
720
|
+
switch (matchResult) {
|
|
721
|
+
case 0:
|
|
722
|
+
return defaultArg((option_2 = ((option = symbolAtLocation(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), typeNode.typeName), (binder = ((checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), (symbol) => resolveAlias(checker, symbol))), (option_1 = option, (option_1 != null) ? binder(option_1) : undefined)))), (mapping = ((objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), (symbol_1) => objectArg.getDeclaredTypeOfSymbol(symbol_1))), (option_3 = option_2, (option_3 != null) ? mapping(option_3) : undefined))), typ);
|
|
723
|
+
default:
|
|
724
|
+
return typ;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function UtilityType_literalKeysOf(typeNode_mut) {
|
|
729
|
+
UtilityType_literalKeysOf:
|
|
730
|
+
while (true) {
|
|
731
|
+
const typeNode = typeNode_mut;
|
|
732
|
+
const matchValue = typeNode.kind;
|
|
733
|
+
switch (matchValue) {
|
|
734
|
+
case 192:
|
|
735
|
+
return collect_1(UtilityType_literalKeysOf, toList(typeNode.types));
|
|
736
|
+
case 196: {
|
|
737
|
+
typeNode_mut = typeNode.type;
|
|
738
|
+
continue UtilityType_literalKeysOf;
|
|
739
|
+
}
|
|
740
|
+
case 201: {
|
|
741
|
+
const literal = typeNode.literal;
|
|
742
|
+
if (literal.kind === 11) {
|
|
743
|
+
return singleton_1(literal.text);
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
return empty();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
default:
|
|
750
|
+
return empty();
|
|
751
|
+
}
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function UtilityType_withoutForeignTypeParameters(reader, bound, members) {
|
|
757
|
+
const declaredAbove = (node) => {
|
|
758
|
+
if (Operators_IsNull(node)) {
|
|
759
|
+
return empty();
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
const typeParameters = node.typeParameters;
|
|
763
|
+
return append_1((typeParameters == null) ? empty() : map_1((p) => identifierText(p.name), toList(typeParameters)), declaredAbove(node.parent));
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
let inScope;
|
|
767
|
+
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
768
|
+
inScope = ((matchValue == null) ? empty() : declaredAbove(matchValue));
|
|
769
|
+
const foreign = ofList(map_1((name_1) => [name_1, new GlueType(/* Primitive */ 3, [GluePrimitive.Any])], filter((name) => {
|
|
770
|
+
if (!contains(name, inScope, {
|
|
771
|
+
Equals: (x_1, y_1) => (x_1 === y_1),
|
|
772
|
+
GetHashCode: (x_1) => (stringHash(x_1) | 0),
|
|
773
|
+
})) {
|
|
774
|
+
return !FSharpMap__ContainsKey(bound, name);
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
return false;
|
|
778
|
+
}
|
|
779
|
+
}, List_distinct(collect_1((glueMember) => {
|
|
780
|
+
switch (glueMember.tag) {
|
|
781
|
+
case 1:
|
|
782
|
+
return GlueSubstitution_mentionedTypeParameters(glueMember.fields[0].Type);
|
|
783
|
+
case 0: {
|
|
784
|
+
const method = glueMember.fields[0];
|
|
785
|
+
return append_1(GlueSubstitution_mentionedTypeParameters(method.Type), collect_1((parameter) => GlueSubstitution_mentionedTypeParameters(parameter.Type), method.Parameters));
|
|
786
|
+
}
|
|
787
|
+
case 6: {
|
|
788
|
+
const method_1 = glueMember.fields[0];
|
|
789
|
+
return append_1(GlueSubstitution_mentionedTypeParameters(method_1.Type), collect_1((parameter_1) => GlueSubstitution_mentionedTypeParameters(parameter_1.Type), method_1.Parameters));
|
|
790
|
+
}
|
|
791
|
+
default:
|
|
792
|
+
return empty();
|
|
793
|
+
}
|
|
794
|
+
}, members), {
|
|
795
|
+
Equals: (x, y) => (x === y),
|
|
796
|
+
GetHashCode: (x) => (stringHash(x) | 0),
|
|
797
|
+
}))), {
|
|
798
|
+
Compare: (x_2, y_2) => (comparePrimitives(x_2, y_2) | 0),
|
|
799
|
+
});
|
|
800
|
+
if (FSharpMap__get_IsEmpty(foreign)) {
|
|
801
|
+
return members;
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
return map_1((glueMember_1) => GlueSubstitution_substituteMember(foreign, glueMember_1), members);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export function UtilityType_readPartial(reader, typeReferenceNode) {
|
|
809
|
+
const baseType = UtilityType_baseTypeOf(reader, item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
810
|
+
if (exists((typ) => (typ === baseType), UtilityType_partialsBeingRead)) {
|
|
811
|
+
const item = Report_readerError_Z19516DCE("Partial", "Recursive Partial is not supported, defaulting to obj", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 626);
|
|
812
|
+
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
813
|
+
void (objectArg.push(item));
|
|
814
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
131
815
|
}
|
|
132
816
|
else {
|
|
133
|
-
|
|
817
|
+
void (UtilityType_partialsBeingRead.push(baseType));
|
|
818
|
+
try {
|
|
819
|
+
if (isTupleType(baseType)) {
|
|
820
|
+
const flags = 1 | 16384;
|
|
821
|
+
const typNode = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode), undefined, flags);
|
|
822
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode);
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
const baseNode = item_4(0, value_8(typeReferenceNode.typeArguments));
|
|
826
|
+
let members;
|
|
827
|
+
const matchValue = baseType.flags;
|
|
828
|
+
let matchResult;
|
|
829
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
830
|
+
if (baseNode.kind === 133) {
|
|
831
|
+
matchResult = 0;
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
matchResult = 1;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
else {
|
|
838
|
+
matchResult = 1;
|
|
839
|
+
}
|
|
840
|
+
switch (matchResult) {
|
|
841
|
+
case 0: {
|
|
842
|
+
members = empty();
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
default: {
|
|
846
|
+
let matchResult_1;
|
|
847
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
848
|
+
if ((baseNode.pos < 0) && (baseNode.kind === 187)) {
|
|
849
|
+
matchResult_1 = 0;
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
matchResult_1 = 1;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
matchResult_1 = 1;
|
|
857
|
+
}
|
|
858
|
+
switch (matchResult_1) {
|
|
859
|
+
case 0: {
|
|
860
|
+
const matchValue_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](baseNode);
|
|
861
|
+
members = ((matchValue_1.tag === 21) ? matchValue_1.fields[0].Members : empty());
|
|
862
|
+
break;
|
|
863
|
+
}
|
|
864
|
+
default:
|
|
865
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
866
|
+
const item_1 = Report_readerError_Z19516DCE("partial inner type", "Was not able to resolve the inner type, and defaulting to any. If the base type is defined, in another file, please make sure to include it in the input files", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 669);
|
|
867
|
+
const objectArg_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
868
|
+
void (objectArg_1.push(item_1));
|
|
869
|
+
members = empty();
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
members = UtilityType_readMembers(reader, typeReferenceNode, baseType);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
const defaults = defaultTypeArguments(reader, item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
878
|
+
let members_2;
|
|
879
|
+
const members_1 = map_1((glueMember) => GlueSubstitution_substituteMember(defaults, glueMember), members);
|
|
880
|
+
members_2 = ((typeReferenceNode.pos < 0) ? UtilityType_withoutForeignTypeParameters(reader, defaults, members_1) : members_1);
|
|
881
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* Partial */ 0, [new GlueInterface(empty(), getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), typeReferenceNode), entityNameText(typeReferenceNode.typeName), members_2, empty(), empty())])]);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
finally {
|
|
885
|
+
UtilityType_partialsBeingRead.splice(UtilityType_partialsBeingRead.length - 1, 1);
|
|
886
|
+
}
|
|
134
887
|
}
|
|
135
|
-
return new GlueType(26, [new GlueUtilityType(0, [new GlueInterface(getFullNameOrEmpty(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), typeReferenceNode), typeReferenceNode.typeName.getText(), members, empty(), empty())])]);
|
|
136
888
|
}
|
|
137
889
|
|
|
138
890
|
export function UtilityType_readRecord(reader, typeReferenceNode) {
|
|
139
891
|
const typeArguments = readTypeArguments(reader, typeReferenceNode);
|
|
140
|
-
return new GlueType(26, [new GlueUtilityType(1, [new GlueRecord(
|
|
892
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* Record */ 1, [new GlueRecord(item_5(0, typeArguments), item_5(1, typeArguments))])]);
|
|
141
893
|
}
|
|
142
894
|
|
|
143
895
|
export function UtilityType_readReturnType(reader, typeReferenceNode) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
896
|
+
const rawTyp = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
|
|
897
|
+
let typ;
|
|
898
|
+
const matchValue = rawTyp.flags;
|
|
899
|
+
let matchResult;
|
|
900
|
+
if ($007CHasTypeFlags$007C_$007C(16777216, matchValue) != null) {
|
|
901
|
+
matchResult = 0;
|
|
902
|
+
}
|
|
903
|
+
else if ($007CHasTypeFlags$007C_$007C(8388608, matchValue) != null) {
|
|
904
|
+
matchResult = 0;
|
|
905
|
+
}
|
|
906
|
+
else if ($007CHasTypeFlags$007C_$007C(33554432, matchValue) != null) {
|
|
907
|
+
matchResult = 0;
|
|
908
|
+
}
|
|
909
|
+
else if ($007CHasTypeFlags$007C_$007C(4194304, matchValue) != null) {
|
|
910
|
+
matchResult = 0;
|
|
148
911
|
}
|
|
149
912
|
else {
|
|
150
|
-
|
|
151
|
-
|
|
913
|
+
matchResult = 1;
|
|
914
|
+
}
|
|
915
|
+
switch (matchResult) {
|
|
916
|
+
case 0: {
|
|
917
|
+
typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getApparentType(rawTyp);
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
default:
|
|
921
|
+
typ = rawTyp;
|
|
922
|
+
}
|
|
923
|
+
const matchValue_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, undefined);
|
|
924
|
+
if (matchValue_1 == null) {
|
|
925
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* ReturnType */ 2, [readTypeUsingFlags(reader, typ)])]);
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
const typeNode = matchValue_1;
|
|
929
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* ReturnType */ 2, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode)])]);
|
|
152
930
|
}
|
|
153
931
|
}
|
|
154
932
|
|
|
155
933
|
export function UtilityType_readThisParameterType(reader, typeReferenceNode) {
|
|
156
934
|
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
|
|
157
|
-
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ,
|
|
935
|
+
const matchValue = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().typeToTypeNode(typ, undefined, undefined);
|
|
158
936
|
if (matchValue == null) {
|
|
159
|
-
return new GlueType(26, [new GlueUtilityType(3, [readTypeUsingFlags(reader, typ)])]);
|
|
937
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* ThisParameterType */ 3, [readTypeUsingFlags(reader, typ)])]);
|
|
160
938
|
}
|
|
161
939
|
else {
|
|
162
940
|
const typeNode = matchValue;
|
|
163
|
-
return new GlueType(26, [new GlueUtilityType(3, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode)])]);
|
|
941
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* ThisParameterType */ 3, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode)])]);
|
|
164
942
|
}
|
|
165
943
|
}
|
|
166
944
|
|
|
167
945
|
export function UtilityType_readOmit(reader, typeReferenceNode) {
|
|
168
|
-
let
|
|
946
|
+
let option_1, matchValue_3, item_1, objectArg_2, objectArg_3, members_3;
|
|
169
947
|
let keysToOmitType;
|
|
170
|
-
const node =
|
|
948
|
+
const node = item_4(1, value_8(typeReferenceNode.typeArguments));
|
|
171
949
|
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
172
950
|
keysToOmitType = objectArg.getTypeFromTypeNode(node);
|
|
173
951
|
const tryReadValueOfKeys = (typ) => {
|
|
174
952
|
const activePatternResult = Type_StringLiteral_$007CString$007COther$007C(typ);
|
|
175
953
|
if (activePatternResult.tag === 1) {
|
|
176
|
-
const item = Report_readerError_Z19516DCE("keysToOmit", "Expected a string literal", typeReferenceNode, "/
|
|
954
|
+
const item = Report_readerError_Z19516DCE("keysToOmit", "Expected a string literal", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 768);
|
|
177
955
|
const objectArg_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
178
956
|
void (objectArg_1.push(item));
|
|
179
|
-
return
|
|
957
|
+
return undefined;
|
|
180
958
|
}
|
|
181
959
|
else {
|
|
182
960
|
return activePatternResult.fields[0];
|
|
183
961
|
}
|
|
184
962
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
963
|
+
let keysToOmit;
|
|
964
|
+
const matchValue = keysToOmitType.flags;
|
|
965
|
+
let matchResult;
|
|
966
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue) != null) {
|
|
967
|
+
if (typeReferenceNode.pos < 0) {
|
|
968
|
+
matchResult = 0;
|
|
969
|
+
}
|
|
970
|
+
else {
|
|
971
|
+
matchResult = 1;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
else {
|
|
975
|
+
matchResult = 1;
|
|
976
|
+
}
|
|
977
|
+
switch (matchResult) {
|
|
978
|
+
case 0: {
|
|
979
|
+
keysToOmit = ofList_1(UtilityType_literalKeysOf(item_4(1, value_8(typeReferenceNode.typeArguments))));
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
default:
|
|
983
|
+
keysToOmit = (keysToOmitType.isUnion() ? choose_1(tryReadValueOfKeys, keysToOmitType.types) : defaultArg((option_1 = tryReadValueOfKeys(keysToOmitType), (option_1 != null) ? singleton(option_1) : undefined), []));
|
|
984
|
+
}
|
|
985
|
+
const baseType = UtilityType_baseTypeOf(reader, item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
986
|
+
let literalMembers;
|
|
987
|
+
const matchValue_1 = baseType.flags;
|
|
988
|
+
let matchResult_1;
|
|
989
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue_1) != null) {
|
|
990
|
+
if (typeReferenceNode.pos < 0) {
|
|
991
|
+
matchResult_1 = 0;
|
|
194
992
|
}
|
|
195
993
|
else {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
994
|
+
matchResult_1 = 1;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
matchResult_1 = 1;
|
|
999
|
+
}
|
|
1000
|
+
switch (matchResult_1) {
|
|
1001
|
+
case 0: {
|
|
1002
|
+
const matchValue_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
1003
|
+
literalMembers = ((matchValue_2.tag === 20) ? matchValue_2.fields[0] : ((matchValue_2.tag === 21) ? matchValue_2.fields[0].Members : undefined));
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
default:
|
|
1007
|
+
literalMembers = undefined;
|
|
1008
|
+
}
|
|
1009
|
+
const members_1 = collect_1((property) => {
|
|
1010
|
+
const matchValue_4 = property.declarations;
|
|
1011
|
+
if (matchValue_4 == null) {
|
|
1012
|
+
throw new Exception(Report_readerError_Z19516DCE("type node", "Missing declarations", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 827));
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
return map_1((declaration) => readInstantiatedMember(reader, typeReferenceNode, property, declaration), toList(matchValue_4));
|
|
1016
|
+
}
|
|
1017
|
+
}, toList(filter_1((prop) => !contains_1(prop.name, keysToOmit, {
|
|
1018
|
+
Equals: (x, y) => (x === y),
|
|
1019
|
+
GetHashCode: (x) => (stringHash(x) | 0),
|
|
1020
|
+
}), (matchValue_3 = baseType.flags, ($007CHasTypeFlags$007C_$007C(1, matchValue_3) != null) ? ((literalMembers != null) ? [] : (($007CHasTypeFlags$007C_$007C(1, matchValue_3) != null) ? (((item_1 = Report_readerError_Z19516DCE("omit base type", "Was not able to resolve the base type, and defaulting to any. If the base type is defined, in another file, please make sure to include it in the input files", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 802), (objectArg_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"](), void (objectArg_2.push(item_1)))), [])) : ((objectArg_3 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), objectArg_3.getPropertiesOfType(baseType))))) : (($007CHasTypeFlags$007C_$007C(1, matchValue_3) != null) ? (((item_1 = Report_readerError_Z19516DCE("omit base type", "Was not able to resolve the base type, and defaulting to any. If the base type is defined, in another file, please make sure to include it in the input files", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 802), (objectArg_2 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"](), void (objectArg_2.push(item_1)))), [])) : ((objectArg_3 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"](), objectArg_3.getPropertiesOfType(baseType))))))));
|
|
1021
|
+
const defaults = defaultTypeArguments(reader, item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
1022
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* Omit */ 4, [(members_3 = map_1((glueMember_2) => GlueSubstitution_substituteMember(defaults, glueMember_2), (literalMembers == null) ? members_1 : filter((glueMember_1) => {
|
|
1023
|
+
let matchValue_5;
|
|
1024
|
+
const glueMember = glueMember_1;
|
|
1025
|
+
switch (glueMember.tag) {
|
|
1026
|
+
case 0: {
|
|
1027
|
+
matchValue_5 = glueMember.fields[0].Name;
|
|
1028
|
+
break;
|
|
199
1029
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1030
|
+
case 6: {
|
|
1031
|
+
matchValue_5 = glueMember.fields[0].Name;
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
case 2: {
|
|
1035
|
+
matchValue_5 = glueMember.fields[0].Name;
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1038
|
+
case 3: {
|
|
1039
|
+
matchValue_5 = glueMember.fields[0].Name;
|
|
1040
|
+
break;
|
|
1041
|
+
}
|
|
1042
|
+
case 4:
|
|
1043
|
+
case 5:
|
|
1044
|
+
case 7: {
|
|
1045
|
+
matchValue_5 = undefined;
|
|
1046
|
+
break;
|
|
205
1047
|
}
|
|
1048
|
+
default:
|
|
1049
|
+
matchValue_5 = glueMember.fields[0].Name;
|
|
206
1050
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
1051
|
+
if (matchValue_5 == null) {
|
|
1052
|
+
return true;
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
return !contains_1(matchValue_5, keysToOmit, {
|
|
1056
|
+
Equals: (x_1, y_1) => (x_1 === y_1),
|
|
1057
|
+
GetHashCode: (x_1) => (stringHash(x_1) | 0),
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
}, literalMembers)), (typeReferenceNode.pos < 0) ? UtilityType_withoutForeignTypeParameters(reader, defaults, members_3) : members_3)])]);
|
|
211
1061
|
}
|
|
212
1062
|
|
|
213
1063
|
export function UtilityType_readReadonly(reader, typeReferenceNode) {
|
|
214
1064
|
const typ = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getTypeFromTypeNode(typeReferenceNode);
|
|
215
|
-
const matchValue = typ.flags
|
|
1065
|
+
const matchValue = typ.flags;
|
|
216
1066
|
let matchResult;
|
|
217
1067
|
if ($007CHasTypeFlags$007C_$007C(524288, matchValue) != null) {
|
|
218
1068
|
matchResult = 0;
|
|
@@ -225,86 +1075,272 @@ export function UtilityType_readReadonly(reader, typeReferenceNode) {
|
|
|
225
1075
|
}
|
|
226
1076
|
switch (matchResult) {
|
|
227
1077
|
case 0:
|
|
228
|
-
return new GlueType(26, [new GlueUtilityType(5, [new GlueReadonly(0, [UtilityType_readMembers(reader, typeReferenceNode, typ)])])]);
|
|
1078
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* Readonly */ 5, [new GlueReadonly(/* Members */ 0, [UtilityType_readMembers(reader, typeReferenceNode, typ)])])]);
|
|
229
1079
|
default:
|
|
230
1080
|
if ($007CHasTypeFlags$007C_$007C(1048576, matchValue) != null) {
|
|
231
1081
|
const unionType = typ;
|
|
232
1082
|
try {
|
|
233
|
-
return new GlueType(26, [new GlueUtilityType(5, [new GlueReadonly(1, [toList(choose_1((innerType) => {
|
|
1083
|
+
return new GlueType(/* UtilityType */ 26, [new GlueUtilityType(/* Readonly */ 5, [new GlueReadonly(/* Union */ 1, [toList(choose_1((innerType) => {
|
|
234
1084
|
let copyOfStruct, Name;
|
|
235
1085
|
if ((copyOfStruct = innerType.flags, (copyOfStruct & 524288) !== 0)) {
|
|
236
|
-
return (Name =
|
|
1086
|
+
return (Name = item_4(0, value_8(innerType.aliasTypeArguments)).symbol.name, new GlueInterface(empty(), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getFullyQualifiedName(item_4(0, value_8(innerType.aliasTypeArguments)).symbol), Name, UtilityType_readMembers(reader, typeReferenceNode, innerType), empty(), empty()));
|
|
237
1087
|
}
|
|
238
1088
|
else {
|
|
239
|
-
return
|
|
1089
|
+
return undefined;
|
|
240
1090
|
}
|
|
241
1091
|
}, unionType.types))])])]);
|
|
242
1092
|
}
|
|
243
1093
|
catch (matchValue_1) {
|
|
244
|
-
const item = Report_readerError_Z19516DCE("Readonly", "Unable to read the members of the union type", typeReferenceNode, "/
|
|
1094
|
+
const item = Report_readerError_Z19516DCE("Readonly", "Unable to read the members of the union type", typeReferenceNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 909);
|
|
245
1095
|
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
246
1096
|
void (objectArg.push(item));
|
|
247
|
-
return new GlueType(3, [
|
|
1097
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
248
1098
|
}
|
|
249
1099
|
}
|
|
250
1100
|
else {
|
|
251
|
-
return new GlueType(3, [
|
|
1101
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
252
1102
|
}
|
|
253
1103
|
}
|
|
254
1104
|
}
|
|
255
1105
|
|
|
256
1106
|
export function readTypeNode(reader, typeNode) {
|
|
1107
|
+
let option_11, symbol_4, matchValue_13, matchValue_20, option_14, arg_2, symbol_5, symbol_7, symbol_8, symbol_9, matchValue_26, option_21, symbol_11, matchValue_27;
|
|
257
1108
|
const checker = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]();
|
|
258
|
-
const matchValue = typeNode.kind
|
|
1109
|
+
const matchValue = typeNode.kind;
|
|
259
1110
|
switch (matchValue) {
|
|
260
1111
|
case 106:
|
|
261
|
-
return new GlueType(3, [
|
|
1112
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Null]);
|
|
262
1113
|
case 116:
|
|
263
|
-
return new GlueType(3, [
|
|
1114
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Unit]);
|
|
264
1115
|
case 133:
|
|
265
|
-
return new GlueType(3, [
|
|
1116
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
266
1117
|
case 136:
|
|
267
|
-
return new GlueType(
|
|
1118
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Bool]);
|
|
268
1119
|
case 146:
|
|
269
|
-
return new GlueType(3, [
|
|
1120
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Never]);
|
|
270
1121
|
case 150:
|
|
271
|
-
return new GlueType(3, [
|
|
1122
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Number$]);
|
|
272
1123
|
case 151:
|
|
273
|
-
return new GlueType(3, [
|
|
1124
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Object$]);
|
|
274
1125
|
case 154:
|
|
275
|
-
return new GlueType(3, [
|
|
1126
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.String$]);
|
|
276
1127
|
case 155:
|
|
277
|
-
return new GlueType(3, [
|
|
1128
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Symbol$]);
|
|
278
1129
|
case 157:
|
|
279
|
-
return new GlueType(3, [
|
|
1130
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Undefined]);
|
|
280
1131
|
case 159:
|
|
281
|
-
return
|
|
282
|
-
case
|
|
283
|
-
return new GlueType(
|
|
1132
|
+
return GlueType.Unknown;
|
|
1133
|
+
case 163:
|
|
1134
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.BigInt$]);
|
|
1135
|
+
case 182: {
|
|
1136
|
+
const matchValue_11 = typeNode.assertsModifier;
|
|
1137
|
+
if (matchValue_11 == null) {
|
|
1138
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Bool]);
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Unit]);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
284
1144
|
case 183: {
|
|
285
1145
|
const typeReferenceNode = typeNode;
|
|
286
|
-
const symbolOpt = checker
|
|
1146
|
+
const symbolOpt = symbolAtLocation(checker, typeReferenceNode.typeName);
|
|
287
1147
|
const readTypeReference = (isStandardLibrary) => {
|
|
288
|
-
|
|
289
|
-
if ($007CHasSymbolFlags$007C_$007C(262144,
|
|
290
|
-
return new GlueType(16, [
|
|
1148
|
+
let symbol_2, matchValue_4, declarations, typNode, option_7, valueDeclaration, matchValue_6;
|
|
1149
|
+
if ((symbolOpt == null) ? false : ((symbol_2 = symbolOpt, (matchValue_4 = symbol_2.flags, $007CHasSymbolFlags$007C_$007C(262144, matchValue_4) != null)))) {
|
|
1150
|
+
return new GlueType(/* TypeParameter */ 16, [value_8(symbolOpt).name]);
|
|
291
1151
|
}
|
|
292
1152
|
else {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
1153
|
+
let matchValue_5;
|
|
1154
|
+
const option_5 = UtilityType_tryExpandAnonymousObjectApplication(reader, typeReferenceNode);
|
|
1155
|
+
if (option_5 != null) {
|
|
1156
|
+
matchValue_5 = option_5;
|
|
1157
|
+
}
|
|
1158
|
+
else {
|
|
1159
|
+
let isConditionalAlias;
|
|
1160
|
+
let matchValue_1;
|
|
1161
|
+
const option_1 = symbolOpt;
|
|
1162
|
+
matchValue_1 = ((option_1 != null) ? resolveAlias(checker, option_1) : undefined);
|
|
1163
|
+
if (matchValue_1 == null) {
|
|
1164
|
+
isConditionalAlias = false;
|
|
1165
|
+
}
|
|
1166
|
+
else {
|
|
1167
|
+
const symbol_1 = matchValue_1;
|
|
1168
|
+
const matchValue_2 = symbol_1.declarations;
|
|
1169
|
+
let matchResult, declarations_1;
|
|
1170
|
+
if (matchValue_2 != null) {
|
|
1171
|
+
if ((declarations = matchValue_2, declarations.length > 0)) {
|
|
1172
|
+
matchResult = 0;
|
|
1173
|
+
declarations_1 = matchValue_2;
|
|
1174
|
+
}
|
|
1175
|
+
else {
|
|
1176
|
+
matchResult = 1;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
else {
|
|
1180
|
+
matchResult = 1;
|
|
1181
|
+
}
|
|
1182
|
+
switch (matchResult) {
|
|
1183
|
+
case 0: {
|
|
1184
|
+
const declaration = item_4(0, declarations_1);
|
|
1185
|
+
isConditionalAlias = ((declaration.kind === 265) && (declaration.type.kind === 194));
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
default:
|
|
1189
|
+
isConditionalAlias = false;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
if ((typeReferenceNode.pos < 0) ? true : !isConditionalAlias) {
|
|
1193
|
+
matchValue_5 = undefined;
|
|
1194
|
+
}
|
|
1195
|
+
else {
|
|
1196
|
+
const typ = checker.getTypeFromTypeNode(typeReferenceNode);
|
|
1197
|
+
let isUnknown;
|
|
1198
|
+
const matchValue_3 = typ.flags;
|
|
1199
|
+
let matchResult_1;
|
|
1200
|
+
if ($007CHasTypeFlags$007C_$007C(1, matchValue_3) != null) {
|
|
1201
|
+
matchResult_1 = 0;
|
|
1202
|
+
}
|
|
1203
|
+
else if ($007CHasTypeFlags$007C_$007C(131072, matchValue_3) != null) {
|
|
1204
|
+
matchResult_1 = 0;
|
|
1205
|
+
}
|
|
1206
|
+
else {
|
|
1207
|
+
matchResult_1 = 1;
|
|
1208
|
+
}
|
|
1209
|
+
switch (matchResult_1) {
|
|
1210
|
+
case 0: {
|
|
1211
|
+
isUnknown = true;
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1214
|
+
default:
|
|
1215
|
+
isUnknown = false;
|
|
1216
|
+
}
|
|
1217
|
+
if (isDeferredConditional(typ) ? true : isUnknown) {
|
|
1218
|
+
matchValue_5 = undefined;
|
|
1219
|
+
}
|
|
1220
|
+
else {
|
|
1221
|
+
const flags = 1 | 16384;
|
|
1222
|
+
const option_3 = checker.typeToTypeNode(typ, typeReferenceNode, flags);
|
|
1223
|
+
matchValue_5 = ((option_3 != null) ? ((typNode = option_3, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode))) : undefined);
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
if (matchValue_5 == null) {
|
|
1228
|
+
const isQualified = typeReferenceNode.typeName.kind === 166;
|
|
1229
|
+
const writtenName = () => {
|
|
1230
|
+
if (isQualified) {
|
|
1231
|
+
return typeReferenceNode.typeName.right.text;
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
return identifierText(typeReferenceNode.typeName);
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
let name;
|
|
1238
|
+
if (symbolOpt == null) {
|
|
1239
|
+
name = writtenName();
|
|
296
1240
|
}
|
|
297
1241
|
else {
|
|
298
|
-
|
|
1242
|
+
const symbol_3 = symbolOpt;
|
|
1243
|
+
name = defaultArg(orElse(importedName(checker, symbol_3), (option_7 = symbol_3.valueDeclaration, (option_7 != null) ? ((valueDeclaration = option_7, (matchValue_6 = valueDeclaration.kind, (matchValue_6 === 266) ? (isQualified ? symbol_3.name : writtenName()) : ((matchValue_6 === 306) ? (valueDeclaration.symbol.parent.getName()) : writtenName())))) : undefined)), writtenName());
|
|
1244
|
+
}
|
|
1245
|
+
const isUnresolved = ((reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"]() != null) && (symbolOpt == null)) && (typeReferenceNode.pos >= 0);
|
|
1246
|
+
const isExternal = isExternalToPackages(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt);
|
|
1247
|
+
if (isUnresolved ? true : (isExternal && !FSharpSet__Contains(knownExternalTypeNames, name))) {
|
|
1248
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
299
1249
|
}
|
|
300
|
-
|
|
1250
|
+
else {
|
|
1251
|
+
return new GlueType(/* TypeReference */ 13, [new GlueTypeReference((name.indexOf(".") >= 0) ? name : sanitizeTypeName(name), getFullNameOrEmpty(checker, typeReferenceNode.typeName), isLibraryName(reader, name) ? empty() : modulePathForSymbol(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), isQualified, symbolOpt), truncateToDeclaredArity(reader, symbolOpt, readTypeArguments(reader, typeReferenceNode)), (isStandardLibrary ? true : isExternal) ? true : isLibraryName(reader, name))]);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
return matchValue_5;
|
|
1256
|
+
}
|
|
301
1257
|
}
|
|
302
1258
|
};
|
|
303
|
-
if (isFromEs5Lib(symbolOpt)) {
|
|
304
|
-
|
|
305
|
-
|
|
1259
|
+
if (((entityNameText(typeReferenceNode.typeName) === "NoInfer") && (typeReferenceNode.typeArguments != null)) && ((((option_11 = symbolOpt, (option_11 != null) ? ((symbol_4 = option_11, symbol_4.declarations)) : undefined)) == null) ? true : isFromEs5Lib(symbolOpt))) {
|
|
1260
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](item_4(0, value_8(typeReferenceNode.typeArguments)));
|
|
1261
|
+
}
|
|
1262
|
+
else if (isFromEs5Lib(symbolOpt)) {
|
|
1263
|
+
const matchValue_10 = getFullNameOrEmpty(checker, typeReferenceNode.typeName);
|
|
1264
|
+
switch (matchValue_10) {
|
|
306
1265
|
case "Exclude":
|
|
307
1266
|
return UtilityType_readExclude(reader, typeReferenceNode);
|
|
1267
|
+
case "Uppercase":
|
|
1268
|
+
case "Lowercase":
|
|
1269
|
+
case "Capitalize":
|
|
1270
|
+
case "Uncapitalize": {
|
|
1271
|
+
const literals = (typ_1) => {
|
|
1272
|
+
const matchValue_7 = typ_1.flags;
|
|
1273
|
+
if ($007CHasTypeFlags$007C_$007C(128, matchValue_7) != null) {
|
|
1274
|
+
const activePatternResult_4 = Type_StringLiteral_$007CString$007COther$007C(typ_1);
|
|
1275
|
+
if (activePatternResult_4.tag === 1) {
|
|
1276
|
+
return undefined;
|
|
1277
|
+
}
|
|
1278
|
+
else {
|
|
1279
|
+
return singleton_1(new GlueType(/* Literal */ 8, [new GlueLiteral(/* String */ 0, [activePatternResult_4.fields[0]])]));
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
else if ($007CHasTypeFlags$007C_$007C(1048576, matchValue_7) != null) {
|
|
1283
|
+
return fold((acc, cases) => {
|
|
1284
|
+
let matchResult_2, acc_1, cases_1;
|
|
1285
|
+
if (acc != null) {
|
|
1286
|
+
if (cases != null) {
|
|
1287
|
+
matchResult_2 = 0;
|
|
1288
|
+
acc_1 = acc;
|
|
1289
|
+
cases_1 = cases;
|
|
1290
|
+
}
|
|
1291
|
+
else {
|
|
1292
|
+
matchResult_2 = 1;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
else {
|
|
1296
|
+
matchResult_2 = 1;
|
|
1297
|
+
}
|
|
1298
|
+
switch (matchResult_2) {
|
|
1299
|
+
case 0:
|
|
1300
|
+
return append_1(acc_1, cases_1);
|
|
1301
|
+
default:
|
|
1302
|
+
return undefined;
|
|
1303
|
+
}
|
|
1304
|
+
}, empty(), map_1(literals, toList(typ_1.types)));
|
|
1305
|
+
}
|
|
1306
|
+
else {
|
|
1307
|
+
return undefined;
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
if (typeReferenceNode.pos < 0) {
|
|
1311
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.String$]);
|
|
1312
|
+
}
|
|
1313
|
+
else {
|
|
1314
|
+
const matchValue_9 = literals(checker.getTypeFromTypeNode(typeReferenceNode));
|
|
1315
|
+
let matchResult_3, single, cases_2;
|
|
1316
|
+
if (matchValue_9 != null) {
|
|
1317
|
+
if (!isEmpty(matchValue_9)) {
|
|
1318
|
+
if (isEmpty(tail(matchValue_9))) {
|
|
1319
|
+
matchResult_3 = 0;
|
|
1320
|
+
single = head(matchValue_9);
|
|
1321
|
+
}
|
|
1322
|
+
else {
|
|
1323
|
+
matchResult_3 = 1;
|
|
1324
|
+
cases_2 = matchValue_9;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
else {
|
|
1328
|
+
matchResult_3 = 2;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
else {
|
|
1332
|
+
matchResult_3 = 2;
|
|
1333
|
+
}
|
|
1334
|
+
switch (matchResult_3) {
|
|
1335
|
+
case 0:
|
|
1336
|
+
return single;
|
|
1337
|
+
case 1:
|
|
1338
|
+
return new GlueType(/* Union */ 7, [new GlueTypeUnion(cases_2)]);
|
|
1339
|
+
default:
|
|
1340
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.String$]);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
308
1344
|
case "Partial":
|
|
309
1345
|
return UtilityType_readPartial(reader, typeReferenceNode);
|
|
310
1346
|
case "Record":
|
|
@@ -322,148 +1358,302 @@ export function readTypeNode(reader, typeNode) {
|
|
|
322
1358
|
}
|
|
323
1359
|
}
|
|
324
1360
|
else {
|
|
325
|
-
return readTypeReference(
|
|
1361
|
+
return readTypeReference(isFromEsLib(symbolOpt));
|
|
326
1362
|
}
|
|
327
1363
|
}
|
|
328
1364
|
case 184: {
|
|
329
1365
|
const functionTypeNode = typeNode;
|
|
330
1366
|
let typeParameters;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
1367
|
+
const collectEnclosing = (node_mut, acc_2_mut) => {
|
|
1368
|
+
collectEnclosing:
|
|
1369
|
+
while (true) {
|
|
1370
|
+
const node = node_mut, acc_2 = acc_2_mut;
|
|
1371
|
+
if (Operators_IsNull(node)) {
|
|
1372
|
+
return acc_2;
|
|
1373
|
+
}
|
|
1374
|
+
else if (((Operators_IsNull(node.parent) && (node.pos < 0)) && (reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]() != null)) && !(node === value_8(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]()))) {
|
|
1375
|
+
node_mut = value_8(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]());
|
|
1376
|
+
acc_2_mut = acc_2;
|
|
1377
|
+
continue collectEnclosing;
|
|
1378
|
+
}
|
|
1379
|
+
else if (node.kind === 168) {
|
|
1380
|
+
return empty();
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
const ownTypeParameters = node.typeParameters;
|
|
1384
|
+
const acc_3 = (ownTypeParameters == null) ? acc_2 : append_1(acc_2, toList(ownTypeParameters));
|
|
1385
|
+
node_mut = node.parent;
|
|
1386
|
+
acc_2_mut = acc_3;
|
|
1387
|
+
continue collectEnclosing;
|
|
1388
|
+
}
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
const matchValue_12 = List_distinctBy((typeParameter) => identifierText(typeParameter.name), collectEnclosing(functionTypeNode, empty()), {
|
|
1393
|
+
Equals: (x, y) => (x === y),
|
|
1394
|
+
GetHashCode: (x) => (stringHash(x) | 0),
|
|
1395
|
+
});
|
|
1396
|
+
typeParameters = (isEmpty(matchValue_12) ? empty() : reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](Array.from(matchValue_12)));
|
|
1397
|
+
return new GlueType(/* FunctionType */ 15, [new GlueFunctionType(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDocumentationFromNode6C0FD055"](typeNode), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](functionTypeNode.type), typeParameters, (matchValue_13 = functionTypeNode.typeParameters, (matchValue_13 == null) ? empty() : toList(map((typeParameter_1) => identifierText(typeParameter_1.name), matchValue_13))), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"](functionTypeNode.parameters))]);
|
|
1398
|
+
}
|
|
1399
|
+
case 185: {
|
|
1400
|
+
const constructorTypeNode = typeNode;
|
|
1401
|
+
return new GlueType(/* ConstructorType */ 28, [new GlueConstructSignature(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B"](constructorTypeNode.parameters), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](constructorTypeNode.type))]);
|
|
340
1402
|
}
|
|
341
|
-
case 185:
|
|
342
|
-
return new GlueType(28, []);
|
|
343
1403
|
case 186:
|
|
344
1404
|
return readTypeQueryNode(reader, typeNode);
|
|
345
1405
|
case 187: {
|
|
346
1406
|
const typeLiteralNode = typeNode;
|
|
347
|
-
return new GlueType(21, [new GlueTypeLiteral(
|
|
1407
|
+
return new GlueType(/* TypeLiteral */ 21, [new GlueTypeLiteral(map_1((declaration_6) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_6), toList(typeLiteralNode.members)))]);
|
|
348
1408
|
}
|
|
349
1409
|
case 188: {
|
|
350
1410
|
const arrayTypeNode = typeNode;
|
|
351
|
-
return new GlueType(14, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
|
|
1411
|
+
return new GlueType(/* Array */ 14, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](arrayTypeNode.elementType)]);
|
|
352
1412
|
}
|
|
353
1413
|
case 189: {
|
|
354
1414
|
const tupleTypeNode = typeNode;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const properties = choose((property) => {
|
|
367
|
-
const matchValue_8 = property.declarations;
|
|
368
|
-
if (matchValue_8 == null) {
|
|
369
|
-
throw new Error(Report_readerError_Z19516DCE("type node", "Missing declarations", typeNode, "/home/mmangel/Workspaces/Github/glutinum-org/cli/main/src/Glutinum.Converter/Reader/TypeNode.fs", 511));
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
const declarations_1 = matchValue_8;
|
|
373
|
-
if (declarations_1.length === 1) {
|
|
374
|
-
return new IntersectionTypePropertyResult(0, [declarations_1[0]]);
|
|
1415
|
+
const elements = map_1((value_4) => value_4, toList(tupleTypeNode.elements));
|
|
1416
|
+
if (exists_1((element) => (element.kind === 191), elements)) {
|
|
1417
|
+
const elementTypes = List_distinct(map_1((element_1) => {
|
|
1418
|
+
if (element_1.kind === 191) {
|
|
1419
|
+
const matchValue_18 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element_1.type);
|
|
1420
|
+
if (matchValue_18.tag === 14) {
|
|
1421
|
+
return matchValue_18.fields[0];
|
|
1422
|
+
}
|
|
1423
|
+
else {
|
|
1424
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
1425
|
+
}
|
|
375
1426
|
}
|
|
376
1427
|
else {
|
|
377
|
-
return
|
|
1428
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](element_1);
|
|
378
1429
|
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
1430
|
+
}, elements), {
|
|
1431
|
+
Equals: equals,
|
|
1432
|
+
GetHashCode: (x_2) => (safeHash(x_2) | 0),
|
|
1433
|
+
});
|
|
1434
|
+
let matchResult_4, elementType_2;
|
|
1435
|
+
if (!isEmpty(elementTypes)) {
|
|
1436
|
+
if (isEmpty(tail(elementTypes))) {
|
|
1437
|
+
matchResult_4 = 0;
|
|
1438
|
+
elementType_2 = head(elementTypes);
|
|
388
1439
|
}
|
|
389
1440
|
else {
|
|
390
|
-
|
|
1441
|
+
matchResult_4 = 1;
|
|
391
1442
|
}
|
|
392
1443
|
}
|
|
393
1444
|
else {
|
|
394
|
-
|
|
1445
|
+
matchResult_4 = 1;
|
|
1446
|
+
}
|
|
1447
|
+
switch (matchResult_4) {
|
|
1448
|
+
case 0:
|
|
1449
|
+
return new GlueType(/* Array */ 14, [elementType_2]);
|
|
1450
|
+
default:
|
|
1451
|
+
return new GlueType(/* Array */ 14, [new GlueType(/* Primitive */ 3, [GluePrimitive.Any])]);
|
|
395
1452
|
}
|
|
396
|
-
}, properties)) {
|
|
397
|
-
return new GlueType(3, [new GluePrimitive(6, [])]);
|
|
398
1453
|
}
|
|
399
1454
|
else {
|
|
400
|
-
return new GlueType(
|
|
401
|
-
|
|
402
|
-
|
|
1455
|
+
return new GlueType(/* TupleType */ 18, [map_1((typNode_3) => reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode_3), elements)]);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
case 190: {
|
|
1459
|
+
const optionalTypeNode = typeNode;
|
|
1460
|
+
return new GlueType(/* OptionalType */ 22, [reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](optionalTypeNode.type)]);
|
|
1461
|
+
}
|
|
1462
|
+
case 191:
|
|
1463
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typeNode.type);
|
|
1464
|
+
case 192:
|
|
1465
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadUnionTypeNodeZ5A082EC2"](typeNode);
|
|
1466
|
+
case 193:
|
|
1467
|
+
if (exists((inProgress) => (inProgress === checker.getTypeAtLocation(typeNode)), intersectionsInProgress)) {
|
|
1468
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
1469
|
+
}
|
|
1470
|
+
else if (exists(isGlobalThisQuery, typeNode.types)) {
|
|
1471
|
+
const matchValue_19 = toList(filter_1((arg_3) => !isGlobalThisQuery(arg_3), typeNode.types));
|
|
1472
|
+
let matchResult_5, single_1;
|
|
1473
|
+
if (!isEmpty(matchValue_19)) {
|
|
1474
|
+
if (isEmpty(tail(matchValue_19))) {
|
|
1475
|
+
matchResult_5 = 0;
|
|
1476
|
+
single_1 = head(matchValue_19);
|
|
403
1477
|
}
|
|
404
1478
|
else {
|
|
405
|
-
|
|
1479
|
+
matchResult_5 = 1;
|
|
406
1480
|
}
|
|
407
|
-
}
|
|
1481
|
+
}
|
|
1482
|
+
else {
|
|
1483
|
+
matchResult_5 = 1;
|
|
1484
|
+
}
|
|
1485
|
+
switch (matchResult_5) {
|
|
1486
|
+
case 0:
|
|
1487
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](single_1);
|
|
1488
|
+
default:
|
|
1489
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
else {
|
|
1493
|
+
const intersectionTypeNode = typeNode;
|
|
1494
|
+
const unionOrIntersectionType = checker.getTypeAtLocation(intersectionTypeNode);
|
|
1495
|
+
void (intersectionsInProgress.push(unionOrIntersectionType));
|
|
1496
|
+
const _guard = {
|
|
1497
|
+
Dispose() {
|
|
1498
|
+
intersectionsInProgress.splice(intersectionsInProgress.length - 1, 1);
|
|
1499
|
+
},
|
|
1500
|
+
};
|
|
1501
|
+
try {
|
|
1502
|
+
const properties_1 = choose((property_1) => {
|
|
1503
|
+
const matchValue_21 = property_1.declarations;
|
|
1504
|
+
if (matchValue_21 == null) {
|
|
1505
|
+
return new IntersectionTypePropertyResult(/* WithoutDeclaration */ 1, [property_1]);
|
|
1506
|
+
}
|
|
1507
|
+
else {
|
|
1508
|
+
const declarations_3 = matchValue_21;
|
|
1509
|
+
if (declarations_3.length === 1) {
|
|
1510
|
+
return new IntersectionTypePropertyResult(/* Single */ 0, [property_1, item_4(0, declarations_3)]);
|
|
1511
|
+
}
|
|
1512
|
+
else if (forAll((declaration_2) => {
|
|
1513
|
+
if (declaration_2.kind === 171) {
|
|
1514
|
+
return true;
|
|
1515
|
+
}
|
|
1516
|
+
else {
|
|
1517
|
+
return declaration_2.kind === 172;
|
|
1518
|
+
}
|
|
1519
|
+
}, declarations_3)) {
|
|
1520
|
+
return new IntersectionTypePropertyResult(/* WithoutDeclaration */ 1, [property_1]);
|
|
1521
|
+
}
|
|
1522
|
+
else {
|
|
1523
|
+
return IntersectionTypePropertyResult.ForceAny;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}, unionOrIntersectionType.isUnion() ? List_distinct(concat_2(map_1((arg_4) => toList(checker.getPropertiesOfType(arg_4)), toList(unionOrIntersectionType.types))), {
|
|
1527
|
+
Equals: equals,
|
|
1528
|
+
GetHashCode: (x_3) => (structuralHash(x_3) | 0),
|
|
1529
|
+
}) : ((matchValue_20 = toList(unionOrIntersectionType.getProperties()), isEmpty(matchValue_20) ? ((intersectionTypeNode.pos >= 0) ? List_distinctBy((property) => property.name, collect_1((constituent) => {
|
|
1530
|
+
let type_1;
|
|
1531
|
+
return toList((type_1 = checker.getTypeAtLocation(constituent), checker.getPropertiesOfType(type_1)));
|
|
1532
|
+
}, toList(intersectionTypeNode.types)), {
|
|
1533
|
+
Equals: (x_4, y_4) => (x_4 === y_4),
|
|
1534
|
+
GetHashCode: (x_4) => (stringHash(x_4) | 0),
|
|
1535
|
+
}) : matchValue_20) : matchValue_20)));
|
|
1536
|
+
const hasUnsupportedProperties = exists_1((property_2) => {
|
|
1537
|
+
switch (property_2.tag) {
|
|
1538
|
+
case 1:
|
|
1539
|
+
return false;
|
|
1540
|
+
case 0:
|
|
1541
|
+
if (property_2.fields[1].kind === 174) {
|
|
1542
|
+
return true;
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
return false;
|
|
1546
|
+
}
|
|
1547
|
+
default:
|
|
1548
|
+
return true;
|
|
1549
|
+
}
|
|
1550
|
+
}, properties_1);
|
|
1551
|
+
const callSignatures = unionOrIntersectionType.isUnion() ? empty() : choose((signature) => {
|
|
1552
|
+
const flags_1 = 1 | 16384;
|
|
1553
|
+
const synthesized = checker.signatureToSignatureDeclaration(signature, 179, typeNode, flags_1);
|
|
1554
|
+
if (synthesized == null) {
|
|
1555
|
+
return undefined;
|
|
1556
|
+
}
|
|
1557
|
+
else {
|
|
1558
|
+
const declaration_4 = synthesized;
|
|
1559
|
+
declaration_4.parent = typeNode;
|
|
1560
|
+
const previousContext = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_SyntheticContext"]();
|
|
1561
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](declaration_4);
|
|
1562
|
+
try {
|
|
1563
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55"](declaration_4);
|
|
1564
|
+
}
|
|
1565
|
+
finally {
|
|
1566
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.set_SyntheticContext"](previousContext);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
}, toList(checker.getSignaturesOfType(unionOrIntersectionType, 0)));
|
|
1570
|
+
return hasUnsupportedProperties ? (new GlueType(/* Primitive */ 3, [GluePrimitive.Any])) : (new GlueType(/* IntersectionType */ 20, [append_1(choose((_arg) => {
|
|
1571
|
+
switch (_arg.tag) {
|
|
1572
|
+
case 1:
|
|
1573
|
+
return readPropertyWithoutDeclaration(reader, typeNode, _arg.fields[0]);
|
|
1574
|
+
case 2:
|
|
1575
|
+
throw new Exception("Sould not happen here");
|
|
1576
|
+
default:
|
|
1577
|
+
return readInstantiatedMember(reader, typeNode, _arg.fields[0], _arg.fields[1]);
|
|
1578
|
+
}
|
|
1579
|
+
}, properties_1), callSignatures)]));
|
|
1580
|
+
}
|
|
1581
|
+
finally {
|
|
1582
|
+
disposeSafe(_guard);
|
|
1583
|
+
}
|
|
408
1584
|
}
|
|
409
|
-
}
|
|
410
1585
|
case 194: {
|
|
411
1586
|
const conditionalTypeNode = typeNode;
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
1587
|
+
const typ_4 = checker.getTypeAtLocation(conditionalTypeNode);
|
|
1588
|
+
if (isDeferredConditional(typ_4)) {
|
|
1589
|
+
const warningsCount = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]().length | 0;
|
|
1590
|
+
const inferred = ofList(map_1((inferTypeNode) => [inferTypeNode.typeParameter.name.getText(), inferredConstraint(reader, inferTypeNode)], inferTypeNodes(conditionalTypeNode.extendsType)), {
|
|
1591
|
+
Compare: (x_5, y_5) => (comparePrimitives(x_5, y_5) | 0),
|
|
1592
|
+
});
|
|
1593
|
+
const conditionalType = new GlueConditionalType(reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.checkType), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.extendsType), GlueSubstitution_substitute(inferred, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.trueType)), reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.falseType));
|
|
1594
|
+
if (reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]().length > warningsCount) {
|
|
1595
|
+
reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]().splice(warningsCount, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]().length - warningsCount);
|
|
1596
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
417
1597
|
}
|
|
418
1598
|
else {
|
|
419
|
-
|
|
420
|
-
forward = matchValue_10;
|
|
1599
|
+
return new GlueType(/* ConditionalType */ 32, [conditionalType]);
|
|
421
1600
|
}
|
|
422
1601
|
}
|
|
423
1602
|
else {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
1603
|
+
const matchValue_28 = readTypeUsingFlags(reader, typ_4);
|
|
1604
|
+
let matchResult_6, forward;
|
|
1605
|
+
if (matchValue_28.tag === 3) {
|
|
1606
|
+
if (matchValue_28.fields[0].tag === 6) {
|
|
1607
|
+
matchResult_6 = 0;
|
|
1608
|
+
}
|
|
1609
|
+
else {
|
|
1610
|
+
matchResult_6 = 1;
|
|
1611
|
+
forward = matchValue_28;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
else {
|
|
1615
|
+
matchResult_6 = 1;
|
|
1616
|
+
forward = matchValue_28;
|
|
1617
|
+
}
|
|
1618
|
+
switch (matchResult_6) {
|
|
1619
|
+
case 0:
|
|
1620
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](conditionalTypeNode.checkType);
|
|
1621
|
+
default:
|
|
1622
|
+
return forward;
|
|
1623
|
+
}
|
|
432
1624
|
}
|
|
433
1625
|
}
|
|
1626
|
+
case 195:
|
|
1627
|
+
return inferredConstraint(reader, typeNode);
|
|
434
1628
|
case 196: {
|
|
435
1629
|
const parenthesizedTypeNode = typeNode;
|
|
436
1630
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](parenthesizedTypeNode.type);
|
|
437
1631
|
}
|
|
438
1632
|
case 197: {
|
|
439
1633
|
const thisTypeNode = typeNode;
|
|
440
|
-
const
|
|
1634
|
+
const typ_2 = checker.getTypeAtLocation(thisTypeNode);
|
|
441
1635
|
let typParameters_1;
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
else {
|
|
452
|
-
const declaration = declarations[0];
|
|
453
|
-
const matchValue_7 = declaration.kind | 0;
|
|
454
|
-
switch (matchValue_7) {
|
|
455
|
-
case 263:
|
|
456
|
-
case 264: {
|
|
457
|
-
const classDeclaration = declaration;
|
|
458
|
-
typParameters_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](classDeclaration.typeParameters);
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
default:
|
|
462
|
-
typParameters_1 = empty();
|
|
1636
|
+
const matchValue_16 = Operators_IsNull(typ_2.symbol) ? undefined : typ_2.symbol.declarations;
|
|
1637
|
+
typParameters_1 = ((matchValue_16 == null) ? empty() : defaultArg((option_14 = tryHead(sortByDescending((typeParameters_1) => (typeParameters_1.length | 0), choose_1((declaration_1) => {
|
|
1638
|
+
const matchValue_17 = declaration_1.kind;
|
|
1639
|
+
switch (matchValue_17) {
|
|
1640
|
+
case 263:
|
|
1641
|
+
case 264: {
|
|
1642
|
+
const classDeclaration = declaration_1;
|
|
1643
|
+
return classDeclaration.typeParameters;
|
|
463
1644
|
}
|
|
1645
|
+
default:
|
|
1646
|
+
return undefined;
|
|
464
1647
|
}
|
|
1648
|
+
}, matchValue_16), {
|
|
1649
|
+
Compare: (x_1, y_1) => (comparePrimitives(x_1, y_1) | 0),
|
|
1650
|
+
})), (option_14 != null) ? ((arg_2 = option_14, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeParameters4088FB9E"](arg_2))) : undefined), empty()));
|
|
1651
|
+
if (Operators_IsNull(typ_2.symbol)) {
|
|
1652
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
1653
|
+
}
|
|
1654
|
+
else {
|
|
1655
|
+
return new GlueType(/* ThisType */ 17, [new GlueThisType(defaultArg(declaredName(typ_2.symbol), typ_2.symbol.name), typParameters_1)]);
|
|
465
1656
|
}
|
|
466
|
-
return new GlueType(17, [new GlueThisType(typ.symbol.name, typParameters_1)]);
|
|
467
1657
|
}
|
|
468
1658
|
case 198: {
|
|
469
1659
|
const typeOperatorNode = typeNode;
|
|
@@ -473,33 +1663,114 @@ export function readTypeNode(reader, typeNode) {
|
|
|
473
1663
|
const indexedAccessType = typeNode;
|
|
474
1664
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadIndexedAccessTypeZ5577BC0A"](indexedAccessType);
|
|
475
1665
|
}
|
|
1666
|
+
case 200:
|
|
1667
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadMappedTypeNode28272C00"](typeNode);
|
|
476
1668
|
case 201: {
|
|
477
1669
|
const literalTypeNode = typeNode;
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
throw new
|
|
1670
|
+
const matchValue_15 = tryReadLiteral(checker, literalTypeNode.literal);
|
|
1671
|
+
if (matchValue_15 == null) {
|
|
1672
|
+
throw new Exception(Report_readerError_Z19516DCE("type node - literal type", "Could not read literal type", typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 1217));
|
|
481
1673
|
}
|
|
482
1674
|
else {
|
|
483
|
-
return new GlueType(8, [
|
|
1675
|
+
return new GlueType(/* Literal */ 8, [matchValue_15]);
|
|
484
1676
|
}
|
|
485
1677
|
}
|
|
486
1678
|
case 202:
|
|
487
1679
|
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNamedTupleMemberZ6E17C942"](typeNode);
|
|
488
|
-
case 203:
|
|
489
|
-
|
|
1680
|
+
case 203: {
|
|
1681
|
+
const templateLiteralTypeNode = typeNode;
|
|
1682
|
+
const readResolvedLiterals = (typ_6) => {
|
|
1683
|
+
const matchValue_29 = typ_6.flags;
|
|
1684
|
+
if ($007CHasTypeFlags$007C_$007C(128, matchValue_29) != null) {
|
|
1685
|
+
const activePatternResult_7 = Type_StringLiteral_$007CString$007COther$007C(typ_6);
|
|
1686
|
+
if (activePatternResult_7.tag === 1) {
|
|
1687
|
+
return empty();
|
|
1688
|
+
}
|
|
1689
|
+
else {
|
|
1690
|
+
return singleton_1(new GlueType(/* Literal */ 8, [new GlueLiteral(/* String */ 0, [activePatternResult_7.fields[0]])]));
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
else if ($007CHasTypeFlags$007C_$007C(1048576, matchValue_29) != null) {
|
|
1694
|
+
return collect_1(readResolvedLiterals, toList(typ_6.types));
|
|
1695
|
+
}
|
|
1696
|
+
else {
|
|
1697
|
+
return empty();
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
const matchValue_30 = readResolvedLiterals(checker.getTypeAtLocation(templateLiteralTypeNode));
|
|
1701
|
+
if (!isEmpty(matchValue_30)) {
|
|
1702
|
+
if (isEmpty(tail(matchValue_30))) {
|
|
1703
|
+
return head(matchValue_30);
|
|
1704
|
+
}
|
|
1705
|
+
else {
|
|
1706
|
+
return new GlueType(/* Union */ 7, [new GlueTypeUnion(matchValue_30)]);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
else {
|
|
1710
|
+
return GlueType.TemplateLiteral;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
case 205: {
|
|
1714
|
+
const importTypeNode = typeNode;
|
|
1715
|
+
const matchValue_14 = importTypeNode.qualifier;
|
|
1716
|
+
if (matchValue_14 == null) {
|
|
1717
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
1718
|
+
}
|
|
1719
|
+
else if (importTypeNode.isTypeOf) {
|
|
1720
|
+
const qualifier_1 = matchValue_14;
|
|
1721
|
+
const typNode_1 = ts.factory.createTypeQueryNode(qualifier_1);
|
|
1722
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode_1);
|
|
1723
|
+
}
|
|
1724
|
+
else {
|
|
1725
|
+
const qualifier_2 = matchValue_14;
|
|
1726
|
+
const typNode_2 = ts.factory.createTypeReferenceNode(qualifier_2, unwrap(importTypeNode.typeArguments));
|
|
1727
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](typNode_2);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
490
1730
|
case 233: {
|
|
491
1731
|
const expression = typeNode;
|
|
492
|
-
const
|
|
493
|
-
const symbolOpt_1 = orElse(
|
|
494
|
-
|
|
1732
|
+
const typ_3 = checker.getTypeFromTypeNode(expression);
|
|
1733
|
+
const symbolOpt_1 = orElse(orElse(typ_3.aliasSymbol, Operators_IsNull(typ_3.symbol) ? undefined : typ_3.symbol), checker.getSymbolAtLocation(expression.expression));
|
|
1734
|
+
const matchValue_23 = isFromEs5Lib(symbolOpt_1);
|
|
1735
|
+
const matchValue_24 = getFullNameOrEmpty(checker, expression.expression);
|
|
1736
|
+
let matchResult_7;
|
|
1737
|
+
if (matchValue_23) {
|
|
1738
|
+
if (matchValue_24 === "Omit") {
|
|
1739
|
+
matchResult_7 = 0;
|
|
1740
|
+
}
|
|
1741
|
+
else {
|
|
1742
|
+
matchResult_7 = 1;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
else {
|
|
1746
|
+
matchResult_7 = 1;
|
|
1747
|
+
}
|
|
1748
|
+
switch (matchResult_7) {
|
|
1749
|
+
case 0:
|
|
1750
|
+
return UtilityType_readOmit(reader, expression);
|
|
1751
|
+
default: {
|
|
1752
|
+
const isQualified_1 = expression.expression.kind === 211;
|
|
1753
|
+
const name_1 = (symbolOpt_1 != null) ? (((symbol_5 = symbolOpt_1, symbol_5.name === "default")) ? ((symbol_7 = symbolOpt_1, defaultArg(declaredName(symbol_7), symbol_7.name))) : ((!isFromEs5Lib(symbolOpt_1)) ? ((symbol_8 = symbolOpt_1, symbol_8.name)) : (isQualified_1 ? expression.expression.name.text : expression.expression.getText()))) : (isQualified_1 ? expression.expression.name.text : expression.expression.getText());
|
|
1754
|
+
const isExternal_1 = isExternalToPackages(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), symbolOpt_1);
|
|
1755
|
+
if (((symbolOpt_1 == null) ? false : ((symbol_9 = symbolOpt_1, (symbol_9.name === "__type") ? true : (symbol_9.name === "__object")))) ? true : ((isExternal_1 && !FSharpSet__Contains(knownExternalTypeNames, name_1)) && !(isFromEs5Lib(symbolOpt_1) && (name_1 === "Partial")))) {
|
|
1756
|
+
return GlueType.Discard;
|
|
1757
|
+
}
|
|
1758
|
+
else {
|
|
1759
|
+
return new GlueType(/* TypeReference */ 13, [new GlueTypeReference((name_1.indexOf(".") >= 0) ? name_1 : sanitizeTypeName(name_1), (matchValue_26 = ((option_21 = symbolOpt_1, (option_21 != null) ? resolveAlias(checker, option_21) : undefined)), (matchValue_26 == null) ? getFullNameOrEmpty(checker, expression.expression) : ((symbol_11 = matchValue_26, checker.getFullyQualifiedName(symbol_11)))), isLibraryName(reader, name_1) ? empty() : modulePathForSymbol(checker, reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_PackageContext"](), isQualified_1, symbolOpt_1), (matchValue_27 = readTypeArguments(reader, expression), isEmpty(matchValue_27) ? map_1((argument) => {
|
|
1760
|
+
const flags_2 = 1 | 16384;
|
|
1761
|
+
const typNode_4 = checker.typeToTypeNode(argument, undefined, flags_2);
|
|
1762
|
+
return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2"](typNode_4);
|
|
1763
|
+
}, resolvedBaseTypeArguments(checker, expression)) : matchValue_27), (isFromEs5Lib(symbolOpt_1) ? true : isExternal_1) ? true : isLibraryName(reader, name_1))]);
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
495
1767
|
}
|
|
496
1768
|
default: {
|
|
497
|
-
const item = Report_readerError_Z19516DCE("type node",
|
|
1769
|
+
const item = Report_readerError_Z19516DCE("type node", concat("Unsupported kind ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(typeNode.kind)), typeNode, "/_//src/Glutinum.Converter/Reader/TypeNode.fs", 1671);
|
|
498
1770
|
const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
|
|
499
1771
|
void (objectArg.push(item));
|
|
500
|
-
return new GlueType(3, [
|
|
1772
|
+
return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
|
|
501
1773
|
}
|
|
502
1774
|
}
|
|
503
1775
|
}
|
|
504
1776
|
|
|
505
|
-
//# sourceMappingURL=TypeNode.js.map
|