import { ReturnStatement, VariableStatement } from 'typescript';
import { Context } from '../contexts';
import { EmitResult, emit } from './';

export const emitReturnStatement = ({ expression }: ReturnStatement, context: Context): EmitResult => {
  const emit_result = emit(expression, context);
  return {
    ...emit_result,
    emitted_string: `return ${emit_result.emitted_string};`
  };
};

export const emitVariableStatement = ({ declarationList: { declarations } }: VariableStatement, context: Context): EmitResult => {
  const emit_result =
    declarations
      .reduce<EmitResult>(({ context, emitted_string }, node) => {
        const result = emit(node, context);
        result.emitted_string = emitted_string + ';\n  ' + result.emitted_string;
        return result;
      }, { context, emitted_string: '' });
  return {
    ...emit_result,
    emitted_string: `${emit_result.emitted_string};`
  };
};

import { ReturnStatement } from 'typescript';
import { Context } from '../contexts';
import { EmitResult, emit } from './';

export const emitReturnStatement = ({ expression }: ReturnStatement, context: Context): EmitResult => {
  const emit_result = emit(expression, context);
  return {
    ...emit_result,
    emitted_string: `return ${emit_result.emitted_string};`
  };
};

--- 
+++ 
@@ -1,4 +1,4 @@
-import { ReturnStatement } from 'typescript';
+import { ReturnStatement, VariableStatement } from 'typescript';
 import { Context } from '../contexts';
 import { EmitResult, emit } from './';
 
@@ -9,3 +9,17 @@
     emitted_string: `return ${emit_result.emitted_string};`
   };
 };
+
+export const emitVariableStatement = ({ declarationList: { declarations } }: VariableStatement, context: Context): EmitResult => {
+  const emit_result =
+    declarations
+      .reduce<EmitResult>(({ context, emitted_string }, node) => {
+        const result = emit(node, context);
+        result.emitted_string = emitted_string + ';\n  ' + result.emitted_string;
+        return result;
+      }, { context, emitted_string: '' });
+  return {
+    ...emit_result,
+    emitted_string: `${emit_result.emitted_string};`
+  };
+};
Add emit for variable statement
