@codesandbox/sandpack-client
Version:
<img style="width:100%" src="https://user-images.githubusercontent.com/4838076/143581035-ebee5ba2-9cb1-4fe8-a05b-2f44bd69bb4b.gif" alt="Component toolkit for live running code editing experiences" />
44 lines • 1.6 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseFile = void 0;
var api_error_1 = require("./api_error");
/**
* Base class that contains shared implementations of functions for the file
* object.
*/
var BaseFile = /** @class */ (function () {
function BaseFile() {
}
BaseFile.prototype.sync = function (cb) {
cb(new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP));
};
BaseFile.prototype.syncSync = function () {
throw new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP);
};
BaseFile.prototype.datasync = function (cb) {
this.sync(cb);
};
BaseFile.prototype.datasyncSync = function () {
return this.syncSync();
};
BaseFile.prototype.chown = function (uid, gid, cb) {
cb(new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP));
};
BaseFile.prototype.chownSync = function (uid, gid) {
throw new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP);
};
BaseFile.prototype.chmod = function (mode, cb) {
cb(new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP));
};
BaseFile.prototype.chmodSync = function (mode) {
throw new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP);
};
BaseFile.prototype.utimes = function (atime, mtime, cb) {
cb(new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP));
};
BaseFile.prototype.utimesSync = function (atime, mtime) {
throw new api_error_1.ApiError(api_error_1.ErrorCode.ENOTSUP);
};
return BaseFile;
}());
exports.BaseFile = BaseFile;
;