
/**
 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
 *
 * Do not edit this file as changes may cause incorrect behavior and will be lost
 * once the code is regenerated.
 *
 * @generated by codegen project: GenerateModuleJavaSpec.js
 *
 * @nolint
 */

package com.drpogodin.reactnativefs;

import com.facebook.proguard.annotations.DoNotStrip;
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 com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public abstract class NativeReactNativeFsSpec extends ReactContextBaseJavaModule implements TurboModule {
  public static final String NAME = "ReactNativeFs";

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

  @Override
  public @Nonnull String getName() {
    return NAME;
  }

  protected abstract Map<String, Object> getTypedExportedConstants();

  @Override
  @DoNotStrip
  public final @Nullable Map<String, Object> getConstants() {
    Map<String, Object> constants = getTypedExportedConstants();
    if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
      Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
          "CachesDirectoryPath",
          "DocumentDirectory",
          "DocumentDirectoryPath",
          "DownloadDirectoryPath",
          "ExternalCachesDirectoryPath",
          "ExternalDirectoryPath",
          "ExternalStorageDirectoryPath",
          "FileTypeDirectory",
          "FileTypeRegular",
          "TemporaryDirectoryPath"
      ));
      Set<String> optionalFlowConstants = new HashSet<>(Arrays.asList(
          "FileProtectionKeys",
          "LibraryDirectoryPath",
          "MainBundlePath",
          "PicturesDirectoryPath",
          "RoamingDirectoryPath"
      ));
      Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
      undeclaredConstants.removeAll(obligatoryFlowConstants);
      undeclaredConstants.removeAll(optionalFlowConstants);
      if (!undeclaredConstants.isEmpty()) {
        throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
      }
      undeclaredConstants = obligatoryFlowConstants;
      undeclaredConstants.removeAll(constants.keySet());
      if (!undeclaredConstants.isEmpty()) {
        throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
      }
    }
    return constants;
  }

  @ReactMethod
  @DoNotStrip
  public abstract void addListener(String event);

  @ReactMethod
  @DoNotStrip
  public abstract void removeListeners(double count);

  @ReactMethod
  @DoNotStrip
  public abstract void appendFile(String path, String b64, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void copyFile(String from, String into, ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void downloadFile(ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void exists(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void getFSInfo(Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void hash(String path, String algorithm, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void mkdir(String path, ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void moveFile(String from, String into, ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void pickFile(ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void read(String path, double length, double position, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void readFile(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void readDir(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void stat(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void stopDownload(double jobId);

  @ReactMethod
  @DoNotStrip
  public abstract void stopUpload(double jobId);

  @ReactMethod
  @DoNotStrip
  public abstract void touch(String path, ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void unlink(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void uploadFiles(ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void write(String path, String b64, double position, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void writeFile(String path, String b64, ReadableMap options, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void copyFileAssets(String from, String into, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void copyFileRes(String from, String into, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void existsAssets(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void existsRes(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void getAllExternalFilesDirs(Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void readFileAssets(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void readFileRes(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void readDirAssets(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void scanFile(String path, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void setReadable(String filepath, boolean readable, boolean ownerOnly, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void copyAssetsFileIOS(String imageUri, String destPath, double width, double height, double scale, double compression, String resizeMode, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void copyAssetsVideoIOS(String imageUri, String destPath, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void completeHandlerIOS(double jobId);

  @ReactMethod
  @DoNotStrip
  public abstract void isResumable(double jobId, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void pathForBundle(String bundle, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void pathForGroup(String group, Promise promise);

  @ReactMethod
  @DoNotStrip
  public abstract void resumeDownload(double jobId);

  @ReactMethod
  @DoNotStrip
  public abstract void copyFolder(String from, String into, Promise promise);
}
