package com.reactlibrary;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import org.tensorflow.Operation;

public class RNTensorflowGraphOperationsModule extends ReactContextBaseJavaModule {

    private Operation graphOperation;

    public RNTensorflowGraphOperationsModule(ReactApplicationContext reactContext) {
        super(reactContext);
    }

    @Override
    public String getName() {
        return "TensorflorGraphOperation";
    }

    @ReactMethod
    public void init(Operation graphOperation) {
        this.graphOperation = graphOperation;
    }

    @ReactMethod
    public void inputListLength(String s, Promise promise) {
        try {
            promise.resolve(graphOperation.inputListLength(s));
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void name(Promise promise) {
        try {
            promise.resolve(graphOperation.name());
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void numOutputs(Promise promise) {
        try {
            promise.resolve(graphOperation.numOutputs());
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void output(int output, Promise promise) {
        try {
            promise.resolve(graphOperation.output(output));
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void outputList(int i, int ii, Promise promise) {
        try {
            promise.resolve(graphOperation.outputList(i, ii));
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void outputListLength(String s, Promise promise) {
        try {
            promise.resolve(graphOperation.outputListLength(s));
        } catch (Exception e) {
            promise.reject(e);
        }
    }

    @ReactMethod
    public void type(Promise promise) {
        try {
            promise.resolve(graphOperation.type());
        } catch (Exception e) {
            promise.reject(e);
        }
    }
}

@@ -1417,22 +1417,21 @@
 put(int 
-output
+index
 , Promis
@@ -1507,22 +1507,21 @@
 .output(
-output
+index
 ));%0A    
@@ -1649,16 +1649,24 @@
 nt i
+ndex
 , int 
-ii
+length
 , Pr
@@ -1755,12 +1755,20 @@
 st(i
-, ii
+ndex, length
 ));%0A
@@ -1896,33 +1896,36 @@
 stLength(String 
-s
+name
 , Promise promis
@@ -1995,33 +1995,36 @@
 utputListLength(
-s
+name
 ));%0A        %7D ca

Fix var names