UNPKG

@cosmology/ast

Version:
42 lines (41 loc) 2.17 kB
import * as t from "@babel/types"; import { ProtoField } from "@cosmology/types"; import { ProtoParseContext } from "../encoding"; declare const BILLION: t.NumericLiteral; export { BILLION }; export declare const cleanComment: (str: any) => any; export declare const makeCommentBlock: (comment: string) => t.CommentBlock; export declare class CommentBlockBuilder { private lines; /** * Add a line to the comment block * If the line contains newlines, it will be split into multiple lines */ addLine(line: string): this; /** * Add multiple lines to the comment block * If any line contains newlines, it will be split into multiple lines */ addLines(lines: string[]): this; /** * Clear all lines from the comment block */ clear(): this; /** * Build the comment block AST node */ build(): t.CommentBlock | null; } export declare const renderNameSafely: (name: any) => any; export declare const getProtoFieldTypeName: (context: ProtoParseContext, field: ProtoField) => any; export declare const recursiveNamespace: (names: any, moduleBlockBody: any) => any; export declare const bindMethod: (name: string) => t.ExpressionStatement; export declare const shorthandProperty: (prop: string) => t.ObjectProperty; export declare const importStmt: (names: string[], path: string) => t.ImportDeclaration; export declare const memberExpressionOrIdentifier: (names: any) => any; export declare const memberExpressionOrIdentifierAminoCasing: (names: any, aminoCasingFn: Function) => any; export declare const memberExpressionOrIdentifierAminoCaseField: (fields: ProtoField[], aminoCaseFunc: Function, useNullHandling?: boolean) => any; export declare const promiseTypeAnnotation: (name: any) => t.TSTypeAnnotation; export declare const getAcceptedInterfacesTypes: (context: ProtoParseContext, lookupInterface: string) => import("@cosmology/types").TraversalSymbol[]; export declare const getSdkFieldName: (fieldName: string, field: ProtoField) => string; export declare const getAminoFieldName: (fieldName: string, field: ProtoField, interfaceName: string, context: ProtoParseContext) => string;