@algorandfoundation/puya-ts 1.0.0-alpha.10
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 +11 -0
- package/awst/index.d.ts +4 -0
- package/awst/intrinsic-factory.d.ts +35 -0
- package/awst/json-serialize-awst.d.ts +17 -0
- package/awst/models.d.ts +85 -0
- package/awst/node-factory.d.ts +90 -0
- package/awst/nodes.d.ts +841 -0
- package/awst/source-location.d.ts +21 -0
- package/awst/to-code-visitor.d.ts +87 -0
- package/awst/txn-fields.d.ts +84 -0
- package/awst/util.d.ts +2 -0
- package/awst/wtypes.d.ts +136 -0
- package/awst_build/base-visitor.d.ts +87 -0
- package/awst_build/constructor-visitor.d.ts +18 -0
- package/awst_build/context/awst-build-context.d.ts +72 -0
- package/awst_build/context/evaluation-context.d.ts +11 -0
- package/awst_build/context/switch-loop-context.d.ts +31 -0
- package/awst_build/context/unique-name-resolver.d.ts +14 -0
- package/awst_build/contract-data.d.ts +24 -0
- package/awst_build/contract-method-visitor.d.ts +20 -0
- package/awst_build/contract-visitor.d.ts +33 -0
- package/awst_build/decorator-visitor.d.ts +34 -0
- package/awst_build/eb/arc4/arrays.d.ts +31 -0
- package/awst_build/eb/arc4/uint-n-constructor-builder.d.ts +14 -0
- package/awst_build/eb/arc4-bare-method-decorator-builder.d.ts +19 -0
- package/awst_build/eb/assert-function-builder.d.ts +10 -0
- package/awst_build/eb/assert-match-function-builder.d.ts +8 -0
- package/awst_build/eb/biguint-expression-builder.d.ts +21 -0
- package/awst_build/eb/boolean-expression-builder.d.ts +15 -0
- package/awst_build/eb/bytes-expression-builder.d.ts +44 -0
- package/awst_build/eb/contract-builder.d.ts +19 -0
- package/awst_build/eb/ensure-budget.d.ts +8 -0
- package/awst_build/eb/folding.d.ts +5 -0
- package/awst_build/eb/free-subroutine-expression-builder.d.ts +22 -0
- package/awst_build/eb/index.d.ts +90 -0
- package/awst_build/eb/intrinsic-enum-builder.d.ts +9 -0
- package/awst_build/eb/iterable-iterator-expression-builder.d.ts +10 -0
- package/awst_build/eb/literal/array-literal-expression-builder.d.ts +18 -0
- package/awst_build/eb/literal/big-int-literal-expression-builder.d.ts +17 -0
- package/awst_build/eb/literal/conditional-expression-builder.d.ts +22 -0
- package/awst_build/eb/literal/object-expression-builder.d.ts +13 -0
- package/awst_build/eb/literal/object-literal-expression-builder.d.ts +28 -0
- package/awst_build/eb/literal-expression-builder.d.ts +27 -0
- package/awst_build/eb/log-function-builder.d.ts +7 -0
- package/awst_build/eb/namespace-builder.d.ts +9 -0
- package/awst_build/eb/native-array-expression-builder.d.ts +8 -0
- package/awst_build/eb/omitted-expression-builder.d.ts +9 -0
- package/awst_build/eb/op-module-builder.d.ts +25 -0
- package/awst_build/eb/reference/account.d.ts +15 -0
- package/awst_build/eb/reference/application.d.ts +12 -0
- package/awst_build/eb/reference/asset.d.ts +13 -0
- package/awst_build/eb/reference/base.d.ts +37 -0
- package/awst_build/eb/storage/box.d.ts +50 -0
- package/awst_build/eb/storage/global-state.d.ts +29 -0
- package/awst_build/eb/storage/local-state.d.ts +32 -0
- package/awst_build/eb/storage/util.d.ts +5 -0
- package/awst_build/eb/storage/value-proxy.d.ts +22 -0
- package/awst_build/eb/string-expression-builder.d.ts +27 -0
- package/awst_build/eb/transactions/group-transactions.d.ts +15 -0
- package/awst_build/eb/transactions/inner-transaction-params.d.ts +19 -0
- package/awst_build/eb/transactions/inner-transactions.d.ts +10 -0
- package/awst_build/eb/transactions/txn-fields.d.ts +1317 -0
- package/awst_build/eb/transactions/util.d.ts +5 -0
- package/awst_build/eb/tuple-expression-builder.d.ts +12 -0
- package/awst_build/eb/uint64-enum-type-builder.d.ts +13 -0
- package/awst_build/eb/uint64-expression-builder.d.ts +21 -0
- package/awst_build/eb/urange-function.d.ts +7 -0
- package/awst_build/eb/util/arg-parsing.d.ts +106 -0
- package/awst_build/eb/util/compare-bytes.d.ts +5 -0
- package/awst_build/eb/util/compare-uint64.d.ts +5 -0
- package/awst_build/eb/util/index.d.ts +19 -0
- package/awst_build/eb/util/require-constant-value.d.ts +4 -0
- package/awst_build/eb/void-expression-builder.d.ts +7 -0
- package/awst_build/function-visitor.d.ts +45 -0
- package/awst_build/index.d.ts +5 -0
- package/awst_build/lib/index.d.ts +2 -0
- package/awst_build/op-metadata.d.ts +27 -0
- package/awst_build/ptypes/arc4-types.d.ts +56 -0
- package/awst_build/ptypes/base.d.ts +31 -0
- package/awst_build/ptypes/index.d.ts +464 -0
- package/awst_build/ptypes/intrinsic-enum-type.d.ts +14 -0
- package/awst_build/ptypes/op-ptypes.d.ts +6 -0
- package/awst_build/ptypes/register.d.ts +2 -0
- package/awst_build/ptypes/transient-type-errors.d.ts +14 -0
- package/awst_build/source-file-visitor.d.ts +21 -0
- package/awst_build/subroutine-visitor.d.ts +10 -0
- package/awst_build/symbol-name.d.ts +10 -0
- package/awst_build/text-visitor.d.ts +20 -0
- package/awst_build/type-registry.d.ts +61 -0
- package/awst_build/type-resolver.d.ts +18 -0
- package/bin/run-cli.d.ts +2 -0
- package/bin/run-cli.mjs +21 -0
- package/bin/run-cli.mjs.map +1 -0
- package/cli.d.ts +1 -0
- package/cli.mjs +161 -0
- package/cli.mjs.map +1 -0
- package/compile-options.d.ts +23 -0
- package/constants.d.ts +20 -0
- package/errors.d.ts +46 -0
- package/index-GbFBpbmB.js +16444 -0
- package/index-GbFBpbmB.js.map +1 -0
- package/index.d.ts +31 -0
- package/index.mjs +16 -0
- package/index.mjs.map +1 -0
- package/logger.d.ts +39 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/README.md +50 -0
- package/node_modules/typescript/SECURITY.md +41 -0
- package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/typescript/bin/tsc +2 -0
- package/node_modules/typescript/bin/tsserver +2 -0
- package/node_modules/typescript/lib/cancellationToken.js +90 -0
- package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/lib.d.ts +22 -0
- package/node_modules/typescript/lib/lib.decorators.d.ts +386 -0
- package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.dom.d.ts +28087 -0
- package/node_modules/typescript/lib/lib.dom.iterable.d.ts +491 -0
- package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +527 -0
- package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +727 -0
- package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/node_modules/typescript/lib/lib.es2020.string.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +76 -0
- package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.error.d.ts +73 -0
- package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2022.intl.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/node_modules/typescript/lib/lib.es5.d.ts +4585 -0
- package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.collection.d.ts +106 -0
- package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/node_modules/typescript/lib/lib.esnext.object.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.regexp.d.ts +25 -0
- package/node_modules/typescript/lib/lib.esnext.string.d.ts +29 -0
- package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.webworker.d.ts +9410 -0
- package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +288 -0
- package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/tsc.js +130769 -0
- package/node_modules/typescript/lib/tsserver.js +623 -0
- package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/node_modules/typescript/lib/typesMap.json +497 -0
- package/node_modules/typescript/lib/typescript.d.ts +11329 -0
- package/node_modules/typescript/lib/typescript.js +196072 -0
- package/node_modules/typescript/lib/typingsInstaller.js +236 -0
- package/node_modules/typescript/lib/watchGuard.js +53 -0
- package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2087 -0
- package/node_modules/typescript/package.json +121 -0
- package/package.json +43 -0
- package/parser/index.d.ts +13 -0
- package/parser/json-serialize-source-files.d.ts +2 -0
- package/parser/resolve-module-name-literals.d.ts +2 -0
- package/puya/build-compilation-set-mapping.d.ts +9 -0
- package/puya/index.d.ts +13 -0
- package/puya/options.d.ts +29 -0
- package/puya/run-child-proc.d.ts +5 -0
- package/util/base-32.d.ts +2 -0
- package/util/base-85.d.ts +10 -0
- package/util/default-map.d.ts +1 -0
- package/util/generate-temp-file.d.ts +9 -0
- package/util/index.d.ts +47 -0
- package/visitor/syntax-names.d.ts +441 -0
- package/visitor/visitor.d.ts +26 -0
- package/write-artifact.d.ts +12 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { BinaryBooleanOperator } from '../awst/nodes';
|
|
3
|
+
import { BuilderBinaryOp, BuilderComparisonOp, BuilderUnaryOp } from '../awst_build/eb';
|
|
4
|
+
import type { DeliberateAny } from '../typescript-helpers';
|
|
5
|
+
export declare const SyntaxKindName: {
|
|
6
|
+
readonly 0: "Unknown";
|
|
7
|
+
readonly 1: "EndOfFileToken";
|
|
8
|
+
readonly 2: "SingleLineCommentTrivia";
|
|
9
|
+
readonly 3: "MultiLineCommentTrivia";
|
|
10
|
+
readonly 4: "NewLineTrivia";
|
|
11
|
+
readonly 5: "WhitespaceTrivia";
|
|
12
|
+
readonly 6: "ShebangTrivia";
|
|
13
|
+
readonly 7: "ConflictMarkerTrivia";
|
|
14
|
+
readonly 8: "NonTextFileMarkerTrivia";
|
|
15
|
+
readonly 9: "NumericLiteral";
|
|
16
|
+
readonly 10: "BigIntLiteral";
|
|
17
|
+
readonly 11: "StringLiteral";
|
|
18
|
+
readonly 12: "JsxText";
|
|
19
|
+
readonly 13: "JsxTextAllWhiteSpaces";
|
|
20
|
+
readonly 14: "RegularExpressionLiteral";
|
|
21
|
+
readonly 15: "NoSubstitutionTemplateLiteral";
|
|
22
|
+
readonly 16: "TemplateHead";
|
|
23
|
+
readonly 17: "TemplateMiddle";
|
|
24
|
+
readonly 18: "TemplateTail";
|
|
25
|
+
readonly 19: "OpenBraceToken";
|
|
26
|
+
readonly 20: "CloseBraceToken";
|
|
27
|
+
readonly 21: "OpenParenToken";
|
|
28
|
+
readonly 22: "CloseParenToken";
|
|
29
|
+
readonly 23: "OpenBracketToken";
|
|
30
|
+
readonly 24: "CloseBracketToken";
|
|
31
|
+
readonly 25: "DotToken";
|
|
32
|
+
readonly 26: "DotDotDotToken";
|
|
33
|
+
readonly 27: "SemicolonToken";
|
|
34
|
+
readonly 28: "CommaToken";
|
|
35
|
+
readonly 29: "QuestionDotToken";
|
|
36
|
+
readonly 30: "LessThanToken";
|
|
37
|
+
readonly 31: "LessThanSlashToken";
|
|
38
|
+
readonly 32: "GreaterThanToken";
|
|
39
|
+
readonly 33: "LessThanEqualsToken";
|
|
40
|
+
readonly 34: "GreaterThanEqualsToken";
|
|
41
|
+
readonly 35: "EqualsEqualsToken";
|
|
42
|
+
readonly 36: "ExclamationEqualsToken";
|
|
43
|
+
readonly 37: "EqualsEqualsEqualsToken";
|
|
44
|
+
readonly 38: "ExclamationEqualsEqualsToken";
|
|
45
|
+
readonly 39: "EqualsGreaterThanToken";
|
|
46
|
+
readonly 40: "PlusToken";
|
|
47
|
+
readonly 41: "MinusToken";
|
|
48
|
+
readonly 42: "AsteriskToken";
|
|
49
|
+
readonly 43: "AsteriskAsteriskToken";
|
|
50
|
+
readonly 44: "SlashToken";
|
|
51
|
+
readonly 45: "PercentToken";
|
|
52
|
+
readonly 46: "PlusPlusToken";
|
|
53
|
+
readonly 47: "MinusMinusToken";
|
|
54
|
+
readonly 48: "LessThanLessThanToken";
|
|
55
|
+
readonly 49: "GreaterThanGreaterThanToken";
|
|
56
|
+
readonly 50: "GreaterThanGreaterThanGreaterThanToken";
|
|
57
|
+
readonly 51: "AmpersandToken";
|
|
58
|
+
readonly 52: "BarToken";
|
|
59
|
+
readonly 53: "CaretToken";
|
|
60
|
+
readonly 54: "ExclamationToken";
|
|
61
|
+
readonly 55: "TildeToken";
|
|
62
|
+
readonly 56: "AmpersandAmpersandToken";
|
|
63
|
+
readonly 57: "BarBarToken";
|
|
64
|
+
readonly 58: "QuestionToken";
|
|
65
|
+
readonly 59: "ColonToken";
|
|
66
|
+
readonly 60: "AtToken";
|
|
67
|
+
readonly 61: "QuestionQuestionToken";
|
|
68
|
+
readonly 62: "BacktickToken";
|
|
69
|
+
readonly 63: "HashToken";
|
|
70
|
+
readonly 64: "EqualsToken";
|
|
71
|
+
readonly 65: "PlusEqualsToken";
|
|
72
|
+
readonly 66: "MinusEqualsToken";
|
|
73
|
+
readonly 67: "AsteriskEqualsToken";
|
|
74
|
+
readonly 68: "AsteriskAsteriskEqualsToken";
|
|
75
|
+
readonly 69: "SlashEqualsToken";
|
|
76
|
+
readonly 70: "PercentEqualsToken";
|
|
77
|
+
readonly 71: "LessThanLessThanEqualsToken";
|
|
78
|
+
readonly 72: "GreaterThanGreaterThanEqualsToken";
|
|
79
|
+
readonly 73: "GreaterThanGreaterThanGreaterThanEqualsToken";
|
|
80
|
+
readonly 74: "AmpersandEqualsToken";
|
|
81
|
+
readonly 75: "BarEqualsToken";
|
|
82
|
+
readonly 76: "BarBarEqualsToken";
|
|
83
|
+
readonly 77: "AmpersandAmpersandEqualsToken";
|
|
84
|
+
readonly 78: "QuestionQuestionEqualsToken";
|
|
85
|
+
readonly 79: "CaretEqualsToken";
|
|
86
|
+
readonly 80: "Identifier";
|
|
87
|
+
readonly 81: "PrivateIdentifier";
|
|
88
|
+
readonly 83: "BreakKeyword";
|
|
89
|
+
readonly 84: "CaseKeyword";
|
|
90
|
+
readonly 85: "CatchKeyword";
|
|
91
|
+
readonly 86: "ClassKeyword";
|
|
92
|
+
readonly 87: "ConstKeyword";
|
|
93
|
+
readonly 88: "ContinueKeyword";
|
|
94
|
+
readonly 89: "DebuggerKeyword";
|
|
95
|
+
readonly 90: "DefaultKeyword";
|
|
96
|
+
readonly 91: "DeleteKeyword";
|
|
97
|
+
readonly 92: "DoKeyword";
|
|
98
|
+
readonly 93: "ElseKeyword";
|
|
99
|
+
readonly 94: "EnumKeyword";
|
|
100
|
+
readonly 95: "ExportKeyword";
|
|
101
|
+
readonly 96: "ExtendsKeyword";
|
|
102
|
+
readonly 97: "FalseKeyword";
|
|
103
|
+
readonly 98: "FinallyKeyword";
|
|
104
|
+
readonly 99: "ForKeyword";
|
|
105
|
+
readonly 100: "FunctionKeyword";
|
|
106
|
+
readonly 101: "IfKeyword";
|
|
107
|
+
readonly 102: "ImportKeyword";
|
|
108
|
+
readonly 103: "InKeyword";
|
|
109
|
+
readonly 104: "InstanceOfKeyword";
|
|
110
|
+
readonly 105: "NewKeyword";
|
|
111
|
+
readonly 106: "NullKeyword";
|
|
112
|
+
readonly 107: "ReturnKeyword";
|
|
113
|
+
readonly 108: "SuperKeyword";
|
|
114
|
+
readonly 109: "SwitchKeyword";
|
|
115
|
+
readonly 110: "ThisKeyword";
|
|
116
|
+
readonly 111: "ThrowKeyword";
|
|
117
|
+
readonly 112: "TrueKeyword";
|
|
118
|
+
readonly 113: "TryKeyword";
|
|
119
|
+
readonly 114: "TypeOfKeyword";
|
|
120
|
+
readonly 115: "VarKeyword";
|
|
121
|
+
readonly 116: "VoidKeyword";
|
|
122
|
+
readonly 117: "WhileKeyword";
|
|
123
|
+
readonly 118: "WithKeyword";
|
|
124
|
+
readonly 119: "ImplementsKeyword";
|
|
125
|
+
readonly 120: "InterfaceKeyword";
|
|
126
|
+
readonly 121: "LetKeyword";
|
|
127
|
+
readonly 122: "PackageKeyword";
|
|
128
|
+
readonly 123: "PrivateKeyword";
|
|
129
|
+
readonly 124: "ProtectedKeyword";
|
|
130
|
+
readonly 125: "PublicKeyword";
|
|
131
|
+
readonly 126: "StaticKeyword";
|
|
132
|
+
readonly 127: "YieldKeyword";
|
|
133
|
+
readonly 128: "AbstractKeyword";
|
|
134
|
+
readonly 129: "AccessorKeyword";
|
|
135
|
+
readonly 130: "AsKeyword";
|
|
136
|
+
readonly 131: "AssertsKeyword";
|
|
137
|
+
readonly 132: "AssertKeyword";
|
|
138
|
+
readonly 133: "AnyKeyword";
|
|
139
|
+
readonly 134: "AsyncKeyword";
|
|
140
|
+
readonly 135: "AwaitKeyword";
|
|
141
|
+
readonly 136: "BooleanKeyword";
|
|
142
|
+
readonly 137: "ConstructorKeyword";
|
|
143
|
+
readonly 138: "DeclareKeyword";
|
|
144
|
+
readonly 139: "GetKeyword";
|
|
145
|
+
readonly 140: "InferKeyword";
|
|
146
|
+
readonly 141: "IntrinsicKeyword";
|
|
147
|
+
readonly 142: "IsKeyword";
|
|
148
|
+
readonly 143: "KeyOfKeyword";
|
|
149
|
+
readonly 144: "ModuleKeyword";
|
|
150
|
+
readonly 145: "NamespaceKeyword";
|
|
151
|
+
readonly 146: "NeverKeyword";
|
|
152
|
+
readonly 147: "OutKeyword";
|
|
153
|
+
readonly 148: "ReadonlyKeyword";
|
|
154
|
+
readonly 149: "RequireKeyword";
|
|
155
|
+
readonly 150: "NumberKeyword";
|
|
156
|
+
readonly 151: "ObjectKeyword";
|
|
157
|
+
readonly 152: "SatisfiesKeyword";
|
|
158
|
+
readonly 153: "SetKeyword";
|
|
159
|
+
readonly 154: "StringKeyword";
|
|
160
|
+
readonly 155: "SymbolKeyword";
|
|
161
|
+
readonly 156: "TypeKeyword";
|
|
162
|
+
readonly 157: "UndefinedKeyword";
|
|
163
|
+
readonly 158: "UniqueKeyword";
|
|
164
|
+
readonly 159: "UnknownKeyword";
|
|
165
|
+
readonly 160: "UsingKeyword";
|
|
166
|
+
readonly 161: "FromKeyword";
|
|
167
|
+
readonly 162: "GlobalKeyword";
|
|
168
|
+
readonly 163: "BigIntKeyword";
|
|
169
|
+
readonly 164: "OverrideKeyword";
|
|
170
|
+
readonly 165: "OfKeyword";
|
|
171
|
+
readonly 166: "QualifiedName";
|
|
172
|
+
readonly 167: "ComputedPropertyName";
|
|
173
|
+
readonly 168: "TypeParameter";
|
|
174
|
+
readonly 169: "Parameter";
|
|
175
|
+
readonly 170: "Decorator";
|
|
176
|
+
readonly 171: "PropertySignature";
|
|
177
|
+
readonly 172: "PropertyDeclaration";
|
|
178
|
+
readonly 173: "MethodSignature";
|
|
179
|
+
readonly 174: "MethodDeclaration";
|
|
180
|
+
readonly 175: "ClassStaticBlockDeclaration";
|
|
181
|
+
readonly 176: "Constructor";
|
|
182
|
+
readonly 177: "GetAccessor";
|
|
183
|
+
readonly 178: "SetAccessor";
|
|
184
|
+
readonly 179: "CallSignature";
|
|
185
|
+
readonly 180: "ConstructSignature";
|
|
186
|
+
readonly 181: "IndexSignature";
|
|
187
|
+
readonly 182: "TypePredicate";
|
|
188
|
+
readonly 183: "TypeReference";
|
|
189
|
+
readonly 184: "FunctionType";
|
|
190
|
+
readonly 185: "ConstructorType";
|
|
191
|
+
readonly 186: "TypeQuery";
|
|
192
|
+
readonly 187: "TypeLiteral";
|
|
193
|
+
readonly 188: "ArrayType";
|
|
194
|
+
readonly 189: "TupleType";
|
|
195
|
+
readonly 190: "OptionalType";
|
|
196
|
+
readonly 191: "RestType";
|
|
197
|
+
readonly 192: "UnionType";
|
|
198
|
+
readonly 193: "IntersectionType";
|
|
199
|
+
readonly 194: "ConditionalType";
|
|
200
|
+
readonly 195: "InferType";
|
|
201
|
+
readonly 196: "ParenthesizedType";
|
|
202
|
+
readonly 197: "ThisType";
|
|
203
|
+
readonly 198: "TypeOperator";
|
|
204
|
+
readonly 199: "IndexedAccessType";
|
|
205
|
+
readonly 200: "MappedType";
|
|
206
|
+
readonly 201: "LiteralType";
|
|
207
|
+
readonly 202: "NamedTupleMember";
|
|
208
|
+
readonly 203: "TemplateLiteralType";
|
|
209
|
+
readonly 204: "TemplateLiteralTypeSpan";
|
|
210
|
+
readonly 205: "ImportType";
|
|
211
|
+
readonly 206: "ObjectBindingPattern";
|
|
212
|
+
readonly 207: "ArrayBindingPattern";
|
|
213
|
+
readonly 208: "BindingElement";
|
|
214
|
+
readonly 209: "ArrayLiteralExpression";
|
|
215
|
+
readonly 210: "ObjectLiteralExpression";
|
|
216
|
+
readonly 211: "PropertyAccessExpression";
|
|
217
|
+
readonly 212: "ElementAccessExpression";
|
|
218
|
+
readonly 213: "CallExpression";
|
|
219
|
+
readonly 214: "NewExpression";
|
|
220
|
+
readonly 215: "TaggedTemplateExpression";
|
|
221
|
+
readonly 216: "TypeAssertionExpression";
|
|
222
|
+
readonly 217: "ParenthesizedExpression";
|
|
223
|
+
readonly 218: "FunctionExpression";
|
|
224
|
+
readonly 219: "ArrowFunction";
|
|
225
|
+
readonly 220: "DeleteExpression";
|
|
226
|
+
readonly 221: "TypeOfExpression";
|
|
227
|
+
readonly 222: "VoidExpression";
|
|
228
|
+
readonly 223: "AwaitExpression";
|
|
229
|
+
readonly 224: "PrefixUnaryExpression";
|
|
230
|
+
readonly 225: "PostfixUnaryExpression";
|
|
231
|
+
readonly 226: "BinaryExpression";
|
|
232
|
+
readonly 227: "ConditionalExpression";
|
|
233
|
+
readonly 228: "TemplateExpression";
|
|
234
|
+
readonly 229: "YieldExpression";
|
|
235
|
+
readonly 230: "SpreadElement";
|
|
236
|
+
readonly 231: "ClassExpression";
|
|
237
|
+
readonly 232: "OmittedExpression";
|
|
238
|
+
readonly 233: "ExpressionWithTypeArguments";
|
|
239
|
+
readonly 234: "AsExpression";
|
|
240
|
+
readonly 235: "NonNullExpression";
|
|
241
|
+
readonly 236: "MetaProperty";
|
|
242
|
+
readonly 237: "SyntheticExpression";
|
|
243
|
+
readonly 238: "SatisfiesExpression";
|
|
244
|
+
readonly 239: "TemplateSpan";
|
|
245
|
+
readonly 240: "SemicolonClassElement";
|
|
246
|
+
readonly 241: "Block";
|
|
247
|
+
readonly 242: "EmptyStatement";
|
|
248
|
+
readonly 243: "VariableStatement";
|
|
249
|
+
readonly 244: "ExpressionStatement";
|
|
250
|
+
readonly 245: "IfStatement";
|
|
251
|
+
readonly 246: "DoStatement";
|
|
252
|
+
readonly 247: "WhileStatement";
|
|
253
|
+
readonly 248: "ForStatement";
|
|
254
|
+
readonly 249: "ForInStatement";
|
|
255
|
+
readonly 250: "ForOfStatement";
|
|
256
|
+
readonly 251: "ContinueStatement";
|
|
257
|
+
readonly 252: "BreakStatement";
|
|
258
|
+
readonly 253: "ReturnStatement";
|
|
259
|
+
readonly 254: "WithStatement";
|
|
260
|
+
readonly 255: "SwitchStatement";
|
|
261
|
+
readonly 256: "LabeledStatement";
|
|
262
|
+
readonly 257: "ThrowStatement";
|
|
263
|
+
readonly 258: "TryStatement";
|
|
264
|
+
readonly 259: "DebuggerStatement";
|
|
265
|
+
readonly 260: "VariableDeclaration";
|
|
266
|
+
readonly 261: "VariableDeclarationList";
|
|
267
|
+
readonly 262: "FunctionDeclaration";
|
|
268
|
+
readonly 263: "ClassDeclaration";
|
|
269
|
+
readonly 264: "InterfaceDeclaration";
|
|
270
|
+
readonly 265: "TypeAliasDeclaration";
|
|
271
|
+
readonly 266: "EnumDeclaration";
|
|
272
|
+
readonly 267: "ModuleDeclaration";
|
|
273
|
+
readonly 268: "ModuleBlock";
|
|
274
|
+
readonly 269: "CaseBlock";
|
|
275
|
+
readonly 270: "NamespaceExportDeclaration";
|
|
276
|
+
readonly 271: "ImportEqualsDeclaration";
|
|
277
|
+
readonly 272: "ImportDeclaration";
|
|
278
|
+
readonly 273: "ImportClause";
|
|
279
|
+
readonly 274: "NamespaceImport";
|
|
280
|
+
readonly 275: "NamedImports";
|
|
281
|
+
readonly 276: "ImportSpecifier";
|
|
282
|
+
readonly 277: "ExportAssignment";
|
|
283
|
+
readonly 278: "ExportDeclaration";
|
|
284
|
+
readonly 279: "NamedExports";
|
|
285
|
+
readonly 280: "NamespaceExport";
|
|
286
|
+
readonly 281: "ExportSpecifier";
|
|
287
|
+
readonly 282: "MissingDeclaration";
|
|
288
|
+
readonly 283: "ExternalModuleReference";
|
|
289
|
+
readonly 284: "JsxElement";
|
|
290
|
+
readonly 285: "JsxSelfClosingElement";
|
|
291
|
+
readonly 286: "JsxOpeningElement";
|
|
292
|
+
readonly 287: "JsxClosingElement";
|
|
293
|
+
readonly 288: "JsxFragment";
|
|
294
|
+
readonly 289: "JsxOpeningFragment";
|
|
295
|
+
readonly 290: "JsxClosingFragment";
|
|
296
|
+
readonly 291: "JsxAttribute";
|
|
297
|
+
readonly 292: "JsxAttributes";
|
|
298
|
+
readonly 293: "JsxSpreadAttribute";
|
|
299
|
+
readonly 294: "JsxExpression";
|
|
300
|
+
readonly 295: "JsxNamespacedName";
|
|
301
|
+
readonly 296: "CaseClause";
|
|
302
|
+
readonly 297: "DefaultClause";
|
|
303
|
+
readonly 298: "HeritageClause";
|
|
304
|
+
readonly 299: "CatchClause";
|
|
305
|
+
readonly 300: "ImportAttributes";
|
|
306
|
+
readonly 301: "ImportAttribute";
|
|
307
|
+
readonly 303: "PropertyAssignment";
|
|
308
|
+
readonly 304: "ShorthandPropertyAssignment";
|
|
309
|
+
readonly 305: "SpreadAssignment";
|
|
310
|
+
readonly 306: "EnumMember";
|
|
311
|
+
readonly 307: "SourceFile";
|
|
312
|
+
readonly 308: "Bundle";
|
|
313
|
+
readonly 309: "JSDocTypeExpression";
|
|
314
|
+
readonly 310: "JSDocNameReference";
|
|
315
|
+
readonly 311: "JSDocMemberName";
|
|
316
|
+
readonly 312: "JSDocAllType";
|
|
317
|
+
readonly 313: "JSDocUnknownType";
|
|
318
|
+
readonly 314: "JSDocNullableType";
|
|
319
|
+
readonly 315: "JSDocNonNullableType";
|
|
320
|
+
readonly 316: "JSDocOptionalType";
|
|
321
|
+
readonly 317: "JSDocFunctionType";
|
|
322
|
+
readonly 318: "JSDocVariadicType";
|
|
323
|
+
readonly 319: "JSDocNamepathType";
|
|
324
|
+
readonly 320: "JSDoc";
|
|
325
|
+
readonly 321: "JSDocText";
|
|
326
|
+
readonly 322: "JSDocTypeLiteral";
|
|
327
|
+
readonly 323: "JSDocSignature";
|
|
328
|
+
readonly 324: "JSDocLink";
|
|
329
|
+
readonly 325: "JSDocLinkCode";
|
|
330
|
+
readonly 326: "JSDocLinkPlain";
|
|
331
|
+
readonly 327: "JSDocTag";
|
|
332
|
+
readonly 328: "JSDocAugmentsTag";
|
|
333
|
+
readonly 329: "JSDocImplementsTag";
|
|
334
|
+
readonly 330: "JSDocAuthorTag";
|
|
335
|
+
readonly 331: "JSDocDeprecatedTag";
|
|
336
|
+
readonly 332: "JSDocClassTag";
|
|
337
|
+
readonly 333: "JSDocPublicTag";
|
|
338
|
+
readonly 334: "JSDocPrivateTag";
|
|
339
|
+
readonly 335: "JSDocProtectedTag";
|
|
340
|
+
readonly 336: "JSDocReadonlyTag";
|
|
341
|
+
readonly 337: "JSDocOverrideTag";
|
|
342
|
+
readonly 338: "JSDocCallbackTag";
|
|
343
|
+
readonly 339: "JSDocOverloadTag";
|
|
344
|
+
readonly 340: "JSDocEnumTag";
|
|
345
|
+
readonly 341: "JSDocParameterTag";
|
|
346
|
+
readonly 342: "JSDocReturnTag";
|
|
347
|
+
readonly 343: "JSDocThisTag";
|
|
348
|
+
readonly 344: "JSDocTypeTag";
|
|
349
|
+
readonly 345: "JSDocTemplateTag";
|
|
350
|
+
readonly 346: "JSDocTypedefTag";
|
|
351
|
+
readonly 347: "JSDocSeeTag";
|
|
352
|
+
readonly 348: "JSDocPropertyTag";
|
|
353
|
+
readonly 349: "JSDocThrowsTag";
|
|
354
|
+
readonly 350: "JSDocSatisfiesTag";
|
|
355
|
+
readonly 352: "SyntaxList";
|
|
356
|
+
readonly 353: "NotEmittedStatement";
|
|
357
|
+
readonly 354: "PartiallyEmittedExpression";
|
|
358
|
+
readonly 355: "CommaListExpression";
|
|
359
|
+
readonly 356: "SyntheticReferenceExpression";
|
|
360
|
+
readonly 357: "Count";
|
|
361
|
+
};
|
|
362
|
+
export declare const getNodeName: (node: ts.Node) => string;
|
|
363
|
+
export declare const getSyntaxName: (kind: ts.SyntaxKind) => string;
|
|
364
|
+
export type SyntaxKindNameType = typeof SyntaxKindName;
|
|
365
|
+
export type ModuleStatements = ts.ClassDeclaration | ts.ImportDeclaration | ts.VariableStatement | ts.FunctionDeclaration | ts.TypeAliasDeclaration | ts.InterfaceDeclaration;
|
|
366
|
+
export type PrimaryExpressions = LiteralExpressions | ts.TrueLiteral | ts.FalseLiteral | ts.ArrayLiteralExpression | ts.ClassExpression | ts.FunctionExpression | ts.Identifier | ts.ImportExpression | ts.NewExpression | ts.NullLiteral | ts.ObjectLiteralExpression | ts.PrivateIdentifier | ts.ParenthesizedExpression | ts.SuperExpression | ts.TemplateExpression | ts.ThisExpression;
|
|
367
|
+
export type MemberExpressions = PrimaryExpressions | ts.ElementAccessExpression | ts.ExpressionWithTypeArguments | ts.PropertyAccessExpression | ts.TaggedTemplateExpression;
|
|
368
|
+
export type LeftHandSideExpression = ts.CallExpression | MemberExpressions | ts.NonNullExpression;
|
|
369
|
+
/**
|
|
370
|
+
* All concrete types which extends ts.ClassElement
|
|
371
|
+
*/
|
|
372
|
+
export type ClassElements = ts.ClassStaticBlockDeclaration | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.IndexSignatureDeclaration | ts.MethodDeclaration | ts.PropertyDeclaration | ts.SemicolonClassElement | ts.SetAccessorDeclaration;
|
|
373
|
+
/**
|
|
374
|
+
* All concrete types which extends ts.Statement
|
|
375
|
+
*/
|
|
376
|
+
export type Statements = ts.EmptyStatement | ts.VariableStatement | ts.ExpressionStatement | ts.IfStatement | ts.DoStatement | ts.WhileStatement | ts.ForStatement | ts.ForInStatement | ts.ForOfStatement | ts.ContinueStatement | ts.BreakStatement | ts.ReturnStatement | ts.WithStatement | ts.SwitchStatement | ts.LabeledStatement | ts.ThrowStatement | ts.TryStatement | ts.DebuggerStatement | ts.ImportDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration;
|
|
377
|
+
/**
|
|
378
|
+
* All concrete types which extends ts.LiteralExpression
|
|
379
|
+
*/
|
|
380
|
+
export type LiteralExpressions = ts.NumericLiteral | ts.BigIntLiteral | ts.StringLiteral | ts.RegularExpressionLiteral | ts.NoSubstitutionTemplateLiteral;
|
|
381
|
+
/**
|
|
382
|
+
* All concrete types which extend ts.Expression
|
|
383
|
+
*/
|
|
384
|
+
export type Expressions = ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.TypeAssertion | ts.ParenthesizedExpression | ts.FunctionExpression | ts.DeleteExpression | ts.TypeOfExpression | ts.VoidExpression | ts.AwaitExpression | ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.BinaryExpression | ts.ConditionalExpression | ts.TemplateExpression | ts.YieldExpression | ts.OmittedExpression | ts.ExpressionWithTypeArguments | ts.AsExpression | ts.NonNullExpression | ts.SatisfiesExpression | PrimaryExpressions | LeftHandSideExpression;
|
|
385
|
+
/**
|
|
386
|
+
* Map an inherited base type to a union type of "all" the nodes which extend that base type
|
|
387
|
+
* where "all" is limited to nodes relevant to this compiler.
|
|
388
|
+
*/
|
|
389
|
+
export type MapBaseType<T> = T extends DeliberateAny ? IfEquals<T, ts.Expression, Expressions, IfEquals<T, ts.LeftHandSideExpression, LeftHandSideExpression, IfEquals<T, ts.Statement, Statements, IfEquals<T, ts.ClassElement, ClassElements, T>>>> : never;
|
|
390
|
+
type IfEquals<T, U, Y = unknown, N = never> = ((x: T) => T) extends (x: U) => U ? (((x: U) => U) extends (x: T) => T ? Y : N) : N;
|
|
391
|
+
export declare const BinaryOpSyntaxes: {
|
|
392
|
+
readonly 40: BuilderBinaryOp.add;
|
|
393
|
+
readonly 41: BuilderBinaryOp.sub;
|
|
394
|
+
readonly 42: BuilderBinaryOp.mult;
|
|
395
|
+
readonly 44: BuilderBinaryOp.div;
|
|
396
|
+
readonly 45: BuilderBinaryOp.mod;
|
|
397
|
+
readonly 43: BuilderBinaryOp.pow;
|
|
398
|
+
readonly 52: BuilderBinaryOp.bitOr;
|
|
399
|
+
readonly 53: BuilderBinaryOp.bitXor;
|
|
400
|
+
readonly 51: BuilderBinaryOp.bitAnd;
|
|
401
|
+
readonly 48: BuilderBinaryOp.lshift;
|
|
402
|
+
readonly 49: BuilderBinaryOp.rshift;
|
|
403
|
+
};
|
|
404
|
+
export declare const LogicalOpSyntaxes: {
|
|
405
|
+
56: BinaryBooleanOperator;
|
|
406
|
+
57: BinaryBooleanOperator;
|
|
407
|
+
};
|
|
408
|
+
export declare const AugmentedAssignmentLogicalOpSyntaxes: {
|
|
409
|
+
77: BinaryBooleanOperator;
|
|
410
|
+
76: BinaryBooleanOperator;
|
|
411
|
+
};
|
|
412
|
+
export declare function isKeyOf<TMap extends object>(key: PropertyKey, map: TMap): key is keyof TMap;
|
|
413
|
+
export declare const ComparisonOpSyntaxes: {
|
|
414
|
+
readonly 37: BuilderComparisonOp.eq;
|
|
415
|
+
readonly 38: BuilderComparisonOp.ne;
|
|
416
|
+
readonly 30: BuilderComparisonOp.lt;
|
|
417
|
+
readonly 33: BuilderComparisonOp.lte;
|
|
418
|
+
readonly 32: BuilderComparisonOp.gt;
|
|
419
|
+
readonly 34: BuilderComparisonOp.gte;
|
|
420
|
+
};
|
|
421
|
+
export declare const AugmentedAssignmentBinaryOp: {
|
|
422
|
+
readonly 65: BuilderBinaryOp.add;
|
|
423
|
+
readonly 66: BuilderBinaryOp.sub;
|
|
424
|
+
readonly 67: BuilderBinaryOp.mult;
|
|
425
|
+
readonly 69: BuilderBinaryOp.div;
|
|
426
|
+
readonly 70: BuilderBinaryOp.mod;
|
|
427
|
+
readonly 68: BuilderBinaryOp.pow;
|
|
428
|
+
readonly 75: BuilderBinaryOp.bitOr;
|
|
429
|
+
readonly 79: BuilderBinaryOp.bitXor;
|
|
430
|
+
readonly 74: BuilderBinaryOp.bitAnd;
|
|
431
|
+
readonly 71: BuilderBinaryOp.lshift;
|
|
432
|
+
readonly 72: BuilderBinaryOp.rshift;
|
|
433
|
+
};
|
|
434
|
+
export declare const UnaryExpressionUnaryOps: {
|
|
435
|
+
46: BuilderUnaryOp;
|
|
436
|
+
47: BuilderUnaryOp;
|
|
437
|
+
40: BuilderUnaryOp;
|
|
438
|
+
41: BuilderUnaryOp;
|
|
439
|
+
55: BuilderUnaryOp;
|
|
440
|
+
};
|
|
441
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type ts from 'typescript';
|
|
2
|
+
import type { AwstBuildContext } from '../awst_build/context/awst-build-context';
|
|
3
|
+
import type { DeliberateAny } from '../typescript-helpers';
|
|
4
|
+
import type { MapBaseType, SyntaxKindNameType } from './syntax-names';
|
|
5
|
+
type UnionToIntersection<T> = (T extends DeliberateAny ? (x: T) => void : never) extends (x: infer TIntersection) => void ? TIntersection : never;
|
|
6
|
+
export type Visitor<T extends {
|
|
7
|
+
kind: ts.SyntaxKind;
|
|
8
|
+
}, TReturn> = UnionToIntersection<T extends DeliberateAny ? {
|
|
9
|
+
[key in T['kind'] as key extends keyof SyntaxKindNameType ? `visit${SyntaxKindNameType[key]}` : never]: (node: T) => TReturn;
|
|
10
|
+
} : never>;
|
|
11
|
+
/**
|
|
12
|
+
* This type relies on `T` being a concrete node with a `kind` property that is resolved to a single `SyntaxKind`.
|
|
13
|
+
* There are lots of nodes (such as ts.Expression) which are base types for several nodes which means this type
|
|
14
|
+
* will return `typeof SyntaxKind` instead of `typeof SyntaxKind.someValue` and that will break the rest of the
|
|
15
|
+
* generic types here. `MapBaseType<TNode>` exists to convert these base types into a union of their concrete implementors
|
|
16
|
+
*/
|
|
17
|
+
export type KindForNode<T extends ts.Node> = T extends {
|
|
18
|
+
kind: infer TKind;
|
|
19
|
+
} ? TKind : never;
|
|
20
|
+
export type VisitorMethod<TKind> = TKind extends keyof SyntaxKindNameType ? `visit${SyntaxKindNameType[TKind]}` : never;
|
|
21
|
+
export type MethodReturnType<TMethod, TVisitor> = TMethod extends keyof TVisitor ? TVisitor[TMethod] extends (...args: DeliberateAny[]) => infer TReturn ? TReturn : never : never;
|
|
22
|
+
export type ReturnTypeForNode<T extends ts.Node, TVisitor> = MethodReturnType<VisitorMethod<KindForNode<T>>, TVisitor>;
|
|
23
|
+
export declare const accept: <TSelf extends {
|
|
24
|
+
context: AwstBuildContext;
|
|
25
|
+
}, T extends ts.Node>(visitor: TSelf, node: T) => ReturnTypeForNode<MapBaseType<T>, TSelf>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum ArtifactKind {
|
|
2
|
+
Awst = 0,
|
|
3
|
+
AwstJson = 1
|
|
4
|
+
}
|
|
5
|
+
export declare function writeArtifact<TObj>({ sourceFile, outDir, kind, obj, buildArtifact, }: {
|
|
6
|
+
sourceFile: string;
|
|
7
|
+
outDir: string;
|
|
8
|
+
kind: ArtifactKind;
|
|
9
|
+
artifactName?: string;
|
|
10
|
+
buildArtifact(obj: TObj): string;
|
|
11
|
+
obj: TObj;
|
|
12
|
+
}): void;
|