import * as Cause from "../Cause/core.js"; import * as Exit from "../Exit/api.js"; import * as FR from "../FiberRef/fiberRef.js"; import * as O from "../Option/index.js"; import * as Scope from "../Scope/index.js"; import * as St from "../Structural/index.js"; import * as Sup from "../Supervisor/index.js"; import { AtomicReference } from "../Support/AtomicReference/index.js"; import { RingBuffer } from "../Support/RingBuffer/index.js"; import * as T from "./_internal/effect.js"; import * as Fiber from "./core.js"; import type { Platform } from "./platform.js"; import type { Callback } from "./state.js"; import * as Status from "./status.js"; import type { TraceElement } from "./tracing.js"; import { Trace } from "./tracing.js"; export declare type FiberRefLocals = Map, any>; export declare class Stack { readonly value: A; readonly previous?: Stack | undefined; constructor(value: A, previous?: Stack | undefined); } export declare class InterruptExit { readonly apply: (a: any) => T.Effect; readonly trace?: string | undefined; readonly _tag = "InterruptExit"; constructor(apply: (a: any) => T.Effect, trace?: string | undefined); } export declare class TracingExit { readonly apply: (a: any) => T.Effect; readonly trace?: string | undefined; readonly _tag = "TracingExit"; constructor(apply: (a: any) => T.Effect, trace?: string | undefined); } export declare class HandlerFrame { readonly apply: (a: any) => T.Effect; readonly trace?: string | undefined; readonly _tag = "HandlerFrame"; constructor(apply: (a: any) => T.Effect, trace?: string | undefined); } export declare class ApplyFrame { readonly apply: (a: any) => T.Effect; readonly trace?: string | undefined; readonly _tag = "ApplyFrame"; constructor(apply: (a: any) => T.Effect, trace?: string | undefined); } export declare type Frame = InterruptExit | TracingExit | T.IFold | HandlerFrame | ApplyFrame; export declare const currentFiber: AtomicReference | null>; export declare const unsafeCurrentFiber: () => O.Option>; export declare class FiberContext implements Fiber.Runtime { readonly fiberId: Fiber.FiberID; readonly startEnv: any; readonly startIStatus: Fiber.InterruptStatus; readonly fiberRefLocals: FiberRefLocals; readonly supervisor0: Sup.Supervisor; readonly openScope: Scope.Open>; readonly maxOp: number; readonly reportFailure: (e: Cause.Cause) => void; readonly platform: Platform; readonly parentTrace: O.Option; readonly initialTracingStatus: boolean; readonly _tag = "RuntimeFiber"; readonly state: AtomicReference>; asyncEpoch: number; stack?: Stack | undefined; environments?: Stack | undefined; interruptStatus?: Stack | undefined; supervisors: Stack>; forkScopeOverride?: Stack>>> | undefined; scopeKey: Scope.Key | undefined; traceStatusEnabled: boolean; traceStatusStack: Stack | undefined; executionTraces: RingBuffer | undefined; stackTraces: RingBuffer | undefined; constructor(fiberId: Fiber.FiberID, startEnv: any, startIStatus: Fiber.InterruptStatus, fiberRefLocals: FiberRefLocals, supervisor0: Sup.Supervisor, openScope: Scope.Open>, maxOp: number, reportFailure: (e: Cause.Cause) => void, platform: Platform, parentTrace: O.Option, initialTracingStatus: boolean); get [St.hashSym](): number; [St.equalsSym](that: unknown): boolean; get poll(): T.UIO>>; addTrace(trace?: string): void; addTraceValue(trace: TraceElement): void; getRef(fiberRef: FR.Runtime): T.UIO; poll0(): O.None | O.Some>; interruptExit: InterruptExit; popTracingStatus(): void; pushTracingStatus(flag: boolean): void; tracingExit: TracingExit; get isInterruptible(): boolean; get isInterrupted(): boolean; get isInterrupting(): boolean; get shouldInterrupt(): boolean; get isStackEmpty(): boolean; get id(): Fiber.FiberID; pushContinuation(k: Frame): void; popStackTrace(): void; popContinuation(): Frame | undefined; pushEnv(k: any): void; popEnv(): any; pushInterruptStatus(flag: boolean): void; popInterruptStatus(): boolean | undefined; runAsync(k: Callback): void; /** * Unwinds the stack, looking for the first error handler, and exiting * interruptible / uninterruptible regions. */ unwindStack(): boolean; register0(k: Callback>): Exit.Exit | null; nextInstr(value: any): T.Instruction | undefined; notifyObservers(v: Exit.Exit, observers: Callback>[]): void; observe0(k: Callback>): O.Option>>; get await(): T.UIO>; interruptObserver(k: Callback>): void; interruptAs(fiberId: Fiber.FiberID): T.UIO>; done(v: Exit.Exit): T.Instruction | undefined; reportUnhandled(exit: Exit.Exit): void; setInterrupting(value: boolean): void; enterAsync(epoch: number, blockingOn: readonly Fiber.FiberID[]): T.Instruction | undefined; exitAsync(epoch: number): boolean; resumeAsync(epoch: number): (_: T.Effect) => void; evaluateLater(i0: T.Instruction): void; get scope(): Scope.Scope>; get status(): T.UIO; fork(i0: T.Instruction, forkScope: O.Option>>, reportFailure: O.Option<(e: Cause.Cause) => void>): FiberContext; private parentScopeOp; onDone(k: Callback>): void; getDescriptor(): Fiber.Descriptor; complete(winner: Fiber.Fiber, loser: Fiber.Fiber, cont: (exit: Exit.Exit, fiber: Fiber.Fiber) => T.Effect, winnerExit: Exit.Exit, ab: AtomicReference, cb: (_: T.Effect) => void): void; get inheritRefs(): T.Effect; get inTracingRegion(): boolean; raceWithImpl(race: T.IRaceWith): T.Effect; captureTrace(): Trace; cutAncestryTrace(trace: Trace): Trace; evaluateNow(i0: T.Instruction): void; } //# sourceMappingURL=context.d.ts.map