one
Version:
One is a React framework for web, iOS, and Android apps.
22 lines (19 loc) • 914 B
JavaScript
import { NitroModules } from "react-native-nitro-modules";
import { rethrowNativeError } from "../nativeError.native.js";
var hybrid;
function native() {
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneImageManipulator");
return hybrid;
}
function transform(uri) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var _options_format;
if (options.flip != null && options.flip !== "horizontal" && options.flip !== "vertical") throw new Error("ImageManipulator.transform: flip must be 'horizontal' or 'vertical'");
return native().transform(uri, {
...options,
format: (_options_format = options.format) !== null && _options_format !== void 0 ? _options_format : "jpeg"
}).catch(rethrowNativeError);
}
var ImageManipulator = Object.freeze({ transform });
export { ImageManipulator };
//# sourceMappingURL=index.native.js.map