text: // Generated by BUCKLESCRIPT VERSION 3.1.5, PLEASE EDIT WITH CARE
  'use strict';
  
  var $$Array = require("bs-platform/lib/js/array.js");
  var Curry = require("bs-platform/lib/js/curry.js");
  var ReactNative = require("react-native");
  
  function toOption(x) {
    return Promise.resolve((x == null) ? /* None */0 : [x]);
  }
  
  function map_cb(cb, err, value) {
    return Curry._2(cb, err === null ? /* None */0 : [err], (value == null) ? /* None */0 : [value]);
  }
  
  function getItem(key, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.getItem(key, (function (param, param$1) {
                      return map_cb(cb, param, param$1);
                    })).then(toOption);
    } else {
      return ReactNative.AsyncStorage.getItem(key, undefined).then(toOption);
    }
  }
  
  function setItem(key, value, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.setItem(key, value, (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.setItem(key, value, undefined);
    }
  }
  
  function removeItem(key, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.removeItem(key, (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.removeItem(key, undefined);
    }
  }
  
  function mergeItem(key, value, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.mergeItem(key, value, (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.mergeItem(key, value, undefined);
    }
  }
  
  function clear(callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.clear((function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.clear(undefined);
    }
  }
  
  function getAllKeys(callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.getAllKeys((function (param, param$1) {
                      return map_cb(cb, param, param$1);
                    })).then(toOption);
    } else {
      return ReactNative.AsyncStorage.getAllKeys(undefined).then(toOption);
    }
  }
  
  function multiGet(keys, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.multiGet(keys, (function (param, param$1) {
                      return map_cb(cb, param, param$1);
                    })).then(toOption);
    } else {
      return ReactNative.AsyncStorage.multiGet(keys, undefined).then(toOption);
    }
  }
  
  function multiSet(keyValues, callback, _) {
    var combine = function (param) {
      return /* array */[
              param[0],
              param[1]
            ];
    };
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.multiSet($$Array.map(combine, keyValues), (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.multiSet($$Array.map(combine, keyValues), undefined);
    }
  }
  
  function multiRemove(keys, callback, _) {
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.multiRemove(keys, (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.multiRemove(keys, undefined);
    }
  }
  
  function multiMerge(keyValues, callback, _) {
    var combine = function (param) {
      return /* array */[
              param[0],
              param[1]
            ];
    };
    if (callback) {
      var cb = callback[0];
      return ReactNative.AsyncStorage.multiMerge($$Array.map(combine, keyValues), (function (param) {
                    return Curry._1(cb, param === null ? /* None */0 : [param]);
                  }));
    } else {
      return ReactNative.AsyncStorage.multiMerge($$Array.map(combine, keyValues), undefined);
    }
  }
  
  exports.getItem = getItem;
  exports.setItem = setItem;
  exports.removeItem = removeItem;
  exports.mergeItem = mergeItem;
  exports.clear = clear;
  exports.getAllKeys = getAllKeys;
  exports.multiGet = multiGet;
  exports.multiSet = multiSet;
  exports.multiRemove = multiRemove;
  exports.multiMerge = multiMerge;
  /* react-native Not a pure module */
  