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