@typemove/move 1.14.0-rc.1 → 2.0.0-rc.1

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 (52) hide show
  1. package/package.json +2 -2
  2. package/dist/esm/abstract-move-coder.d.ts +0 -30
  3. package/dist/esm/abstract-move-coder.d.ts.map +0 -1
  4. package/dist/esm/abstract-move-coder.js +0 -308
  5. package/dist/esm/abstract-move-coder.js.map +0 -1
  6. package/dist/esm/account.d.ts +0 -16
  7. package/dist/esm/account.d.ts.map +0 -1
  8. package/dist/esm/account.js +0 -71
  9. package/dist/esm/account.js.map +0 -1
  10. package/dist/esm/chain-adapter.d.ts +0 -13
  11. package/dist/esm/chain-adapter.d.ts.map +0 -1
  12. package/dist/esm/chain-adapter.js +0 -3
  13. package/dist/esm/chain-adapter.js.map +0 -1
  14. package/dist/esm/codegen/abstract-codegen.d.ts +0 -52
  15. package/dist/esm/codegen/abstract-codegen.d.ts.map +0 -1
  16. package/dist/esm/codegen/abstract-codegen.js +0 -465
  17. package/dist/esm/codegen/abstract-codegen.js.map +0 -1
  18. package/dist/esm/codegen/index.d.ts +0 -2
  19. package/dist/esm/codegen/index.d.ts.map +0 -1
  20. package/dist/esm/codegen/index.js +0 -2
  21. package/dist/esm/codegen/index.js.map +0 -1
  22. package/dist/esm/index.d.ts +0 -7
  23. package/dist/esm/index.d.ts.map +0 -1
  24. package/dist/esm/index.js +0 -7
  25. package/dist/esm/index.js.map +0 -1
  26. package/dist/esm/internal-models.d.ts +0 -46
  27. package/dist/esm/internal-models.d.ts.map +0 -1
  28. package/dist/esm/internal-models.js +0 -7
  29. package/dist/esm/internal-models.js.map +0 -1
  30. package/dist/esm/ts-type.test.d.ts +0 -2
  31. package/dist/esm/ts-type.test.d.ts.map +0 -1
  32. package/dist/esm/ts-type.test.js.map +0 -1
  33. package/dist/esm/types.d.ts +0 -52
  34. package/dist/esm/types.d.ts.map +0 -1
  35. package/dist/esm/types.js +0 -317
  36. package/dist/esm/types.js.map +0 -1
  37. package/dist/esm/utils.d.ts +0 -17
  38. package/dist/esm/utils.d.ts.map +0 -1
  39. package/dist/esm/utils.js +0 -127
  40. package/dist/esm/utils.js.map +0 -1
  41. package/dist/esm/utils.test.d.ts +0 -2
  42. package/dist/esm/utils.test.d.ts.map +0 -1
  43. package/dist/esm/utils.test.js.map +0 -1
  44. package/src/abstract-move-coder.ts +0 -347
  45. package/src/account.ts +0 -81
  46. package/src/chain-adapter.ts +0 -26
  47. package/src/codegen/abstract-codegen.ts +0 -579
  48. package/src/codegen/index.ts +0 -1
  49. package/src/index.ts +0 -6
  50. package/src/internal-models.ts +0 -52
  51. package/src/types.ts +0 -362
  52. package/src/utils.ts +0 -144
