@algorandfoundation/puya-ts 1.0.0-alpha.4

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.
Files changed (241) hide show
  1. package/README.md +11 -0
  2. package/awst/index.d.ts +4 -0
  3. package/awst/intrinsic-factory.d.ts +35 -0
  4. package/awst/json-serialize-awst.d.ts +17 -0
  5. package/awst/models.d.ts +85 -0
  6. package/awst/node-factory.d.ts +90 -0
  7. package/awst/nodes.d.ts +841 -0
  8. package/awst/source-location.d.ts +21 -0
  9. package/awst/to-code-visitor.d.ts +87 -0
  10. package/awst/txn-fields.d.ts +84 -0
  11. package/awst/util.d.ts +2 -0
  12. package/awst/wtypes.d.ts +131 -0
  13. package/awst_build/base-visitor.d.ts +87 -0
  14. package/awst_build/constructor-visitor.d.ts +18 -0
  15. package/awst_build/context/awst-build-context.d.ts +72 -0
  16. package/awst_build/context/evaluation-context.d.ts +11 -0
  17. package/awst_build/context/switch-loop-context.d.ts +31 -0
  18. package/awst_build/context/unique-name-resolver.d.ts +14 -0
  19. package/awst_build/contract-data.d.ts +24 -0
  20. package/awst_build/contract-method-visitor.d.ts +20 -0
  21. package/awst_build/contract-visitor.d.ts +33 -0
  22. package/awst_build/decorator-visitor.d.ts +34 -0
  23. package/awst_build/eb/arc4/arrays.d.ts +31 -0
  24. package/awst_build/eb/arc4/uint-n-constructor-builder.d.ts +14 -0
  25. package/awst_build/eb/arc4-bare-method-decorator-builder.d.ts +19 -0
  26. package/awst_build/eb/assert-function-builder.d.ts +10 -0
  27. package/awst_build/eb/assert-match-function-builder.d.ts +8 -0
  28. package/awst_build/eb/biguint-expression-builder.d.ts +21 -0
  29. package/awst_build/eb/boolean-expression-builder.d.ts +15 -0
  30. package/awst_build/eb/bytes-expression-builder.d.ts +44 -0
  31. package/awst_build/eb/contract-builder.d.ts +19 -0
  32. package/awst_build/eb/ensure-budget.d.ts +8 -0
  33. package/awst_build/eb/folding.d.ts +5 -0
  34. package/awst_build/eb/free-subroutine-expression-builder.d.ts +22 -0
  35. package/awst_build/eb/index.d.ts +90 -0
  36. package/awst_build/eb/intrinsic-enum-builder.d.ts +9 -0
  37. package/awst_build/eb/iterable-iterator-expression-builder.d.ts +10 -0
  38. package/awst_build/eb/literal/array-literal-expression-builder.d.ts +19 -0
  39. package/awst_build/eb/literal/big-int-literal-expression-builder.d.ts +19 -0
  40. package/awst_build/eb/literal/conditional-expression-builder.d.ts +22 -0
  41. package/awst_build/eb/literal/object-expression-builder.d.ts +13 -0
  42. package/awst_build/eb/literal/object-literal-expression-builder.d.ts +28 -0
  43. package/awst_build/eb/literal-expression-builder.d.ts +27 -0
  44. package/awst_build/eb/log-function-builder.d.ts +7 -0
  45. package/awst_build/eb/namespace-builder.d.ts +9 -0
  46. package/awst_build/eb/native-array-expression-builder.d.ts +8 -0
  47. package/awst_build/eb/omitted-expression-builder.d.ts +9 -0
  48. package/awst_build/eb/op-module-builder.d.ts +25 -0
  49. package/awst_build/eb/reference/account.d.ts +15 -0
  50. package/awst_build/eb/reference/application.d.ts +12 -0
  51. package/awst_build/eb/reference/asset.d.ts +13 -0
  52. package/awst_build/eb/reference/base.d.ts +37 -0
  53. package/awst_build/eb/storage/box.d.ts +50 -0
  54. package/awst_build/eb/storage/global-state.d.ts +29 -0
  55. package/awst_build/eb/storage/local-state.d.ts +32 -0
  56. package/awst_build/eb/storage/util.d.ts +5 -0
  57. package/awst_build/eb/storage/value-proxy.d.ts +22 -0
  58. package/awst_build/eb/string-expression-builder.d.ts +27 -0
  59. package/awst_build/eb/transactions/group-transactions.d.ts +15 -0
  60. package/awst_build/eb/transactions/inner-transaction-params.d.ts +19 -0
  61. package/awst_build/eb/transactions/inner-transactions.d.ts +10 -0
  62. package/awst_build/eb/transactions/txn-fields.d.ts +1317 -0
  63. package/awst_build/eb/transactions/util.d.ts +5 -0
  64. package/awst_build/eb/tuple-expression-builder.d.ts +12 -0
  65. package/awst_build/eb/uint64-enum-type-builder.d.ts +13 -0
  66. package/awst_build/eb/uint64-expression-builder.d.ts +21 -0
  67. package/awst_build/eb/urange-function.d.ts +7 -0
  68. package/awst_build/eb/util/arg-parsing.d.ts +106 -0
  69. package/awst_build/eb/util/compare-bytes.d.ts +5 -0
  70. package/awst_build/eb/util/compare-uint64.d.ts +5 -0
  71. package/awst_build/eb/util/index.d.ts +19 -0
  72. package/awst_build/eb/util/require-constant-value.d.ts +4 -0
  73. package/awst_build/eb/void-expression-builder.d.ts +7 -0
  74. package/awst_build/function-visitor.d.ts +45 -0
  75. package/awst_build/index.d.ts +5 -0
  76. package/awst_build/lib/index.d.ts +2 -0
  77. package/awst_build/op-metadata.d.ts +27 -0
  78. package/awst_build/ptypes/arc4-types.d.ts +56 -0
  79. package/awst_build/ptypes/base.d.ts +31 -0
  80. package/awst_build/ptypes/index.d.ts +455 -0
  81. package/awst_build/ptypes/intrinsic-enum-type.d.ts +14 -0
  82. package/awst_build/ptypes/op-ptypes.d.ts +6 -0
  83. package/awst_build/ptypes/register.d.ts +2 -0
  84. package/awst_build/source-file-visitor.d.ts +21 -0
  85. package/awst_build/subroutine-visitor.d.ts +10 -0
  86. package/awst_build/symbol-name.d.ts +10 -0
  87. package/awst_build/text-visitor.d.ts +20 -0
  88. package/awst_build/type-registry.d.ts +61 -0
  89. package/awst_build/type-resolver.d.ts +18 -0
  90. package/bin/run-cli.d.ts +2 -0
  91. package/bin/run-cli.mjs +20 -0
  92. package/bin/run-cli.mjs.map +1 -0
  93. package/cli.d.ts +1 -0
  94. package/cli.mjs +146 -0
  95. package/cli.mjs.map +1 -0
  96. package/compile-options.d.ts +17 -0
  97. package/constants.d.ts +20 -0
  98. package/errors.d.ts +46 -0
  99. package/index-D6W2FUFQ.js +16297 -0
  100. package/index-D6W2FUFQ.js.map +1 -0
  101. package/index.d.ts +19 -0
  102. package/index.mjs +15 -0
  103. package/index.mjs.map +1 -0
  104. package/logger.d.ts +39 -0
  105. package/node_modules/typescript/LICENSE.txt +55 -0
  106. package/node_modules/typescript/README.md +50 -0
  107. package/node_modules/typescript/SECURITY.md +41 -0
  108. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  109. package/node_modules/typescript/bin/tsc +2 -0
  110. package/node_modules/typescript/bin/tsserver +2 -0
  111. package/node_modules/typescript/lib/cancellationToken.js +90 -0
  112. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2087 -0
  113. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2087 -0
  114. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2087 -0
  115. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2087 -0
  116. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2087 -0
  117. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2087 -0
  118. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2087 -0
  119. package/node_modules/typescript/lib/lib.d.ts +22 -0
  120. package/node_modules/typescript/lib/lib.decorators.d.ts +386 -0
  121. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  122. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  123. package/node_modules/typescript/lib/lib.dom.d.ts +28087 -0
  124. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +491 -0
  125. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  126. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  127. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  128. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  129. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +527 -0
  130. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  131. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  132. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  133. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  134. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  135. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  136. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  137. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  138. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  139. package/node_modules/typescript/lib/lib.es2017.d.ts +25 -0
  140. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  141. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  142. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  143. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  144. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  145. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  146. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  147. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  148. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  149. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  150. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  151. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  152. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  153. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  154. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  155. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  156. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  157. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  158. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  159. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  160. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  161. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +727 -0
  162. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  163. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  164. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  165. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  166. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  167. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  168. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
  169. package/node_modules/typescript/lib/lib.es2020.string.d.ts +42 -0
  170. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  171. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  172. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  173. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  174. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  175. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  176. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +76 -0
  177. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  178. package/node_modules/typescript/lib/lib.es2022.d.ts +26 -0
  179. package/node_modules/typescript/lib/lib.es2022.error.d.ts +73 -0
  180. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  181. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +121 -0
  182. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  183. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  184. package/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts +39 -0
  185. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  186. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  187. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  188. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  189. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  190. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  191. package/node_modules/typescript/lib/lib.es5.d.ts +4585 -0
  192. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  193. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  194. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +106 -0
  195. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  196. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  197. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  198. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  199. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  200. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  201. package/node_modules/typescript/lib/lib.esnext.object.d.ts +29 -0
  202. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +35 -0
  203. package/node_modules/typescript/lib/lib.esnext.regexp.d.ts +25 -0
  204. package/node_modules/typescript/lib/lib.esnext.string.d.ts +29 -0
  205. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  206. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  207. package/node_modules/typescript/lib/lib.webworker.d.ts +9410 -0
  208. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  209. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +288 -0
  210. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2087 -0
  211. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2087 -0
  212. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2087 -0
  213. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2087 -0
  214. package/node_modules/typescript/lib/tsc.js +130771 -0
  215. package/node_modules/typescript/lib/tsserver.js +623 -0
  216. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  217. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  218. package/node_modules/typescript/lib/typesMap.json +497 -0
  219. package/node_modules/typescript/lib/typescript.d.ts +11329 -0
  220. package/node_modules/typescript/lib/typescript.js +196077 -0
  221. package/node_modules/typescript/lib/typingsInstaller.js +236 -0
  222. package/node_modules/typescript/lib/watchGuard.js +53 -0
  223. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2087 -0
  224. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2087 -0
  225. package/node_modules/typescript/package.json +121 -0
  226. package/package.json +42 -0
  227. package/parser/index.d.ts +13 -0
  228. package/parser/json-serialize-source-files.d.ts +2 -0
  229. package/parser/resolve-module-name-literals.d.ts +2 -0
  230. package/puya/build-compilation-set-mapping.d.ts +10 -0
  231. package/puya/index.d.ts +13 -0
  232. package/puya/options.d.ts +29 -0
  233. package/puya/run-child-proc.d.ts +5 -0
  234. package/util/base-32.d.ts +2 -0
  235. package/util/base-85.d.ts +10 -0
  236. package/util/default-map.d.ts +1 -0
  237. package/util/generate-temp-file.d.ts +9 -0
  238. package/util/index.d.ts +43 -0
  239. package/visitor/syntax-names.d.ts +441 -0
  240. package/visitor/visitor.d.ts +26 -0
  241. package/write-artifact.d.ts +12 -0
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "typescript",
3
+ "author": "Microsoft Corp.",
4
+ "homepage": "https://www.typescriptlang.org/",
5
+ "version": "5.6.2",
6
+ "license": "Apache-2.0",
7
+ "description": "TypeScript is a language for application scale JavaScript development",
8
+ "keywords": [
9
+ "TypeScript",
10
+ "Microsoft",
11
+ "compiler",
12
+ "language",
13
+ "javascript"
14
+ ],
15
+ "bugs": {
16
+ "url": "https://github.com/microsoft/TypeScript/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/microsoft/TypeScript.git"
21
+ },
22
+ "main": "./lib/typescript.js",
23
+ "typings": "./lib/typescript.d.ts",
24
+ "bin": {
25
+ "tsc": "./bin/tsc",
26
+ "tsserver": "./bin/tsserver"
27
+ },
28
+ "engines": {
29
+ "node": ">=14.17"
30
+ },
31
+ "files": [
32
+ "bin",
33
+ "lib",
34
+ "!lib/enu",
35
+ "LICENSE.txt",
36
+ "README.md",
37
+ "SECURITY.md",
38
+ "ThirdPartyNoticeText.txt",
39
+ "!**/.gitattributes"
40
+ ],
41
+ "devDependencies": {
42
+ "@dprint/formatter": "^0.4.1",
43
+ "@dprint/typescript": "0.91.6",
44
+ "@esfx/canceltoken": "^1.0.0",
45
+ "@eslint/js": "^9.9.0",
46
+ "@octokit/rest": "^21.0.1",
47
+ "@types/chai": "^4.3.17",
48
+ "@types/diff": "^5.2.1",
49
+ "@types/minimist": "^1.2.5",
50
+ "@types/mocha": "^10.0.7",
51
+ "@types/ms": "^0.7.34",
52
+ "@types/node": "latest",
53
+ "@types/source-map-support": "^0.5.10",
54
+ "@types/which": "^3.0.4",
55
+ "@typescript-eslint/rule-tester": "^8.1.0",
56
+ "@typescript-eslint/type-utils": "^8.1.0",
57
+ "@typescript-eslint/utils": "^8.1.0",
58
+ "azure-devops-node-api": "^14.0.2",
59
+ "c8": "^10.1.2",
60
+ "chai": "^4.5.0",
61
+ "chalk": "^4.1.2",
62
+ "chokidar": "^3.6.0",
63
+ "diff": "^5.2.0",
64
+ "dprint": "^0.47.2",
65
+ "esbuild": "^0.23.0",
66
+ "eslint": "^9.9.0",
67
+ "eslint-formatter-autolinkable-stylish": "^1.4.0",
68
+ "eslint-plugin-regexp": "^2.6.0",
69
+ "fast-xml-parser": "^4.4.1",
70
+ "glob": "^10.4.5",
71
+ "globals": "^15.9.0",
72
+ "hereby": "^1.9.0",
73
+ "jsonc-parser": "^3.3.1",
74
+ "knip": "^5.27.2",
75
+ "minimist": "^1.2.8",
76
+ "mocha": "^10.7.3",
77
+ "mocha-fivemat-progress-reporter": "^0.1.0",
78
+ "monocart-coverage-reports": "^2.10.2",
79
+ "ms": "^2.1.3",
80
+ "node-fetch": "^3.3.2",
81
+ "playwright": "^1.46.0",
82
+ "source-map-support": "^0.5.21",
83
+ "tslib": "^2.6.3",
84
+ "typescript": "^5.5.4",
85
+ "typescript-eslint": "^8.1.0",
86
+ "which": "^3.0.1"
87
+ },
88
+ "overrides": {
89
+ "typescript@*": "$typescript"
90
+ },
91
+ "scripts": {
92
+ "test": "hereby runtests-parallel --light=false",
93
+ "test:eslint-rules": "hereby run-eslint-rules-tests",
94
+ "build": "npm run build:compiler && npm run build:tests",
95
+ "build:compiler": "hereby local",
96
+ "build:tests": "hereby tests",
97
+ "build:tests:notypecheck": "hereby tests --no-typecheck",
98
+ "clean": "hereby clean",
99
+ "gulp": "hereby",
100
+ "lint": "hereby lint",
101
+ "knip": "hereby knip",
102
+ "format": "dprint fmt",
103
+ "setup-hooks": "node scripts/link-hooks.mjs"
104
+ },
105
+ "browser": {
106
+ "fs": false,
107
+ "os": false,
108
+ "path": false,
109
+ "crypto": false,
110
+ "buffer": false,
111
+ "source-map-support": false,
112
+ "inspector": false,
113
+ "perf_hooks": false
114
+ },
115
+ "packageManager": "npm@8.19.4",
116
+ "volta": {
117
+ "node": "20.1.0",
118
+ "npm": "8.19.4"
119
+ },
120
+ "gitHead": "a7e3374f13327483fbe94e32806d65785b0b6cda"
121
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "scripts": {},
3
+ "files": [
4
+ "**"
5
+ ],
6
+ "name": "@algorandfoundation/puya-ts",
7
+ "version": "1.0.0-alpha.4",
8
+ "description": "Compiles Algorand TypeScript into byte code which runs on the Algorand Virtual Machine (AVM)",
9
+ "private": false,
10
+ "author": "Algorand foundation",
11
+ "license": "MIT",
12
+ "dependencies": {
13
+ "chalk": "^5.3.0",
14
+ "change-case": "^5.4.4",
15
+ "commander": "^12.1.0",
16
+ "cross-spawn": "^7.0.3",
17
+ "glob": "^11.0.0",
18
+ "polytype": "^0.17.0",
19
+ "typescript": "^5.6.2",
20
+ "zod": "^3.23.8"
21
+ },
22
+ "bundledDependencies": [
23
+ "typescript"
24
+ ],
25
+ "module": "./index.mjs",
26
+ "types": "./index.d.ts",
27
+ "type": "module",
28
+ "bin": {
29
+ "puya-ts": "./bin/run-cli.mjs",
30
+ "puyats": "./bin/run-cli.mjs"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./index.d.ts",
35
+ "import": "./index.mjs"
36
+ },
37
+ "./cli": {
38
+ "types": "./cli.d.ts",
39
+ "import": "./cli.mjs"
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,13 @@
1
+ import ts from 'typescript';
2
+ import type { CompileOptions } from '../compile-options';
3
+ export type SourceFileMapping = Record<string, ts.SourceFile>;
4
+ export type CreateProgramResult = {
5
+ sourceFiles: SourceFileMapping;
6
+ program: ts.Program;
7
+ };
8
+ export declare function createTsProgram(options: CompileOptions): {
9
+ sourceFiles: {
10
+ [k: string]: ts.SourceFile;
11
+ };
12
+ program: ts.Program;
13
+ };
@@ -0,0 +1,2 @@
1
+ import type { SourceFileMapping } from './index';
2
+ export declare function jsonSerializeSourceFiles(sourceFiles: SourceFileMapping, programDirectory: string): string;
@@ -0,0 +1,2 @@
1
+ import ts from 'typescript';
2
+ export declare function resolveModuleNameLiterals(moduleLiterals: readonly ts.StringLiteralLike[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions): readonly ts.ResolvedModuleWithFailedLookupLocations[];
@@ -0,0 +1,10 @@
1
+ import type { CompilationSet } from '../awst/models';
2
+ import type { AWST } from '../awst/nodes';
3
+ import type { CompilationSetMapping } from './options';
4
+ export declare function buildCompilationSetMapping({ awst, inputPaths, programDirectory, compilationSet, outDir, }: {
5
+ awst: AWST[];
6
+ inputPaths: string[];
7
+ programDirectory: string;
8
+ outDir: string;
9
+ compilationSet: CompilationSet;
10
+ }): CompilationSetMapping;
@@ -0,0 +1,13 @@
1
+ import type { CompilationSet } from '../awst/models';
2
+ import type { AWST } from '../awst/nodes';
3
+ import type { CompileOptions } from '../compile-options';
4
+ import type { SourceFileMapping } from '../parser';
5
+ import type { PuyaPassThroughOptions } from './options';
6
+ export declare function invokePuya({ moduleAwst, programDirectory, sourceFiles, compileOptions, compilationSet, passThroughOptions, }: {
7
+ moduleAwst: AWST[];
8
+ programDirectory: string;
9
+ sourceFiles: SourceFileMapping;
10
+ compileOptions: CompileOptions;
11
+ compilationSet: CompilationSet;
12
+ passThroughOptions: PuyaPassThroughOptions;
13
+ }): void;
@@ -0,0 +1,29 @@
1
+ export declare enum LocalsCoalescingStrategy {
2
+ root_operand = "root_operand",
3
+ root_operand_excluding_args = "root_operand_excluding_args",
4
+ aggressive = "aggressive"
5
+ }
6
+ export type CompilationSetMapping = Record<string, string>;
7
+ export declare const defaultPuyaOptions: PuyaPassThroughOptions;
8
+ export type PuyaPassThroughOptions = Omit<PuyaOptions, 'compilationSet'>;
9
+ export declare class PuyaOptions {
10
+ outputTeal: boolean;
11
+ outputArc32: boolean;
12
+ outputSsaIr: boolean;
13
+ outputOptimizationIr: boolean;
14
+ outputDestructuredIr: boolean;
15
+ outputMemoryIr: boolean;
16
+ outputBytecode: boolean;
17
+ matchAlgodBytecode: boolean;
18
+ debugLevel: number;
19
+ optimizationLevel: number;
20
+ targetAvmVersion: number;
21
+ cliTemplateDefinitions: string[];
22
+ templateVarsPrefix: string;
23
+ localsCoalescingStrategy: LocalsCoalescingStrategy;
24
+ compilationSet: CompilationSetMapping;
25
+ constructor({ passThroughOptions, compilationSet, }: {
26
+ passThroughOptions: PuyaPassThroughOptions;
27
+ compilationSet: CompilationSetMapping;
28
+ });
29
+ }
@@ -0,0 +1,5 @@
1
+ export declare function runChildProc({ command, args, cwd }: {
2
+ command: string;
3
+ args: string[];
4
+ cwd?: string;
5
+ }): void;
@@ -0,0 +1,2 @@
1
+ export declare const base32ToUint8Array: (value: string) => Uint8Array;
2
+ export declare const uint8ArrayToBase32: (value: Uint8Array) => string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This implementation of base85 encoding matches python's base64.b85encode(...) function which is based on the character set of rfc1924
3
+ * but supports arbitrary sized input.
4
+ *
5
+ * It IS NOT an ascii85 implementation
6
+ */
7
+ export declare function buildBase85Encoder(): {
8
+ encode(b: Uint8Array): string;
9
+ encodeUtf8(s: string): string;
10
+ };
@@ -0,0 +1 @@
1
+ export declare function defaultRecord<TKey extends PropertyKey, TValue>(defaultInit: (key: TKey) => TValue): Record<TKey, TValue>;
@@ -0,0 +1,9 @@
1
+ import type { WriteFileOptions } from 'node:fs';
2
+ export type TempFile = {
3
+ writeFileSync(data: NodeJS.ArrayBufferView, options?: WriteFileOptions): void;
4
+ writeFileSync(data: string, options?: WriteFileOptions): void;
5
+ readonly filePath: string;
6
+ } & Disposable;
7
+ export declare function generateTempFile(options?: {
8
+ ext?: string;
9
+ }): TempFile;
@@ -0,0 +1,43 @@
1
+ import type { SourceLocation } from '../awst/source-location';
2
+ import type { DeliberateAny } from '../typescript-helpers';
3
+ export { base32ToUint8Array, uint8ArrayToBase32 } from './base-32';
4
+ export declare function invariant(condition: unknown, message: string): asserts condition;
5
+ export declare function codeInvariant(condition: unknown, message: string, sourceLocation?: SourceLocation): asserts condition;
6
+ export declare const convertEnum: <TEnumIn, TEnumOut, TKeys extends string>(value: TEnumIn, fromEnum: Record<TKeys, TEnumIn>, toEnum: Record<TKeys, TEnumOut>) => TEnumOut;
7
+ export declare const tryConvertEnum: <TEnumIn, TEnumOut, TKeys extends string>(value: TEnumIn, fromEnum: Record<TKeys, TEnumIn>, toEnum: Record<string, TEnumOut>) => TEnumOut | undefined;
8
+ export declare const expandMaybeArray: <T>(maybeArray: T | T[]) => T[];
9
+ export declare const hexToUint8Array: (value: string) => Uint8Array;
10
+ export declare const base64ToUint8Array: (value: string) => Uint8Array;
11
+ export declare const utf8ToUint8Array: (value: string) => Uint8Array;
12
+ export declare const uint8ArrayToUtf8: (value: Uint8Array) => string;
13
+ export declare const bigIntToUint8Array: (val: bigint, fixedSize?: number | "dynamic") => Uint8Array;
14
+ export declare const hasFlags: <T extends number>(value: T, flags: T) => boolean;
15
+ export declare const intersectsFlags: <T extends number>(value: T, flags: T) => boolean;
16
+ export declare function enumerate<T>(iterable: Iterable<T>): IterableIterator<readonly [number, T]>;
17
+ export declare function toSubScript(num: number): string;
18
+ export declare function instanceOfAny<T extends Array<{
19
+ new (...args: DeliberateAny[]): DeliberateAny;
20
+ }>>(x: unknown, ...types: T): x is InstanceType<T[number]>;
21
+ /**
22
+ * Normalise a file path to only include relevant segments.
23
+ *
24
+ * - Anything in /node_modules/ is truncated to <package-name>/path.ext
25
+ * - Anything in workingDirectory is truncated relative to the workingDirectory
26
+ * - Forward slashes are used to segment paths
27
+ * @param filePath
28
+ * @param workingDirectory
29
+ */
30
+ export declare function normalisePath(filePath: string, workingDirectory: string): string;
31
+ type SortDir = 'asc' | 'desc';
32
+ export declare const sortBy: <T, TKey>(keySelector: (item: T) => TKey, dir?: SortDir) => (a: T, b: T) => number;
33
+ /**
34
+ * Can be used to filter a collection to a set of distinct items as determined by a specified key.
35
+ * @param keySelector A lambda which when given an item, returns the items unique identifier
36
+ *
37
+ * Usage:
38
+ *
39
+ * ```
40
+ * const distinctItems = nonDistinctItems.filter(distinct(x => x.uniqueId))
41
+ * ```
42
+ */
43
+ export declare const distinct: <T>(keySelector?: (item: T) => unknown) => (item: T) => boolean;