namespace ts . pxtc . transpile { export interface TranspileCodeResult { outfiles : pxt . Map < string > ; sourceMap : SourceInterval [ ] ; syntaxInfo ? : SyntaxInfo ; globalNames ? : pxt . Map < SymbolInfo > ; } export interface TranspileResult extends TranspileCodeResult { diagnostics : pxtc . KsDiagnostic [ ] ; success : boolean ; } const mainName = ( l ) => `main.${ l }` ; export function pyToTs ( options , filename = mainName ( "py" ) ) { return ( pxt as any ) . py . py2ts ( options ) as TranspileResult ; } export function tsToPy ( program , filename = mainName ( "ts" ) ) { return ( pxt as any ) . py . decompileToPython ( program , filename ) as TranspileResult ; } }