@cosmology/ast
Version:
Cosmos TypeScript AST generation
17 lines (16 loc) • 581 B
JavaScript
import * as t from '@babel/types';
import { createProtoType } from './proto';
import { SymbolNames } from '../../types';
export const createSDKType = (context, name, proto) => {
return createProtoType(context, name, proto, 'SDKType');
};
export const createEnumSDKType = (context, name, proto) => {
return t.exportNamedDeclaration(t.variableDeclaration('const', [
t.variableDeclarator(t.identifier(SymbolNames.SDKType(name)), t.identifier(name))
]));
// return createProtoEnum(
// context,
// name + "SDKType",
// proto
// );
};