@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,464 @@
|
|
|
1
|
+
import { wtypes } from '../../awst';
|
|
2
|
+
import { TransactionKind } from '../../awst/models';
|
|
3
|
+
import type { WType } from '../../awst/wtypes';
|
|
4
|
+
import { WEnumeration, WTuple } from '../../awst/wtypes';
|
|
5
|
+
import { PType } from './base';
|
|
6
|
+
export * from './base';
|
|
7
|
+
export * from './intrinsic-enum-type';
|
|
8
|
+
export * from './op-ptypes';
|
|
9
|
+
/**
|
|
10
|
+
* Transient types can appear in expressions but should not be used as variable or return types
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class TransientType extends PType {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly module: string;
|
|
15
|
+
readonly singleton: boolean;
|
|
16
|
+
readonly typeMessage: string;
|
|
17
|
+
readonly expressionMessage: string;
|
|
18
|
+
constructor({ name, module, singleton, typeMessage, expressionMessage, }: {
|
|
19
|
+
name: string;
|
|
20
|
+
module: string;
|
|
21
|
+
singleton: boolean;
|
|
22
|
+
typeMessage: string;
|
|
23
|
+
expressionMessage: string;
|
|
24
|
+
});
|
|
25
|
+
get wtype(): WType | undefined;
|
|
26
|
+
get wtypeOrThrow(): WType;
|
|
27
|
+
}
|
|
28
|
+
export declare class UnsupportedType extends PType {
|
|
29
|
+
#private;
|
|
30
|
+
readonly wtype: undefined;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly module: string;
|
|
33
|
+
readonly singleton = false;
|
|
34
|
+
constructor({ name, module, fullName }: {
|
|
35
|
+
name: string;
|
|
36
|
+
module: string;
|
|
37
|
+
fullName?: string;
|
|
38
|
+
});
|
|
39
|
+
get fullName(): string;
|
|
40
|
+
get wtypeOrThrow(): WType;
|
|
41
|
+
}
|
|
42
|
+
export declare class ContractClassPType extends PType {
|
|
43
|
+
readonly wtype: undefined;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly module: string;
|
|
46
|
+
readonly properties: Record<string, PType>;
|
|
47
|
+
readonly methods: Record<string, FunctionPType>;
|
|
48
|
+
readonly singleton = true;
|
|
49
|
+
readonly baseTypes: ContractClassPType[];
|
|
50
|
+
constructor(props: {
|
|
51
|
+
module: string;
|
|
52
|
+
name: string;
|
|
53
|
+
properties: Record<string, AppStorageType>;
|
|
54
|
+
methods: Record<string, FunctionPType>;
|
|
55
|
+
baseTypes: ContractClassPType[];
|
|
56
|
+
});
|
|
57
|
+
get isARC4(): boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare class BaseContractClassType extends ContractClassPType {
|
|
60
|
+
readonly _isArc4: boolean;
|
|
61
|
+
get isARC4(): boolean;
|
|
62
|
+
constructor({ isArc4, ...rest }: {
|
|
63
|
+
isArc4: boolean;
|
|
64
|
+
module: string;
|
|
65
|
+
name: string;
|
|
66
|
+
properties: Record<string, AppStorageType>;
|
|
67
|
+
methods: Record<string, FunctionPType>;
|
|
68
|
+
baseTypes: ContractClassPType[];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export declare class UnionPType extends TransientType {
|
|
72
|
+
get fullName(): string;
|
|
73
|
+
readonly singleton = false;
|
|
74
|
+
readonly types: PType[];
|
|
75
|
+
private constructor();
|
|
76
|
+
static fromTypes(types: PType[]): PType;
|
|
77
|
+
}
|
|
78
|
+
export declare abstract class StorageProxyPType extends PType {
|
|
79
|
+
readonly wtype: WType;
|
|
80
|
+
readonly contentType: PType;
|
|
81
|
+
readonly singleton = false;
|
|
82
|
+
protected constructor(props: {
|
|
83
|
+
content: PType;
|
|
84
|
+
keyWType: WType;
|
|
85
|
+
});
|
|
86
|
+
abstract getGenericArgs(): PType[];
|
|
87
|
+
}
|
|
88
|
+
export declare class GlobalStateType extends StorageProxyPType {
|
|
89
|
+
static readonly baseName = "GlobalState";
|
|
90
|
+
static readonly baseFullName: string;
|
|
91
|
+
readonly module: string;
|
|
92
|
+
get name(): string;
|
|
93
|
+
get fullName(): string;
|
|
94
|
+
constructor(props: {
|
|
95
|
+
content: PType;
|
|
96
|
+
});
|
|
97
|
+
static parameterise(typeArgs: PType[]): GlobalStateType;
|
|
98
|
+
getGenericArgs(): PType[];
|
|
99
|
+
}
|
|
100
|
+
export declare class LocalStateType extends StorageProxyPType {
|
|
101
|
+
static readonly baseName = "LocalState";
|
|
102
|
+
static readonly baseFullName: string;
|
|
103
|
+
readonly module: string;
|
|
104
|
+
get name(): string;
|
|
105
|
+
get fullName(): string;
|
|
106
|
+
constructor(props: {
|
|
107
|
+
content: PType;
|
|
108
|
+
});
|
|
109
|
+
static parameterise(typeArgs: PType[]): LocalStateType;
|
|
110
|
+
getGenericArgs(): PType[];
|
|
111
|
+
}
|
|
112
|
+
export declare class BoxPType extends StorageProxyPType {
|
|
113
|
+
static readonly baseName = "Box";
|
|
114
|
+
static readonly baseFullName: string;
|
|
115
|
+
readonly module: string;
|
|
116
|
+
get name(): string;
|
|
117
|
+
get fullName(): string;
|
|
118
|
+
constructor(props: {
|
|
119
|
+
content: PType;
|
|
120
|
+
});
|
|
121
|
+
static parameterise(typeArgs: PType[]): BoxPType;
|
|
122
|
+
getGenericArgs(): PType[];
|
|
123
|
+
}
|
|
124
|
+
export declare class BoxMapPType extends StorageProxyPType {
|
|
125
|
+
static readonly baseName = "BoxMap";
|
|
126
|
+
static readonly baseFullName: string;
|
|
127
|
+
readonly module: string;
|
|
128
|
+
get name(): string;
|
|
129
|
+
get fullName(): string;
|
|
130
|
+
readonly keyType: PType;
|
|
131
|
+
constructor(props: {
|
|
132
|
+
content: PType;
|
|
133
|
+
keyType: PType;
|
|
134
|
+
});
|
|
135
|
+
static parameterise(typeArgs: PType[]): BoxMapPType;
|
|
136
|
+
getGenericArgs(): PType[];
|
|
137
|
+
}
|
|
138
|
+
export declare class BoxRefPType extends StorageProxyPType {
|
|
139
|
+
readonly module: "@algorandfoundation/algorand-typescript/box.d.ts";
|
|
140
|
+
get name(): string;
|
|
141
|
+
constructor();
|
|
142
|
+
getGenericArgs(): PType[];
|
|
143
|
+
}
|
|
144
|
+
export type AppStorageType = GlobalStateType | LocalStateType;
|
|
145
|
+
export declare function isAppStorageType(ptype: PType): ptype is AppStorageType;
|
|
146
|
+
/**
|
|
147
|
+
* An open generic type parameter
|
|
148
|
+
*/
|
|
149
|
+
export declare class TypeParameterType extends PType {
|
|
150
|
+
readonly name: string;
|
|
151
|
+
readonly module: string;
|
|
152
|
+
readonly singleton = false;
|
|
153
|
+
readonly wtype: undefined;
|
|
154
|
+
constructor({ name, module }: {
|
|
155
|
+
name: string;
|
|
156
|
+
module: string;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A type from the typescript libs which might pop up in type reflection
|
|
161
|
+
* but is not relevant to the output of the compiler
|
|
162
|
+
*/
|
|
163
|
+
export declare class InternalType extends PType {
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly module: string;
|
|
166
|
+
readonly singleton = false;
|
|
167
|
+
readonly wtype: undefined;
|
|
168
|
+
constructor({ name, module }: {
|
|
169
|
+
name: string;
|
|
170
|
+
module: string;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
export declare const ClassMethodDecoratorContext: InternalType;
|
|
174
|
+
export declare class AnyPType extends PType {
|
|
175
|
+
get wtype(): never;
|
|
176
|
+
readonly name = "any";
|
|
177
|
+
readonly module = "lib.d.ts";
|
|
178
|
+
readonly singleton = false;
|
|
179
|
+
}
|
|
180
|
+
export declare class InstanceType extends PType {
|
|
181
|
+
readonly wtype: wtypes.WType;
|
|
182
|
+
readonly name: string;
|
|
183
|
+
readonly module: string;
|
|
184
|
+
readonly singleton = false;
|
|
185
|
+
constructor({ name, module, wtype }: {
|
|
186
|
+
name: string;
|
|
187
|
+
module: string;
|
|
188
|
+
wtype: wtypes.WType;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export declare class LibFunctionType extends PType {
|
|
192
|
+
readonly wtype: undefined;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly module: string;
|
|
195
|
+
readonly singleton = true;
|
|
196
|
+
constructor({ name, module }: {
|
|
197
|
+
name: string;
|
|
198
|
+
module: string;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
export declare class IntrinsicFunctionGroupType extends PType {
|
|
202
|
+
readonly wtype: undefined;
|
|
203
|
+
readonly name: string;
|
|
204
|
+
readonly module: string;
|
|
205
|
+
readonly singleton = true;
|
|
206
|
+
constructor({ name }: {
|
|
207
|
+
name: string;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
export declare class IntrinsicFunctionType extends PType {
|
|
211
|
+
readonly wtype: undefined;
|
|
212
|
+
readonly name: string;
|
|
213
|
+
readonly module: string;
|
|
214
|
+
readonly singleton = true;
|
|
215
|
+
constructor({ name }: {
|
|
216
|
+
name: string;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
export declare class NamespacePType extends PType {
|
|
220
|
+
readonly wtype: undefined;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
readonly factory: undefined;
|
|
223
|
+
readonly module: string;
|
|
224
|
+
readonly singleton = true;
|
|
225
|
+
constructor({ name, module }: {
|
|
226
|
+
name: string;
|
|
227
|
+
module: string;
|
|
228
|
+
});
|
|
229
|
+
get fullName(): string;
|
|
230
|
+
toString(): string;
|
|
231
|
+
}
|
|
232
|
+
export declare class FunctionPType extends PType {
|
|
233
|
+
readonly wtype: undefined;
|
|
234
|
+
readonly name: string;
|
|
235
|
+
readonly module: string;
|
|
236
|
+
readonly returnType: PType;
|
|
237
|
+
readonly parameters: Array<readonly [string, PType]>;
|
|
238
|
+
readonly singleton = true;
|
|
239
|
+
constructor(props: {
|
|
240
|
+
name: string;
|
|
241
|
+
module: string;
|
|
242
|
+
returnType: PType;
|
|
243
|
+
parameters: Array<readonly [string, PType]>;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
export declare class ArrayLiteralPType extends TransientType {
|
|
247
|
+
get fullName(): string;
|
|
248
|
+
readonly items: PType[];
|
|
249
|
+
readonly immutable = true;
|
|
250
|
+
constructor(props: {
|
|
251
|
+
items: PType[];
|
|
252
|
+
});
|
|
253
|
+
getArrayType(): ArrayPType;
|
|
254
|
+
getTupleType(): TuplePType;
|
|
255
|
+
}
|
|
256
|
+
export declare class TuplePType extends PType {
|
|
257
|
+
readonly module: string;
|
|
258
|
+
get name(): string;
|
|
259
|
+
get fullName(): string;
|
|
260
|
+
readonly items: PType[];
|
|
261
|
+
readonly singleton = false;
|
|
262
|
+
readonly immutable: boolean;
|
|
263
|
+
constructor(props: {
|
|
264
|
+
items: PType[];
|
|
265
|
+
immutable?: boolean;
|
|
266
|
+
});
|
|
267
|
+
get wtype(): WTuple;
|
|
268
|
+
}
|
|
269
|
+
export declare class ArrayPType extends TransientType {
|
|
270
|
+
readonly itemType: PType;
|
|
271
|
+
readonly immutable: boolean;
|
|
272
|
+
get fullName(): string;
|
|
273
|
+
constructor(props: {
|
|
274
|
+
itemType: PType;
|
|
275
|
+
immutable: boolean;
|
|
276
|
+
});
|
|
277
|
+
get wtype(): wtypes.WArray;
|
|
278
|
+
}
|
|
279
|
+
export declare class ObjectPType extends PType {
|
|
280
|
+
#private;
|
|
281
|
+
readonly module: string;
|
|
282
|
+
readonly properties: Record<string, PType>;
|
|
283
|
+
readonly singleton = false;
|
|
284
|
+
constructor(props: {
|
|
285
|
+
module?: string;
|
|
286
|
+
name?: string;
|
|
287
|
+
properties: Record<string, PType>;
|
|
288
|
+
});
|
|
289
|
+
static anonymous(props: Record<string, PType> | Array<[string, PType]>): ObjectPType;
|
|
290
|
+
get wtype(): WTuple;
|
|
291
|
+
orderedProperties(): [string, PType][];
|
|
292
|
+
getPropertyType(name: string): PType;
|
|
293
|
+
hasProperty(name: string): boolean;
|
|
294
|
+
hasPropertyOfType(name: string, type: PType): boolean;
|
|
295
|
+
get name(): string;
|
|
296
|
+
get fullName(): string;
|
|
297
|
+
}
|
|
298
|
+
export declare const voidPType: InstanceType;
|
|
299
|
+
export declare const neverPType: InstanceType;
|
|
300
|
+
export declare const unknownPType: UnsupportedType;
|
|
301
|
+
export declare const nullPType: UnsupportedType;
|
|
302
|
+
export declare const undefinedPType: UnsupportedType;
|
|
303
|
+
export declare const anyPType: AnyPType;
|
|
304
|
+
export declare const boolPType: InstanceType;
|
|
305
|
+
export declare const BooleanFunction: LibFunctionType;
|
|
306
|
+
export declare class NativeNumericType extends TransientType {
|
|
307
|
+
}
|
|
308
|
+
export declare const bigIntPType: NativeNumericType;
|
|
309
|
+
export declare const stringPType: InstanceType;
|
|
310
|
+
export declare const StringFunction: LibFunctionType;
|
|
311
|
+
export declare const uint64PType: InstanceType;
|
|
312
|
+
export declare const biguintPType: InstanceType;
|
|
313
|
+
export declare class NumericLiteralPType extends NativeNumericType {
|
|
314
|
+
readonly literalValue: bigint;
|
|
315
|
+
constructor({ literalValue }: {
|
|
316
|
+
literalValue: bigint;
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
export declare class BigIntLiteralPType extends NativeNumericType {
|
|
320
|
+
readonly literalValue: bigint;
|
|
321
|
+
constructor({ literalValue }: {
|
|
322
|
+
literalValue: bigint;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
export declare const numberPType: NativeNumericType;
|
|
326
|
+
export declare const Uint64Function: LibFunctionType;
|
|
327
|
+
export declare const BigUintFunction: LibFunctionType;
|
|
328
|
+
export declare const bytesPType: InstanceType;
|
|
329
|
+
export declare const BytesFunction: LibFunctionType;
|
|
330
|
+
export declare const logFunction: LibFunctionType;
|
|
331
|
+
export declare const assertFunction: LibFunctionType;
|
|
332
|
+
export declare const errFunction: LibFunctionType;
|
|
333
|
+
export declare const assetPType: InstanceType;
|
|
334
|
+
export declare const AssetFunction: LibFunctionType;
|
|
335
|
+
export declare const accountPType: InstanceType;
|
|
336
|
+
export declare const AccountFunction: LibFunctionType;
|
|
337
|
+
export declare const applicationPType: InstanceType;
|
|
338
|
+
export declare const ApplicationFunctionType: LibFunctionType;
|
|
339
|
+
export declare const GlobalStateFunction: LibFunctionType;
|
|
340
|
+
export declare const LocalStateFunction: LibFunctionType;
|
|
341
|
+
export declare const BoxFunction: LibFunctionType;
|
|
342
|
+
export declare const BoxMapFunction: LibFunctionType;
|
|
343
|
+
export declare const BoxRefFunction: LibFunctionType;
|
|
344
|
+
export declare const boxRefType: BoxRefPType;
|
|
345
|
+
export declare const ClearStateProgram: FunctionPType;
|
|
346
|
+
export declare const ApprovalProgram: FunctionPType;
|
|
347
|
+
export declare const baseContractType: BaseContractClassType;
|
|
348
|
+
export declare const arc4BaseContractType: BaseContractClassType;
|
|
349
|
+
export declare const arc4BareMethodDecorator: LibFunctionType;
|
|
350
|
+
export declare const arc4AbiMethodDecorator: LibFunctionType;
|
|
351
|
+
export declare class GroupTransactionPType extends PType {
|
|
352
|
+
get wtype(): wtypes.WGroupTransaction;
|
|
353
|
+
readonly name: string;
|
|
354
|
+
readonly kind: TransactionKind | undefined;
|
|
355
|
+
readonly module: "@algorandfoundation/algorand-typescript/gtxn.d.ts";
|
|
356
|
+
readonly singleton = false;
|
|
357
|
+
constructor({ kind, name }: {
|
|
358
|
+
kind?: TransactionKind;
|
|
359
|
+
name: string;
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
export declare class TransactionFunctionType extends LibFunctionType {
|
|
363
|
+
readonly kind: TransactionKind | undefined;
|
|
364
|
+
constructor({ name, module, kind }: {
|
|
365
|
+
name: string;
|
|
366
|
+
module: string;
|
|
367
|
+
kind: TransactionKind | undefined;
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
export declare const paymentGtxnType: GroupTransactionPType;
|
|
371
|
+
export declare const PaymentTxnFunction: TransactionFunctionType;
|
|
372
|
+
export declare const keyRegistrationGtxnType: GroupTransactionPType;
|
|
373
|
+
export declare const KeyRegistrationTxnFunction: TransactionFunctionType;
|
|
374
|
+
export declare const assetConfigGtxnType: GroupTransactionPType;
|
|
375
|
+
export declare const AssetConfigTxnFunction: TransactionFunctionType;
|
|
376
|
+
export declare const assetTransferGtxnType: GroupTransactionPType;
|
|
377
|
+
export declare const AssetTransferTxnFunction: TransactionFunctionType;
|
|
378
|
+
export declare const assetFreezeGtxnType: GroupTransactionPType;
|
|
379
|
+
export declare const AssetFreezeTxnFunction: TransactionFunctionType;
|
|
380
|
+
export declare const applicationCallGtxnType: GroupTransactionPType;
|
|
381
|
+
export declare const ApplicationTxnFunction: TransactionFunctionType;
|
|
382
|
+
export declare const anyGtxnType: GroupTransactionPType;
|
|
383
|
+
export declare const TransactionFunction: TransactionFunctionType;
|
|
384
|
+
export declare const assertMatchFunction: LibFunctionType;
|
|
385
|
+
export declare class Uint64EnumMemberType extends PType {
|
|
386
|
+
readonly wtype: wtypes.WType;
|
|
387
|
+
readonly name: string;
|
|
388
|
+
readonly module: string;
|
|
389
|
+
readonly singleton = false;
|
|
390
|
+
readonly enumType: Uint64EnumType;
|
|
391
|
+
constructor(enumType: Uint64EnumType);
|
|
392
|
+
}
|
|
393
|
+
export declare class Uint64EnumType extends PType {
|
|
394
|
+
get memberType(): Uint64EnumMemberType;
|
|
395
|
+
readonly wtype: wtypes.WType;
|
|
396
|
+
readonly name: string;
|
|
397
|
+
readonly module: string;
|
|
398
|
+
readonly singleton = true;
|
|
399
|
+
readonly members: Record<string, bigint>;
|
|
400
|
+
constructor(props: {
|
|
401
|
+
name: string;
|
|
402
|
+
module: string;
|
|
403
|
+
members: Record<string, bigint>;
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
export declare const transactionTypeType: Uint64EnumType;
|
|
407
|
+
export declare const onCompleteActionType: Uint64EnumType;
|
|
408
|
+
export declare const ensureBudgetFunction: LibFunctionType;
|
|
409
|
+
export declare const opUpFeeSourceType: Uint64EnumType;
|
|
410
|
+
export declare const urangeFunction: LibFunctionType;
|
|
411
|
+
export declare class IterableIteratorType extends TransientType {
|
|
412
|
+
readonly itemType: PType;
|
|
413
|
+
constructor({ itemType }: {
|
|
414
|
+
itemType: PType;
|
|
415
|
+
});
|
|
416
|
+
static readonly baseName = "IterableIterator";
|
|
417
|
+
static readonly moduleName = "typescript/lib/lib.es2015.iterable.d.ts";
|
|
418
|
+
static readonly baseFullName: string;
|
|
419
|
+
get fullName(): string;
|
|
420
|
+
static parameterise(typeArgs: PType[]): IterableIteratorType;
|
|
421
|
+
get wtype(): WEnumeration;
|
|
422
|
+
getGenericArgs(): PType[];
|
|
423
|
+
}
|
|
424
|
+
export declare const paymentItxnFn: TransactionFunctionType;
|
|
425
|
+
export declare const keyRegistrationItxnFn: TransactionFunctionType;
|
|
426
|
+
export declare const assetConfigItxnFn: TransactionFunctionType;
|
|
427
|
+
export declare const assetTransferItxnFn: TransactionFunctionType;
|
|
428
|
+
export declare const assetFreezeItxnFn: TransactionFunctionType;
|
|
429
|
+
export declare const applicationCallItxnFn: TransactionFunctionType;
|
|
430
|
+
export declare class InnerTransactionPType extends PType {
|
|
431
|
+
get wtype(): wtypes.WInnerTransaction;
|
|
432
|
+
readonly name: string;
|
|
433
|
+
readonly kind: TransactionKind | undefined;
|
|
434
|
+
readonly module: "@algorandfoundation/algorand-typescript/itxn.d.ts";
|
|
435
|
+
readonly singleton = false;
|
|
436
|
+
constructor({ kind, name }: {
|
|
437
|
+
kind?: TransactionKind;
|
|
438
|
+
name: string;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
export declare class ItxnParamsPType extends PType {
|
|
442
|
+
get wtype(): wtypes.WInnerTransactionFields;
|
|
443
|
+
readonly name: string;
|
|
444
|
+
readonly kind: TransactionKind | undefined;
|
|
445
|
+
readonly module: "@algorandfoundation/algorand-typescript/itxn.d.ts";
|
|
446
|
+
readonly singleton = false;
|
|
447
|
+
constructor({ kind, name }: {
|
|
448
|
+
kind?: TransactionKind;
|
|
449
|
+
name: string;
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
export declare const paymentItxnParamsType: ItxnParamsPType;
|
|
453
|
+
export declare const paymentItxnType: InnerTransactionPType;
|
|
454
|
+
export declare const keyRegistrationItxnParamsType: ItxnParamsPType;
|
|
455
|
+
export declare const keyRegistrationItxnType: InnerTransactionPType;
|
|
456
|
+
export declare const assetConfigItxnParamsType: ItxnParamsPType;
|
|
457
|
+
export declare const assetConfigItxnType: InnerTransactionPType;
|
|
458
|
+
export declare const assetTransferItxnParamsType: ItxnParamsPType;
|
|
459
|
+
export declare const assetTransferItxnType: InnerTransactionPType;
|
|
460
|
+
export declare const assetFreezeItxnParamsType: ItxnParamsPType;
|
|
461
|
+
export declare const assetFreezeItxnType: InnerTransactionPType;
|
|
462
|
+
export declare const applicationCallItxnParamsType: ItxnParamsPType;
|
|
463
|
+
export declare const applicationItxnType: InnerTransactionPType;
|
|
464
|
+
export declare const submitGroupItxnFunction: LibFunctionType;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PType } from './base';
|
|
2
|
+
export declare class IntrinsicEnumType extends PType {
|
|
3
|
+
readonly wtype: undefined;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly factory: undefined;
|
|
6
|
+
readonly module: string;
|
|
7
|
+
readonly members: Array<[string, string]>;
|
|
8
|
+
readonly singleton = true;
|
|
9
|
+
constructor({ name, module, members }: {
|
|
10
|
+
name: string;
|
|
11
|
+
module: string;
|
|
12
|
+
members: Array<[string, string]>;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IntrinsicEnumType } from './intrinsic-enum-type';
|
|
2
|
+
export declare const base64PType: IntrinsicEnumType;
|
|
3
|
+
export declare const ecPType: IntrinsicEnumType;
|
|
4
|
+
export declare const ecdsaPType: IntrinsicEnumType;
|
|
5
|
+
export declare const vrfVerifyPType: IntrinsicEnumType;
|
|
6
|
+
export declare const ALL_OP_ENUMS: IntrinsicEnumType[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const transientTypeErrors: {
|
|
2
|
+
arrays: (typeName: string) => {
|
|
3
|
+
usedAsType: string;
|
|
4
|
+
usedInExpression: string;
|
|
5
|
+
};
|
|
6
|
+
nativeNumeric: (typeName: string) => {
|
|
7
|
+
usedAsType: string;
|
|
8
|
+
usedInExpression: string;
|
|
9
|
+
};
|
|
10
|
+
unionTypes: (typeName: string) => {
|
|
11
|
+
usedAsType: string;
|
|
12
|
+
usedInExpression: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import type * as awst from '../awst/nodes';
|
|
3
|
+
import type { ModuleStatements } from '../visitor/syntax-names';
|
|
4
|
+
import type { Visitor } from '../visitor/visitor';
|
|
5
|
+
import { BaseVisitor } from './base-visitor';
|
|
6
|
+
import type { AwstBuildContext } from './context/awst-build-context';
|
|
7
|
+
type NodeOrDeferred = awst.AWST[] | awst.AWST | (() => awst.AWST[] | awst.AWST);
|
|
8
|
+
export declare class SourceFileVisitor extends BaseVisitor implements Visitor<ModuleStatements, NodeOrDeferred> {
|
|
9
|
+
private _moduleStatements;
|
|
10
|
+
private accept;
|
|
11
|
+
constructor(context: AwstBuildContext, sourceFile: ts.SourceFile);
|
|
12
|
+
visitInterfaceDeclaration(node: ts.InterfaceDeclaration): NodeOrDeferred;
|
|
13
|
+
visitTypeAliasDeclaration(_node: ts.TypeAliasDeclaration): NodeOrDeferred;
|
|
14
|
+
visitFunctionDeclaration(node: ts.FunctionDeclaration): NodeOrDeferred;
|
|
15
|
+
buildModule(): awst.AWST[];
|
|
16
|
+
private gatherStatements;
|
|
17
|
+
visitVariableStatement(node: ts.VariableStatement): NodeOrDeferred;
|
|
18
|
+
visitImportDeclaration(_node: ts.ImportDeclaration): NodeOrDeferred;
|
|
19
|
+
visitClassDeclaration(node: ts.ClassDeclaration): NodeOrDeferred;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type ts from 'typescript';
|
|
2
|
+
import * as awst from '../awst/nodes';
|
|
3
|
+
import type { AwstBuildContext } from './context/awst-build-context';
|
|
4
|
+
import { FunctionVisitor } from './function-visitor';
|
|
5
|
+
export declare class SubroutineVisitor extends FunctionVisitor {
|
|
6
|
+
private readonly _result;
|
|
7
|
+
constructor(ctx: AwstBuildContext, node: ts.FunctionDeclaration);
|
|
8
|
+
get result(): awst.Subroutine;
|
|
9
|
+
static buildSubroutine(parentCtx: AwstBuildContext, node: ts.FunctionDeclaration): awst.Subroutine;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as ts from 'typescript';
|
|
2
|
+
import type { Visitor } from '../visitor/visitor';
|
|
3
|
+
import type { AwstBuildContext } from './context/awst-build-context';
|
|
4
|
+
type ObjectNames = ts.PropertyName | ts.PseudoLiteralToken;
|
|
5
|
+
export declare class TextVisitor implements Visitor<ObjectNames, string> {
|
|
6
|
+
context: AwstBuildContext;
|
|
7
|
+
constructor(context: AwstBuildContext);
|
|
8
|
+
visitBigIntLiteral(node: ts.BigIntLiteral): string;
|
|
9
|
+
visitTemplateHead(node: ts.TemplateHead): string;
|
|
10
|
+
visitTemplateMiddle(node: ts.TemplateMiddle): string;
|
|
11
|
+
visitTemplateTail(node: ts.TemplateTail): string;
|
|
12
|
+
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>>>, TextVisitor>;
|
|
13
|
+
visitIdentifier(node: ts.Identifier): string;
|
|
14
|
+
visitNoSubstitutionTemplateLiteral(node: ts.NoSubstitutionTemplateLiteral): string;
|
|
15
|
+
visitNumericLiteral(node: ts.NumericLiteral): string;
|
|
16
|
+
visitComputedPropertyName(node: ts.ComputedPropertyName): string;
|
|
17
|
+
visitPrivateIdentifier(node: ts.PrivateIdentifier): string;
|
|
18
|
+
visitStringLiteral(node: ts.StringLiteral): string;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { awst } from '../awst';
|
|
2
|
+
import type { SourceLocation } from '../awst/source-location';
|
|
3
|
+
import type { DeliberateAny } from '../typescript-helpers';
|
|
4
|
+
import type { InstanceBuilder, InstanceExpressionBuilder, NodeBuilder } from './eb';
|
|
5
|
+
import { PType } from './ptypes';
|
|
6
|
+
import type { SymbolName } from './symbol-name';
|
|
7
|
+
type ValueExpressionBuilderCtor<TPType extends PType> = {
|
|
8
|
+
new (expr: awst.Expression, ptype: PType): InstanceExpressionBuilder<TPType>;
|
|
9
|
+
};
|
|
10
|
+
type SingletonExpressionBuilderCtor = {
|
|
11
|
+
new (sourceLocation: SourceLocation, ptype: PType): NodeBuilder;
|
|
12
|
+
};
|
|
13
|
+
type PTypeClass = {
|
|
14
|
+
new (...args: DeliberateAny): PType;
|
|
15
|
+
};
|
|
16
|
+
type GenericPTypeClass = {
|
|
17
|
+
new (...args: DeliberateAny): PType;
|
|
18
|
+
get baseFullName(): string;
|
|
19
|
+
parameterise(typeArgs: PType[]): PType;
|
|
20
|
+
};
|
|
21
|
+
export declare class TypeRegistry {
|
|
22
|
+
get hasRegistrations(): boolean;
|
|
23
|
+
private readonly singletonEbs;
|
|
24
|
+
private readonly instanceEbs;
|
|
25
|
+
private readonly types;
|
|
26
|
+
private readonly genericTypes;
|
|
27
|
+
register({ ptype, singletonEb, instanceEb, }: {
|
|
28
|
+
ptype: PType | PTypeClass;
|
|
29
|
+
singletonEb: SingletonExpressionBuilderCtor;
|
|
30
|
+
instanceEb?: undefined;
|
|
31
|
+
} | {
|
|
32
|
+
ptype: PType | PTypeClass;
|
|
33
|
+
singletonEb?: undefined;
|
|
34
|
+
instanceEb: ValueExpressionBuilderCtor<PType>;
|
|
35
|
+
}): void;
|
|
36
|
+
registerGeneric({ ptype, instanceEb }: {
|
|
37
|
+
ptype: GenericPTypeClass;
|
|
38
|
+
instanceEb: ValueExpressionBuilderCtor<PType>;
|
|
39
|
+
}): void;
|
|
40
|
+
isGeneric(ptype: PType): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Try to resolve a symbol name to a singleton ptype
|
|
43
|
+
* @param symbolName The name of the symbol
|
|
44
|
+
*/
|
|
45
|
+
tryResolveSingletonName(symbolName: SymbolName): PType | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Try to resolve a symbol name to an instance ptype
|
|
48
|
+
* @param symbolName The name of the symbol
|
|
49
|
+
*/
|
|
50
|
+
tryResolveInstancePType(symbolName: SymbolName): PType | undefined;
|
|
51
|
+
resolveInstancePType(symbolName: SymbolName, sourceLocation: SourceLocation): PType;
|
|
52
|
+
tryGetSingletonEb(ptype: PType, sourceLocation: SourceLocation): NodeBuilder | undefined;
|
|
53
|
+
getSingletonEb(ptype: PType, sourceLocation: SourceLocation): NodeBuilder;
|
|
54
|
+
getInstanceEb(expression: awst.Expression, ptype: PType): InstanceBuilder;
|
|
55
|
+
tryGetInstanceEb(expression: awst.Expression, ptype: PType): InstanceBuilder | undefined;
|
|
56
|
+
resolveGenericPType(symbolName: SymbolName, typeArgs: PType[], sourceLocation: SourceLocation): PType;
|
|
57
|
+
tryResolveGenericPType(symbolName: SymbolName, typeArgs: PType[]): PType | undefined;
|
|
58
|
+
}
|
|
59
|
+
export declare const typeRegistry: TypeRegistry;
|
|
60
|
+
export declare function instanceEb(expr: awst.Expression, ptype: PType): InstanceBuilder<PType>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import type { SourceLocation } from '../awst/source-location';
|
|
3
|
+
import type { PType } from './ptypes';
|
|
4
|
+
export declare class TypeResolver {
|
|
5
|
+
private readonly checker;
|
|
6
|
+
private readonly programDirectory;
|
|
7
|
+
constructor(checker: ts.TypeChecker, programDirectory: string);
|
|
8
|
+
private getUnaliasedSymbolForNode;
|
|
9
|
+
resolveTypeParameters(node: ts.CallExpression, sourceLocation: SourceLocation): PType[];
|
|
10
|
+
resolve(node: ts.Node, sourceLocation: SourceLocation): PType;
|
|
11
|
+
resolveTypeNode(node: ts.TypeNode, sourceLocation: SourceLocation): PType;
|
|
12
|
+
resolveType(tsType: ts.Type, sourceLocation: SourceLocation): PType;
|
|
13
|
+
private reflectObjectType;
|
|
14
|
+
private reflectFunctionType;
|
|
15
|
+
private reflectContractType;
|
|
16
|
+
private getTypeName;
|
|
17
|
+
private getSymbolFullName;
|
|
18
|
+
}
|
package/bin/run-cli.d.ts
ADDED
package/bin/run-cli.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '../cli.mjs';
|
|
3
|
+
import 'commander';
|
|
4
|
+
import 'zod';
|
|
5
|
+
import 'glob';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'upath';
|
|
8
|
+
import '../index-GbFBpbmB.js';
|
|
9
|
+
import 'change-case';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import 'node:buffer';
|
|
12
|
+
import 'node:util';
|
|
13
|
+
import 'chalk';
|
|
14
|
+
import 'polytype';
|
|
15
|
+
import 'typescript';
|
|
16
|
+
import 'tslib';
|
|
17
|
+
import 'crypto';
|
|
18
|
+
import 'fs';
|
|
19
|
+
import 'os';
|
|
20
|
+
import 'cross-spawn';
|
|
21
|
+
//# sourceMappingURL=run-cli.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-cli.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
package/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|