@@ -1,579 +0,0 @@
1
- import { InternalMoveEnum, InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from '../internal-models.js'
2
- import path from 'path'
3
- import fs from 'fs'
4
- import { AccountModulesImportInfo, AccountRegister } from '../account.js'
5
- import { format } from 'prettier'
6
- import { isFrameworkAccount, moduleQname, normalizeToJSName, SPLITTER, VECTOR_STR } from '../utils.js'
7
- import { TypeDescriptor } from '../types.js'
8
- import { ChainAdapter } from '../chain-adapter.js'
9
-
10
- interface OutputFile {
11
- fileName: string
12
- fileContent: string
13
- }
14
-
15
- interface Config {
16
- fileName: string
17
- outputDir: string
18
- // network: NetworkType
19
- }
20
-
21
- // TODO be able to generate cjs
22
- export abstract class AbstractCodegen<ModuleTypes, StructType> {
23
- ADDRESS_TYPE: string
24
- SYSTEM_PACKAGE: string
25
- PREFIX: string
26
- STRUCT_FIELD_NAME: string = 'data'
27
- PAYLOAD_OPTIONAL = false
28
- SYSTEM_MODULES = new Set(['0x1', '0x2', '0x3', '0x4'])
29
- ESM = true
30
-
31
- chainAdapter: ChainAdapter<ModuleTypes, StructType>
32
-
33
- protected constructor(chainAdapter: ChainAdapter<ModuleTypes, StructType>) {
34
- this.chainAdapter = chainAdapter
35
- }
36
-
37
- public maybeEsmPrefix() {
38
- return this.ESM ? '.js' : ''
39
- }
40
-
41
- readModulesFile(fullPath: string) {
42
- return JSON.parse(fs.readFileSync(fullPath, 'utf-8'))
43
- }
44
-
45
- protected defaultCoderPackage() {
46
- return this.SYSTEM_PACKAGE
47
- }
48
-
49
- generateLoadAll(isSystem: boolean): string {
50
- return 'loadAllTypes(defaultMoveCoder())'
51
- }
52
-
53
- async generate(
54
- srcDir: string,
55
- outputDir: string,
56
- // network: NetworkType,
57
- builtin = false
58
- ) {
59
- if (!fs.existsSync(srcDir)) {
60
- return 0
61
- }
62
-
63
- const files = fs.readdirSync(srcDir)
64
- outputDir = path.resolve(outputDir)
65
- const outputs: OutputFile[] = []
66
-
67
- fs.mkdirSync(outputDir, { recursive: true })
68
-
69
- const loader = new AccountRegister()
70
-
71
- // when generating user code, don't need to generate framework account
72
- for (const sysModule of this.SYSTEM_MODULES) {
73
- loader.accountImports.set(sysModule, new AccountModulesImportInfo(sysModule, sysModule))
74
- }
75
- // const client = getRpcClient(network)
76
-
77
- for (const file of files) {
78
- if (!file.endsWith('.json')) {
79
- continue
80
- }
81
- const fullPath = path.resolve(srcDir, file)
82
- const abi = this.readModulesFile(fullPath)
83
- const modules = this.chainAdapter.toInternalModules(abi)
84
-
85
- for (const module of modules) {
86
- loader.register(module, path.basename(file, '.json'))
87
- }
88
-
89
- const fileName = path.basename(file, '.json')
90
- // TODO more reliable way to check if this is sui address
91
- const address = fileName.startsWith('0x') ? fileName : undefined
92
-
93
- const codeGen = new AccountCodegen(
94
- this,
95
- loader,
96
- abi,
97
- modules,
98
- {
99
- fileName,
100
- outputDir: outputDir
101
- // network,
102
- },
103
- address
104
- )
105
-
106
- outputs.push(...codeGen.generate())
107
- }
108
-
109
- while (loader.pendingAccounts.size > 0) {
110
- for (const account of loader.pendingAccounts) {
111
- const id = await this.chainAdapter.getChainId()
112
- console.log(`download dependent module for account ${account}, chain ID: ${id}`)
113
-
114
- try {
115
- const rawModules = await this.chainAdapter.fetchModules(
116
- account
117
- // network
118
- )
119
- const modules = this.chainAdapter.toInternalModules(rawModules)
120
-
121
- fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\t'))
122
- for (const module of modules) {
123
- loader.register(module, account)
124
- }
125
- const codeGen = new AccountCodegen(
126
- this,
127
- loader,
128
- rawModules,
129
- modules,
130
- {
131
- fileName: account,
132
- outputDir: outputDir
133
- // network,
134
- },
135
- account
136
- )
137
-
138
- outputs.push(...codeGen.generate())
139
- } catch (e) {
140
- console.error(
141
- 'Error downloading account module, check if you choose the right network,or download account modules manually into your director'
142
- )
143
- console.error(e)
144
- process.exit(1)
145
- }
146
- }
147
- }
148
-
149
- for (const output of outputs) {
150
- let content = output.fileContent
151
- content = await format(output.fileContent, { parser: 'typescript' })
152
- fs.writeFileSync(path.join(outputDir, output.fileName), content)
153
- }
154
-
155
- const rootFile = path.join(outputDir, 'index.ts')
156
- let rootFileContent = `/* Autogenerated file. Do not edit manually. */
157
- /* tslint:disable */
158
- /* eslint-disable */
159
- `
160
- for (const output of outputs) {
161
- const parsed = path.parse(output.fileName)
162
- rootFileContent += `export * as _${parsed.name.replaceAll('-', '_')} from './${
163
- parsed.name
164
- }${this.maybeEsmPrefix()}'\n`
165
- }
166
- fs.writeFileSync(rootFile, rootFileContent)
167
-
168
- return outputs.length
169
- }
170
-
171
- protected generateExtra(address: string | undefined, module: InternalMoveModule) {
172
- return ''
173
- }
174
-
175
- generateModule(
176
- module: InternalMoveModule,
177
- allEventStructs: Map<string, InternalMoveStruct>,
178
- addressOverride?: string
179
- // network: NetworkType
180
- ) {
181
- const qname = moduleQname(module)
182
- const eventStructs = new Map<string, InternalMoveStruct>()
183
- for (const [type, struct] of allEventStructs.entries()) {
184
- if (type.startsWith(qname + SPLITTER)) {
185
- eventStructs.set(type, struct)
186
- }
187
- }
188
-
189
- const eventTypes = new Set(eventStructs.keys())
190
- const events = Array.from(eventStructs.values())
191
- .map((e) => this.generateForEvents(module, e))
192
- .filter((s) => s !== '')
193
- const enums = module.enums.map((e) => this.generateEnum(module, e))
194
- const structs = module.structs.map((s) => this.generateStructs(module, s, eventTypes))
195
- const callArgs = module.exposedFunctions.map((f) => this.generateCallArgsStructs(module, f))
196
-
197
- const moduleName = normalizeToJSName(module.name)
198
- return `
199
-
200
- export namespace ${moduleName} {
201
- ${enums.join('\n')}
202
-
203
- ${structs.join('\n')}
204
-
205
- ${this.generateExtra(addressOverride, module)}
206
-
207
- ${events.join('\n')}
208
-
209
- ${callArgs.join('\n')}
210
- }
211
- `
212
- }
213
-
214
- generateEnum(module: InternalMoveModule, enumType: InternalMoveEnum): string {
215
- const enumName = normalizeToJSName(enumType.name)
216
- const enumValues = Object.keys(enumType.variants)
217
- .map((v) => `'${v}'`)
218
- .join(' | ')
219
-
220
- const typeParams = enumType.typeParams || []
221
- const genericString = this.generateStructTypeParameters(enumType)
222
- const genericStringAny = this.generateStructTypeParameters(enumType, true)
223
-
224
- const typeParamApplyArg = typeParams
225
- .map((v, idx) => {
226
- return `arg${idx}: TypeDescriptor<T${idx}> = ANY_TYPE`
227
- })
228
- .join(',')
229
- const typeParamApply = typeParams
230
- .map((v, idx) => {
231
- return `arg${idx}`
232
- })
233
- .join(',')
234
-
235
- const typeDescriptor = `
236
- export namespace ${enumName}{
237
- export const TYPE_QNAME = '${module.address}::${module.name}::${enumType.name}'
238
-
239
- const TYPE = new TypeDescriptor<${enumName}${genericStringAny}>(${enumName}.TYPE_QNAME)
240
-
241
- export function type${genericString}(${typeParamApplyArg}): TypeDescriptor<${enumName}${genericString}> {
242
- return TYPE.apply(${typeParamApply})
243
- }
244
- }
245
- `
246
- // TODO support fields
247
- return `
248
- export interface ${enumName}${genericString} {
249
- fields: {}
250
- variant: ${enumValues}
251
- }
252
-
253
- ${typeDescriptor}
254
- `
255
- }
256
-
257
- generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>, typeOnly = false) {
258
- const typeParams = struct.typeParams || []
259
- const genericString = this.generateStructTypeParameters(struct)
260
- const genericStringAny = this.generateStructTypeParameters(struct, true)
261
-
262
- const structName = normalizeToJSName(struct.name)
263
-
264
- const fields = struct.fields.map((field) => {
265
- const type = this.generateTypeForDescriptor(field.type, module.address)
266
- return `${field.name}: ${type}`
267
- })
268
-
269
- const typeParamApplyArg = typeParams
270
- .map((v, idx) => {
271
- return `arg${idx}: TypeDescriptor<T${idx}> = ANY_TYPE`
272
- })
273
- .join(',')
274
- const typeParamApply = typeParams
275
- .map((v, idx) => {
276
- return `arg${idx}`
277
- })
278
- .join(',')
279
-
280
- const typeDescriptor = `
281
- export namespace ${structName}{
282
- export const TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'
283
-
284
- const TYPE = new TypeDescriptor<${structName}${genericStringAny}>(${structName}.TYPE_QNAME)
285
-
286
- export function type${genericString}(${typeParamApplyArg}): TypeDescriptor<${structName}${genericString}> {
287
- return TYPE.apply(${typeParamApply})
288
- }
289
- }
290
- `
291
- if (typeOnly) {
292
- return typeDescriptor
293
- }
294
-
295
- let eventPayload = ''
296
- if (events.has(moduleQname(module) + SPLITTER + struct.name)) {
297
- eventPayload = `
298
- export type ${structName}Instance = TypedEventInstance<${structName}${genericStringAny}> & {
299
- ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}
300
- type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]
301
- }
302
- `
303
- }
304
-
305
- return `
306
- export interface ${structName}${genericString} {
307
- ${fields.join('\n')}
308
- }
309
-
310
- ${typeDescriptor}
311
-
312
- ${eventPayload}
313
- `
314
- }
315
-
316
- generateFunctionTypeParameters(func: InternalMoveFunction) {
317
- let genericString = ''
318
- if (func.typeParams && func.typeParams.length > 0) {
319
- const params = func.typeParams
320
- .map((v, idx) => {
321
- return `T${idx}=any`
322
- })
323
- .join(',')
324
- genericString = `<${params}>`
325
- }
326
- return genericString
327
- }
328
-
329
- generateFunctionReturnTypeParameters(func: InternalMoveFunction, currentAddress: string) {
330
- let returnType = ''
331
- if (func.return && func.return.length > 0) {
332
- returnType = func.return
333
- .map((v, idx) => {
334
- return this.generateTypeForDescriptor(v, currentAddress)
335
- })
336
- .join(',')
337
- }
338
- return '[' + returnType + ']'
339
- }
340
-
341
- generateStructTypeParameters(struct: InternalMoveStruct | InternalMoveEnum, useAny = false) {
342
- let genericString = ''
343
-
344
- if (struct.typeParams && struct.typeParams.length > 0) {
345
- const params = struct.typeParams
346
- .map((v, idx) => {
347
- return useAny ? 'any' : 'T' + idx
348
- })
349
- .join(',')
350
- genericString = `<${params}>`
351
- }
352
- return genericString
353
- }
354
-
355
- // generateTypeParameters(struct: TypeDescriptor, useAny = false) {
356
- // let genericString = ''
357
- //
358
- // if (struct.typeArgs && struct.typeArgs.length > 0) {
359
- // const params = struct.typeArgs
360
- // .map((_, idx) => {
361
- // return useAny ? 'any' : 'T' + idx
362
- // })
363
- // .join(',')
364
- // genericString = `<${params}>`
365
- // }
366
- // return genericString
367
- // }
368
-
369
- generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction) {
370
- return ''
371
- }
372
-
373
- generateForEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {
374
- return ''
375
- }
376
-
377
- generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string): string {
378
- if (type.reference) {
379
- return this.ADDRESS_TYPE
380
- }
381
-
382
- // Aptos Move closure / function-value types (qname sentinel set by parseMoveType).
383
- // Move closures don't have a JSON-serializable runtime shape, so we emit unknown.
384
- if (type.qname.startsWith('|')) {
385
- return 'unknown'
386
- }
387
-
388
- switch (type.qname) {
389
- case 'signer': // TODO check this
390
- case 'address':
391
- case 'Address':
392
- return this.ADDRESS_TYPE
393
- case '0x1::string::String':
394
- return 'string'
395
- case 'bool':
396
- case 'Bool':
397
- return 'boolean'
398
- case 'u8':
399
- case 'U8':
400
- case 'u16':
401
- case 'U16':
402
- case 'u32':
403
- case 'U32':
404
- return 'number'
405
- case 'u64':
406
- case 'U64':
407
- case 'u128':
408
- case 'U128':
409
- case 'u256':
410
- case 'U256':
411
- return 'bigint'
412
- }
413
-
414
- if (type.qname.toLowerCase() === VECTOR_STR) {
415
- // vector<u8> as hex string
416
- const elementTypeQname = type.typeArgs[0].qname
417
- if (elementTypeQname === 'u8') {
418
- // only for aptos
419
- return 'string'
420
- }
421
- // if (elementTypeQname.startsWith('T') && !elementTypeQname.includes(SPLITTER)) {
422
- // return `${elementTypeQname} extends string ? string : ${elementTypeQname}[]`
423
- // }
424
- // TODO there might be an error here, find the case and get it fixed
425
- if (elementTypeQname.startsWith('T') && !elementTypeQname.includes(SPLITTER)) {
426
- return `${elementTypeQname}[]`
427
- }
428
- return this.generateTypeForDescriptor(type.typeArgs[0], currentAddress) + '[]'
429
- }
430
-
431
- const simpleName = this.generateSimpleType(type.qname, currentAddress)
432
- if (simpleName.length === 0) {
433
- console.error('unexpected error')
434
- }
435
- if (simpleName.toLowerCase() === VECTOR_STR || simpleName.toLowerCase().startsWith(VECTOR_STR + SPLITTER)) {
436
- console.error('unexpected vector type error')
437
- }
438
- if (type.typeArgs.length > 0) {
439
- // return simpleName
440
- return (
441
- simpleName + '<' + type.typeArgs.map((t) => this.generateTypeForDescriptor(t, currentAddress)).join(',') + '>'
442
- )
443
- }
444
- return simpleName
445
- }
446
-
447
- generateSimpleType(type: string, currentAddress: string): string {
448
- const parts = type.split(SPLITTER)
449
-
450
- for (let i = 0; i < parts.length; i++) {
451
- parts[i] = normalizeToJSName(parts[i])
452
- }
453
-
454
- if (parts.length < 2) {
455
- return parts[0]
456
- }
457
- if (parts[0] === currentAddress) {
458
- return parts.slice(1).join('.')
459
- }
460
- return '_' + parts.join('.')
461
- }
462
-
463
- generateImports() {
464
- // let refImports = `import { ${this.ADDRESS_TYPE} } from "${this.SYSTEM_PACKAGE}"`
465
- // if (this.ADDRESS_TYPE === 'string') {
466
- // refImports = ''
467
- // }
468
-
469
- const imports = `
470
- import { TypeDescriptor, ANY_TYPE } from "@typemove/move"
471
- import {
472
- MoveCoder, TypedEventInstance } from "@typemove/${this.PREFIX.toLowerCase()}"
473
-
474
- import { defaultMoveCoder } from "${this.defaultCoderPackage()}"
475
-
476
- `
477
- return imports
478
- }
479
- }
480
-
481
- export class AccountCodegen<ModuleType, StructType> {
482
- modules: InternalMoveModule[]
483
- config: Config
484
- abi: ModuleType[]
485
- loader: AccountRegister
486
- moduleGen: AbstractCodegen<ModuleType, StructType>
487
- // Usually it's same as module.address, but in upgraded package, this might be the new address
488
- address?: string
489
-
490
- constructor(
491
- moduleGen: AbstractCodegen<ModuleType, StructType>,
492
- loader: AccountRegister,
493
- abi: ModuleType[],
494
- modules: InternalMoveModule[],
495
- config: Config,
496
- address: string | undefined
497
- ) {
498
- // const json = fs.readFileSync(config.srcFile, 'utf-8')
499
- this.moduleGen = moduleGen
500
- this.abi = abi
501
- this.modules = modules
502
- this.config = config
503
- this.loader = loader
504
- this.address = address
505
- }
506
-
507
- generate(): OutputFile[] {
508
- if (!this.modules) {
509
- return []
510
- }
511
- // const baseName = path.basename(this.config.fileName, '.json')
512
-
513
- let address: string | undefined
514
- for (const module of this.modules) {
515
- address = module.address
516
- }
517
- if (!address) {
518
- return []
519
- }
520
-
521
- const dependedAccounts: string[] = []
522
-
523
- const moduleImports: string[] = []
524
-
525
- const info = this.loader.accountImports.get(address)
526
-
527
- if (info) {
528
- for (const [account] of info.imports.entries()) {
529
- // Remap to user's filename if possible, TODO codepath not well tested
530
- const tsAccountModule = './' + (this.loader.accountImports.get(account)?.moduleName || account)
531
- if (isFrameworkAccount(account) && !isFrameworkAccount(address)) {
532
- // Decide where to find builtin library
533
- moduleImports.push(
534
- `import * as _${account} from "${this.moduleGen.SYSTEM_PACKAGE}/builtin/${account}"`
535
- // `import _${account} = builtin._${account} `
536
- )
537
- } else {
538
- moduleImports.push(`import * as _${account} from "${tsAccountModule}${this.moduleGen.maybeEsmPrefix()}"`)
539
- }
540
-
541
- dependedAccounts.push(account)
542
- }
543
- }
544
-
545
- const eventsMap: Map<string, InternalMoveStruct> = this.moduleGen.chainAdapter.getAllEventStructs(this.modules)
546
-
547
- const source = `
548
- /* Autogenerated file. Do not edit manually. */
549
- /* tslint:disable */
550
- /* eslint-disable */
551
-
552
- /* Generated types for ${this.address || address}, original address ${address} */
553
-
554
- ${this.moduleGen.generateImports()}
555
-
556
- ${moduleImports.join('\n')}
557
-
558
- ${this.modules.map((m) => this.moduleGen.generateModule(m, eventsMap, this.address)).join('\n')}
559
-
560
- const MODULES = JSON.parse('${JSON.stringify(this.abi)}')
561
-
562
- export function loadAllTypes(coder: MoveCoder) {
563
- ${dependedAccounts.map((a) => `_${a}.loadAllTypes(coder)`).join('\n')}
564
- for (const m of Object.values(MODULES)) {
565
- coder.load(m as any, '${address}')
566
- }
567
- }
568
-
569
- ${this.moduleGen.generateLoadAll(this.moduleGen.SYSTEM_MODULES.has(address))}
570
- ` // source
571
-
572
- return [
573
- {
574
- fileName: this.config.fileName + '.ts',
575
- fileContent: source
576
- }
577
- ]
578
- }
579
- }
@@ -1 +0,0 @@
1
- export * from './abstract-codegen.js'
package/src/index.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './types.js'
2
- export * from './utils.js'
3
- export * from './account.js'
4
- export * from './chain-adapter.js'
5
- export * from './abstract-move-coder.js'
6
- export * from './internal-models.js'
@@ -1,52 +0,0 @@
1
- import { TypeDescriptor } from './types.js'
2
-
3
- export interface InternalMoveModule {
4
- address: string
5
- name: string
6
- exposedFunctions: InternalMoveFunction[]
7
- structs: InternalMoveStruct[]
8
- enums: InternalMoveEnum[]
9
- }
10
-
11
- export interface InternalMoveFunction {
12
- name: string
13
- visibility: InternalMoveFunctionVisibility
14
- isEntry: boolean
15
- isView?: boolean
16
- typeParams: InternalMoveTypeParam[]
17
- params: TypeDescriptor[]
18
- return: TypeDescriptor[]
19
- }
20
-
21
- export interface InternalMoveStruct {
22
- name: string
23
- isNative: boolean
24
- isEvent: boolean
25
- abilities: string[]
26
- typeParams: InternalMoveTypeParam[]
27
- fields: InternalMoveStructField[]
28
- }
29
-
30
- export interface InternalMoveEnum {
31
- name: string
32
- abilities: string[]
33
- typeParams: InternalMoveTypeParam[]
34
- variants: {
35
- [key: string]: InternalMoveStructField[]
36
- }
37
- }
38
-
39
- export interface InternalMoveStructField {
40
- name: string
41
- type: TypeDescriptor
42
- }
43
-
44
- export enum InternalMoveFunctionVisibility {
45
- PRIVATE = 'private',
46
- PUBLIC = 'public',
47
- FRIEND = 'friend'
48
- }
49
-
50
- export type InternalMoveTypeParam = {
51
- constraints: string[]
52
- }