"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.interruptAs = interruptAs;
exports.interruptAsNow = void 0;
exports.interruptAsNow_ = interruptAsNow_;

var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Exit/operations/interrupt"));

var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Fiber/operations/done"));

var _definition = /*#__PURE__*/require("@effect/core/io/Fiber/definition");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

/**
 * A fiber that is already interrupted.
 *
 * @tsplus static ets/Fiber/Ops interruptAs
 */
function interruptAs(fiberId) {
  return tsplus_module_2.done(tsplus_module_1.interrupt(fiberId));
}
/**
 * Interrupts the fiber as if interrupted from the specified fiber. If the
 * fiber has already exited, the returned effect will resume immediately.
 * Otherwise, the effect will resume when the fiber exits.
 *
 * @tsplus fluent ets/Fiber interruptAs
 * @tsplus fluent ets/RuntimeFiber interruptAs
 */


function interruptAsNow_(self, fiberId, __tsplusTrace) {
  void 0;
  return self._interruptAs(fiberId);
}
/**
 * Interrupts the fiber as if interrupted from the specified fiber. If the
 * fiber has already exited, the returned effect will resume immediately.
 * Otherwise, the effect will resume when the fiber exits.
 *
 * @tsplus static ets/Fiber/Aspects interruptAs
 */


const interruptAsNow = (fiberId, __tsplusTrace) => self => interruptAsNow_(self, fiberId, __tsplusTrace);

exports.interruptAsNow = interruptAsNow;
//# sourceMappingURL=interruptAs.js.map