@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.
- 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 +131 -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 +19 -0
- package/awst_build/eb/literal/big-int-literal-expression-builder.d.ts +19 -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 +455 -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/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 +20 -0
- package/bin/run-cli.mjs.map +1 -0
- package/cli.d.ts +1 -0
- package/cli.mjs +146 -0
- package/cli.mjs.map +1 -0
- package/compile-options.d.ts +17 -0
- package/constants.d.ts +20 -0
- package/errors.d.ts +46 -0
- package/index-D6W2FUFQ.js +16297 -0
- package/index-D6W2FUFQ.js.map +1 -0
- package/index.d.ts +19 -0
- package/index.mjs +15 -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 +130771 -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 +196077 -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 +42 -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 +10 -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 +43 -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,5 @@
|
|
|
1
|
+
import { TransactionKind } from '../../../awst/models';
|
|
2
|
+
import type { GroupTransactionPType, InnerTransactionPType, ItxnParamsPType } from '../../ptypes';
|
|
3
|
+
export declare function getInnerTransactionType(kind: TransactionKind | undefined): InnerTransactionPType;
|
|
4
|
+
export declare function getItxnParamsType(kind: TransactionKind | undefined): ItxnParamsPType;
|
|
5
|
+
export declare function getGroupTransactionType(kind: TransactionKind | undefined): GroupTransactionPType;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Expression } from '../../awst/nodes';
|
|
2
|
+
import type { SourceLocation } from '../../awst/source-location';
|
|
3
|
+
import type { PType } from '../ptypes';
|
|
4
|
+
import { TuplePType } from '../ptypes';
|
|
5
|
+
import type { InstanceBuilder, NodeBuilder } from './index';
|
|
6
|
+
import { InstanceExpressionBuilder } from './index';
|
|
7
|
+
export declare class TupleExpressionBuilder extends InstanceExpressionBuilder<TuplePType> {
|
|
8
|
+
constructor(expression: Expression, ptype: PType);
|
|
9
|
+
iterate(): Expression;
|
|
10
|
+
indexAccess(index: InstanceBuilder, sourceLocation: SourceLocation): NodeBuilder;
|
|
11
|
+
getItemBuilders(): InstanceBuilder[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Expression } from '../../awst/nodes';
|
|
2
|
+
import type { SourceLocation } from '../../awst/source-location';
|
|
3
|
+
import type { PType } from '../ptypes';
|
|
4
|
+
import { Uint64EnumMemberType, Uint64EnumType } from '../ptypes';
|
|
5
|
+
import { InstanceExpressionBuilder, NodeBuilder } from './index';
|
|
6
|
+
export declare class Uint64EnumTypeBuilder extends NodeBuilder {
|
|
7
|
+
readonly ptype: Uint64EnumType;
|
|
8
|
+
constructor(sourceLocation: SourceLocation, ptype: PType);
|
|
9
|
+
memberAccess(name: string, sourceLocation: SourceLocation): NodeBuilder;
|
|
10
|
+
}
|
|
11
|
+
export declare class Uint64EnumMemberExpressionBuilder extends InstanceExpressionBuilder<Uint64EnumMemberType> {
|
|
12
|
+
constructor(expr: Expression, ptype: PType);
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { awst } from '../../awst';
|
|
2
|
+
import type { Expression } from '../../awst/nodes';
|
|
3
|
+
import type { SourceLocation } from '../../awst/source-location';
|
|
4
|
+
import type { InstanceType, PType } from '../ptypes';
|
|
5
|
+
import type { BuilderComparisonOp, InstanceBuilder } from './index';
|
|
6
|
+
import { BuilderBinaryOp, BuilderUnaryOp, FunctionBuilder, InstanceExpressionBuilder } from './index';
|
|
7
|
+
export declare class UInt64FunctionBuilder extends FunctionBuilder {
|
|
8
|
+
readonly ptype: import("../ptypes").LibFunctionType;
|
|
9
|
+
call(args: Array<InstanceBuilder>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation): InstanceBuilder;
|
|
10
|
+
}
|
|
11
|
+
export declare class UInt64ExpressionBuilder extends InstanceExpressionBuilder<InstanceType> {
|
|
12
|
+
constructor(expr: Expression);
|
|
13
|
+
boolEval(sourceLocation: SourceLocation, negate: boolean): Expression;
|
|
14
|
+
compare(other: InstanceBuilder, op: BuilderComparisonOp, sourceLocation: SourceLocation): InstanceBuilder;
|
|
15
|
+
prefixUnaryOp(op: BuilderUnaryOp, sourceLocation: SourceLocation): InstanceBuilder;
|
|
16
|
+
postfixUnaryOp(op: BuilderUnaryOp, sourceLocation: SourceLocation): InstanceBuilder;
|
|
17
|
+
binaryOp(other: InstanceBuilder, op: BuilderBinaryOp, sourceLocation: SourceLocation): InstanceBuilder;
|
|
18
|
+
augmentedAssignment(other: InstanceBuilder, op: BuilderBinaryOp, sourceLocation: SourceLocation): InstanceBuilder;
|
|
19
|
+
assign(other: InstanceBuilder, sourceLocation: SourceLocation): InstanceBuilder;
|
|
20
|
+
toBytes(sourceLocation: SourceLocation): awst.Expression;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SourceLocation } from '../../awst/source-location';
|
|
2
|
+
import type { PType } from '../ptypes';
|
|
3
|
+
import type { InstanceBuilder, NodeBuilder } from './index';
|
|
4
|
+
import { FunctionBuilder } from './index';
|
|
5
|
+
export declare class UrangeFunctionBuilder extends FunctionBuilder {
|
|
6
|
+
call(args: ReadonlyArray<InstanceBuilder>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation): NodeBuilder;
|
|
7
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { SourceLocation } from '../../../awst/source-location';
|
|
2
|
+
import type { DeliberateAny, Tuple } from '../../../typescript-helpers';
|
|
3
|
+
import type { PType, PTypeOrClass } from '../../ptypes';
|
|
4
|
+
import type { InstanceBuilder } from '../index';
|
|
5
|
+
declare const ArgSpecDiscriminator: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* Optional arg spec
|
|
8
|
+
* Will be mapped to `Expression | undefined`
|
|
9
|
+
*/
|
|
10
|
+
type OptionalArg = {
|
|
11
|
+
t: PTypeOrClass[];
|
|
12
|
+
required: false;
|
|
13
|
+
[ArgSpecDiscriminator]: 'arg';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Required arg spec
|
|
17
|
+
* Will be mapped to `Expression`
|
|
18
|
+
*/
|
|
19
|
+
type RequiredArg = {
|
|
20
|
+
t: PTypeOrClass[];
|
|
21
|
+
required: true;
|
|
22
|
+
[ArgSpecDiscriminator]: 'arg';
|
|
23
|
+
};
|
|
24
|
+
type ArgSpec = OptionalArg | RequiredArg;
|
|
25
|
+
/**
|
|
26
|
+
* Object arg spec
|
|
27
|
+
* Will be mapped to an object with the same keys where each property
|
|
28
|
+
* is mapped to a Required or Optional spec
|
|
29
|
+
*/
|
|
30
|
+
type ObjArgSpec = Record<string, ArgSpec> & {
|
|
31
|
+
[ArgSpecDiscriminator]: 'obj';
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Maps an ObjArgSpec to its output type
|
|
35
|
+
*/
|
|
36
|
+
type ArgsForObjSpec<T extends ObjArgSpec> = {
|
|
37
|
+
[key in keyof T]: ArgFor<T[key]>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Defines the expected shape of a single argument.
|
|
41
|
+
* Either an ArgSpec indicting a single value, or an ObjArgSpec indicating an
|
|
42
|
+
* object literal with several properties
|
|
43
|
+
*/
|
|
44
|
+
type ArgMap = ArgSpec | ObjArgSpec;
|
|
45
|
+
/**
|
|
46
|
+
* Maps an arg spec to its output type
|
|
47
|
+
*/
|
|
48
|
+
type ArgFor<T extends ObjArgSpec | ArgSpec> = T extends ObjArgSpec ? ArgsForObjSpec<T> : T extends OptionalArg ? InstanceBuilder | undefined : T extends RequiredArg ? InstanceBuilder : never;
|
|
49
|
+
/**
|
|
50
|
+
* Maps each arg to an expected output type
|
|
51
|
+
*/
|
|
52
|
+
type ParsedArgs<T extends [...DeliberateAny[]]> = T extends [infer T1 extends ArgMap, ...infer TRest] ? [ArgFor<T1>, ...ParsedArgs<TRest>] : T extends [] ? [] : T extends Array<infer TItem extends ArgMap> ? Array<ArgFor<TItem>> : never;
|
|
53
|
+
declare const argSpecFactory: {
|
|
54
|
+
/**
|
|
55
|
+
* A required arg with one of the specified types
|
|
56
|
+
* @param ptypes
|
|
57
|
+
*/
|
|
58
|
+
required(...ptypes: PTypeOrClass[]): RequiredArg;
|
|
59
|
+
/**
|
|
60
|
+
* An optional arg with one of the specified types
|
|
61
|
+
* @param ptypes
|
|
62
|
+
*/
|
|
63
|
+
optional(...ptypes: PTypeOrClass[]): OptionalArg;
|
|
64
|
+
/**
|
|
65
|
+
* An object map arg, if all properties are optional - the arg itself becomes optional
|
|
66
|
+
* @param props A mapping of expected properties to expected ptypes
|
|
67
|
+
*/
|
|
68
|
+
obj<T extends Omit<ObjArgSpec, typeof ArgSpecDiscriminator>>(props: T): T & {
|
|
69
|
+
[ArgSpecDiscriminator]: "obj";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type ArgSpecFactory = typeof argSpecFactory;
|
|
73
|
+
export declare function parseFunctionArgs<const TGenericCount extends number, const TArgMap extends [...ArgMap[]]>({ args, typeArgs, funcName, callLocation, genericTypeArgs, argSpec, }: {
|
|
74
|
+
/**
|
|
75
|
+
* Raw args array passed to call function
|
|
76
|
+
*/
|
|
77
|
+
args: ReadonlyArray<InstanceBuilder>;
|
|
78
|
+
/**
|
|
79
|
+
* Raw typeArgs array passed to call function
|
|
80
|
+
*/
|
|
81
|
+
typeArgs: ReadonlyArray<PType>;
|
|
82
|
+
/**
|
|
83
|
+
* The name of the function being called
|
|
84
|
+
* (Used for error context)
|
|
85
|
+
*/
|
|
86
|
+
funcName: string;
|
|
87
|
+
/**
|
|
88
|
+
* The location of the call expression in the application source code
|
|
89
|
+
*/
|
|
90
|
+
callLocation: SourceLocation;
|
|
91
|
+
/**
|
|
92
|
+
* The expected number of generic type arguments
|
|
93
|
+
*/
|
|
94
|
+
genericTypeArgs: TGenericCount;
|
|
95
|
+
/**
|
|
96
|
+
* A mapping of expected argument types
|
|
97
|
+
*/
|
|
98
|
+
argSpec: (a: ArgSpecFactory) => TArgMap;
|
|
99
|
+
}): {
|
|
100
|
+
/**
|
|
101
|
+
* A tuple of generic type args with a length of `TGenericCount`
|
|
102
|
+
*/
|
|
103
|
+
ptypes: Tuple<PType, TGenericCount>;
|
|
104
|
+
args: ParsedArgs<TArgMap>;
|
|
105
|
+
};
|
|
106
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Expression } from '../../../awst/nodes';
|
|
2
|
+
import type { SourceLocation } from '../../../awst/source-location';
|
|
3
|
+
import { BooleanExpressionBuilder } from '../boolean-expression-builder';
|
|
4
|
+
import { BuilderComparisonOp } from '../index';
|
|
5
|
+
export declare function compareBytes(left: Expression, right: Expression, op: BuilderComparisonOp, sourceLocation: SourceLocation, typeDescription: string): BooleanExpressionBuilder;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Expression } from '../../../awst/nodes';
|
|
2
|
+
import type { SourceLocation } from '../../../awst/source-location';
|
|
3
|
+
import { BooleanExpressionBuilder } from '../boolean-expression-builder';
|
|
4
|
+
import { BuilderComparisonOp } from '../index';
|
|
5
|
+
export declare function compareUint64(left: Expression, right: Expression, op: BuilderComparisonOp, sourceLocation: SourceLocation, typeDescription: string): BooleanExpressionBuilder;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { awst, ConstantValue } from '../../../awst';
|
|
2
|
+
import type { Expression } from '../../../awst/nodes';
|
|
3
|
+
import type { SourceLocation } from '../../../awst/source-location';
|
|
4
|
+
import type { PType, PTypeOrClass } from '../../ptypes';
|
|
5
|
+
import type { NodeBuilder } from '../index';
|
|
6
|
+
import { InstanceBuilder } from '../index';
|
|
7
|
+
export declare function requireExpressionOfType(builder: NodeBuilder, ptype: PTypeOrClass): Expression;
|
|
8
|
+
export declare function requireBuilderOfType(builder: NodeBuilder, ptype: PTypeOrClass): InstanceBuilder;
|
|
9
|
+
export declare function resolvableToType(builder: NodeBuilder, ptype: PTypeOrClass): builder is InstanceBuilder;
|
|
10
|
+
export declare function requestExpressionOfType(builder: NodeBuilder, ptype: PTypeOrClass): Expression | undefined;
|
|
11
|
+
export declare function requestBuilderOfType(builder: NodeBuilder, ptype: PTypeOrClass): InstanceBuilder | undefined;
|
|
12
|
+
export declare function requireInstanceBuilder(builder: NodeBuilder): InstanceBuilder;
|
|
13
|
+
export declare function requireExpressionsOfType<const TPTypes extends [...PType[]]>(builders: ReadonlyArray<InstanceBuilder>, ptypes: TPTypes, sourceLocation: SourceLocation): Array<awst.Expression>;
|
|
14
|
+
export declare function requireStringConstant(builder: InstanceBuilder): awst.StringConstant;
|
|
15
|
+
export declare function requireIntegerConstant(builder: InstanceBuilder): awst.IntegerConstant;
|
|
16
|
+
export declare function requireBooleanConstant(builder: InstanceBuilder): awst.BoolConstant;
|
|
17
|
+
export declare function requestConstantOfType(builder: NodeBuilder, ptype: PType): awst.Constant | undefined;
|
|
18
|
+
export declare function requireConstantOfType(builder: NodeBuilder, ptype: PType, messageOverride?: string): awst.Constant;
|
|
19
|
+
export declare function isValidLiteralForPType(literalValue: ConstantValue, ptype: PTypeOrClass): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConstantValue } from '../../../awst';
|
|
2
|
+
import type { SourceLocation } from '../../../awst/source-location';
|
|
3
|
+
import type { NodeBuilder } from '../index';
|
|
4
|
+
export declare function requireConstantValue(builder: NodeBuilder, sourceLocation: SourceLocation): ConstantValue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Expression, LValue } from '../../awst/nodes';
|
|
2
|
+
import type { InstanceType } from '../ptypes';
|
|
3
|
+
import { InstanceExpressionBuilder } from './index';
|
|
4
|
+
export declare class VoidExpressionBuilder extends InstanceExpressionBuilder<InstanceType> {
|
|
5
|
+
constructor(expr: Expression);
|
|
6
|
+
resolveLValue(): LValue;
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import type * as awst from '../awst/nodes';
|
|
3
|
+
import type { SourceLocation } from '../awst/source-location';
|
|
4
|
+
import type { Statements } from '../visitor/syntax-names';
|
|
5
|
+
import type { Visitor } from '../visitor/visitor';
|
|
6
|
+
import { BaseVisitor } from './base-visitor';
|
|
7
|
+
import type { AwstBuildContext } from './context/awst-build-context';
|
|
8
|
+
import type { InstanceBuilder } from './eb';
|
|
9
|
+
import { FunctionPType } from './ptypes';
|
|
10
|
+
export declare class FunctionVisitor extends BaseVisitor implements Visitor<ts.ParameterDeclaration, awst.SubroutineArgument>, Visitor<ts.Block, awst.Block>, Visitor<Statements, awst.Statement | awst.Statement[]> {
|
|
11
|
+
protected accept: <TNode extends ts.Node>(node: TNode) => import("../visitor/visitor").MethodReturnType<import("../visitor/visitor").VisitorMethod<import("../visitor/visitor").KindForNode<import("../visitor/syntax-names").MapBaseType<TNode>>>, FunctionVisitor>;
|
|
12
|
+
protected readonly _functionType: FunctionPType;
|
|
13
|
+
constructor(ctx: AwstBuildContext, node: ts.MethodDeclaration | ts.FunctionDeclaration | ts.ConstructorDeclaration);
|
|
14
|
+
protected buildFunctionAwst(node: ts.MethodDeclaration | ts.FunctionDeclaration | ts.ConstructorDeclaration): {
|
|
15
|
+
args: awst.SubroutineArgument[];
|
|
16
|
+
documentation: awst.MethodDocumentation;
|
|
17
|
+
body: awst.Block;
|
|
18
|
+
};
|
|
19
|
+
buildAssignmentTarget(bindingName: ts.BindingName, sourceLocation: SourceLocation): InstanceBuilder;
|
|
20
|
+
evaluateParameterBindingExpressions(parameters: Iterable<ts.ParameterDeclaration>, sourceLocation: SourceLocation): awst.Statement[];
|
|
21
|
+
visitTypeAliasDeclaration(node: ts.TypeAliasDeclaration): awst.Statement[];
|
|
22
|
+
visitClassDeclaration(node: ts.ClassDeclaration): awst.Statement | awst.Statement[];
|
|
23
|
+
visitVariableDeclarationList(node: ts.VariableDeclarationList): awst.Statement[];
|
|
24
|
+
visitVariableStatement(node: ts.VariableStatement): awst.Statement | awst.Statement[];
|
|
25
|
+
visitForStatement(node: ts.ForStatement): awst.Statement | awst.Statement[];
|
|
26
|
+
visitForOfStatement(node: ts.ForOfStatement): awst.Statement | awst.Statement[];
|
|
27
|
+
visitForInStatement(node: ts.ForInStatement): awst.Statement | awst.Statement[];
|
|
28
|
+
visitTryStatement(node: ts.TryStatement): awst.Statement | awst.Statement[];
|
|
29
|
+
visitEmptyStatement(node: ts.EmptyStatement): awst.Statement | awst.Statement[];
|
|
30
|
+
visitExpressionStatement(node: ts.ExpressionStatement): awst.Statement | awst.Statement[];
|
|
31
|
+
visitIfStatement(node: ts.IfStatement): awst.Statement | awst.Statement[];
|
|
32
|
+
visitDoStatement(node: ts.DoStatement): awst.Statement | awst.Statement[];
|
|
33
|
+
visitWhileStatement(node: ts.WhileStatement): awst.Statement | awst.Statement[];
|
|
34
|
+
visitContinueStatement(node: ts.ContinueStatement): awst.Statement | awst.Statement[];
|
|
35
|
+
visitBreakStatement(node: ts.BreakStatement): awst.Statement | awst.Statement[];
|
|
36
|
+
visitReturnStatement(node: ts.ReturnStatement): awst.Statement | awst.Statement[];
|
|
37
|
+
visitWithStatement(node: ts.WithStatement): awst.Statement | awst.Statement[];
|
|
38
|
+
visitSwitchStatement(node: ts.SwitchStatement): awst.Statement | awst.Statement[];
|
|
39
|
+
visitLabeledStatement(node: ts.LabeledStatement): awst.Statement | awst.Statement[];
|
|
40
|
+
visitThrowStatement(node: ts.ThrowStatement): awst.Statement | awst.Statement[];
|
|
41
|
+
visitDebuggerStatement(node: ts.DebuggerStatement): awst.Statement | awst.Statement[];
|
|
42
|
+
visitImportDeclaration(node: ts.ImportDeclaration): awst.Statement | awst.Statement[];
|
|
43
|
+
visitBlock(node: ts.Block): awst.Block;
|
|
44
|
+
visitParameter(node: ts.ParameterDeclaration): awst.SubroutineArgument;
|
|
45
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CompilationSet } from '../awst/models';
|
|
2
|
+
import type { AWST } from '../awst/nodes';
|
|
3
|
+
import type { CompileOptions } from '../compile-options';
|
|
4
|
+
import type { CreateProgramResult } from '../parser';
|
|
5
|
+
export declare function buildAwst({ program, sourceFiles }: CreateProgramResult, options: CompileOptions): [AWST[], CompilationSet];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as ptypes from './ptypes';
|
|
2
|
+
import type { Expression } from '../awst/nodes';
|
|
3
|
+
export type ImmediateArgMapping = {
|
|
4
|
+
name: string;
|
|
5
|
+
ptypes: ptypes.PType[];
|
|
6
|
+
};
|
|
7
|
+
export type StackArg = {
|
|
8
|
+
name: string;
|
|
9
|
+
ptypes: ptypes.PType[];
|
|
10
|
+
};
|
|
11
|
+
export type Signature = {
|
|
12
|
+
argNames: string[];
|
|
13
|
+
immediateArgs: Array<ImmediateArgMapping | bigint | string>;
|
|
14
|
+
stackArgs: Array<StackArg | Expression>;
|
|
15
|
+
returnType: ptypes.PType;
|
|
16
|
+
};
|
|
17
|
+
export type IntrinsicOpMapping = {
|
|
18
|
+
type: 'op-mapping';
|
|
19
|
+
op: string;
|
|
20
|
+
signatures: Signature[];
|
|
21
|
+
};
|
|
22
|
+
export type IntrinsicOpGrouping = {
|
|
23
|
+
type: 'op-grouping';
|
|
24
|
+
name: string;
|
|
25
|
+
ops: Record<string, IntrinsicOpMapping>;
|
|
26
|
+
};
|
|
27
|
+
export declare const OP_METADATA: Record<string, IntrinsicOpMapping | IntrinsicOpGrouping>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { SourceLocation } from '../../awst/source-location';
|
|
2
|
+
import type { ARC4Type } from '../../awst/wtypes';
|
|
3
|
+
import { ARC4DynamicArray, ARC4StaticArray, ARC4UIntN } from '../../awst/wtypes';
|
|
4
|
+
import { PType } from './base';
|
|
5
|
+
import { LibFunctionType } from './index';
|
|
6
|
+
export declare const UintNConstructor: LibFunctionType;
|
|
7
|
+
export declare abstract class ARC4EncodedType extends PType {
|
|
8
|
+
abstract get wtype(): ARC4Type;
|
|
9
|
+
}
|
|
10
|
+
export declare class UintNType extends ARC4EncodedType {
|
|
11
|
+
static baseFullName: string;
|
|
12
|
+
readonly module: "@algorandfoundation/algorand-typescript/arc4/encoded-types.d.ts";
|
|
13
|
+
readonly n: bigint;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly singleton = false;
|
|
16
|
+
get wtype(): ARC4UIntN;
|
|
17
|
+
constructor({ n }: {
|
|
18
|
+
n: bigint;
|
|
19
|
+
});
|
|
20
|
+
static parameterise(typeArgs: PType[]): UintNType;
|
|
21
|
+
getGenericArgs(): PType[];
|
|
22
|
+
}
|
|
23
|
+
export declare const DynamicArrayConstructor: LibFunctionType;
|
|
24
|
+
export declare class DynamicArrayType extends ARC4EncodedType {
|
|
25
|
+
static baseFullName: string;
|
|
26
|
+
readonly module: "@algorandfoundation/algorand-typescript/arc4/encoded-types.d.ts";
|
|
27
|
+
readonly elementType: ARC4EncodedType;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly singleton = false;
|
|
30
|
+
readonly sourceLocation: SourceLocation | undefined;
|
|
31
|
+
get wtype(): ARC4DynamicArray;
|
|
32
|
+
constructor({ elementType, sourceLocation }: {
|
|
33
|
+
elementType: ARC4EncodedType;
|
|
34
|
+
sourceLocation?: SourceLocation;
|
|
35
|
+
});
|
|
36
|
+
static parameterise(typeArgs: PType[]): DynamicArrayType;
|
|
37
|
+
getGenericArgs(): PType[];
|
|
38
|
+
}
|
|
39
|
+
export declare const StaticArrayConstructor: LibFunctionType;
|
|
40
|
+
export declare class StaticArrayType extends ARC4EncodedType {
|
|
41
|
+
static baseFullName: string;
|
|
42
|
+
readonly module: "@algorandfoundation/algorand-typescript/arc4/encoded-types.d.ts";
|
|
43
|
+
readonly elementType: ARC4EncodedType;
|
|
44
|
+
readonly arraySize: bigint;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly singleton = false;
|
|
47
|
+
readonly sourceLocation: SourceLocation | undefined;
|
|
48
|
+
get wtype(): ARC4StaticArray;
|
|
49
|
+
constructor({ elementType, arraySize, sourceLocation, }: {
|
|
50
|
+
elementType: ARC4EncodedType;
|
|
51
|
+
arraySize: bigint;
|
|
52
|
+
sourceLocation?: SourceLocation;
|
|
53
|
+
});
|
|
54
|
+
static parameterise(typeArgs: PType[]): StaticArrayType;
|
|
55
|
+
getGenericArgs(): PType[];
|
|
56
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { wtypes } from '../../awst';
|
|
2
|
+
import type { DeliberateAny } from '../../typescript-helpers';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a public type visible to a developer of AlgoTS
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class PType {
|
|
7
|
+
/**
|
|
8
|
+
* Get the associated wtype for this ptype if applicable
|
|
9
|
+
*/
|
|
10
|
+
abstract readonly wtype: wtypes.WType | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Get the unaliased name of this ptype
|
|
13
|
+
*/
|
|
14
|
+
abstract readonly name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Get the declaring module of this ptype
|
|
17
|
+
*/
|
|
18
|
+
abstract readonly module: string;
|
|
19
|
+
abstract readonly singleton: boolean;
|
|
20
|
+
get fullName(): string;
|
|
21
|
+
get wtypeOrThrow(): wtypes.WType;
|
|
22
|
+
equals(other: PType): boolean;
|
|
23
|
+
static equals(other: PType): boolean;
|
|
24
|
+
equalsOrInstanceOf(other: PTypeOrClass): boolean;
|
|
25
|
+
toString(): string;
|
|
26
|
+
getGenericArgs(): PType[];
|
|
27
|
+
}
|
|
28
|
+
export type PTypeOrClass = PType | {
|
|
29
|
+
new (...args: DeliberateAny[]): PType;
|
|
30
|
+
equals(other: PType): boolean;
|
|
31
|
+
};
|