UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

76 lines (73 loc) • 2.85 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var index_native_exports = {}; __export(index_native_exports, { FileSystem: () => FileSystem }); module.exports = __toCommonJS(index_native_exports); var import_nativeError = require("../nativeError.native.js"); var import_classes = require("./classes.native.js"); var import_hybrid = require("./hybrid.native.js"); function getDirectories() { try { return (0, import_hybrid.fileSystemNative)().getDirectories(); } catch (error) { return (0, import_nativeError.rethrowNativeError)(error); } } function getInfo(uri) { return (0, import_hybrid.fileSystemNative)().getInfo(uri).catch(import_nativeError.rethrowNativeError); } function readDirectory(uri) { return (0, import_hybrid.fileSystemNative)().readDirectory(uri).catch(import_nativeError.rethrowNativeError); } function makeDirectory(uri) { var intermediates = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return (0, import_hybrid.fileSystemNative)().makeDirectory(uri, intermediates).catch(import_nativeError.rethrowNativeError); } function writeFile(uri, contents) { var encoding = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "utf8"; return (0, import_hybrid.fileSystemNative)().writeFile(uri, contents, encoding).catch(import_nativeError.rethrowNativeError); } function copy(fromUri, toUri) { return (0, import_hybrid.fileSystemNative)().copy(fromUri, toUri).catch(import_nativeError.rethrowNativeError); } function move(fromUri, toUri) { return (0, import_hybrid.fileSystemNative)().move(fromUri, toUri).catch(import_nativeError.rethrowNativeError); } function deleteFile(uri) { return (0, import_hybrid.fileSystemNative)().remove(uri).catch(import_nativeError.rethrowNativeError); } var FileSystem = Object.freeze({ getDirectories, getInfo, readDirectory, makeDirectory, writeFile, copy, move, delete: deleteFile, File: import_classes.File, Directory: import_classes.Directory, Paths: import_classes.Paths, FileHandle: import_classes.FileHandle, FileMode: import_classes.FileMode }); //# sourceMappingURL=index.native.js.map