import { a as createCanonicalTracker, c as CanonicalId, d as CreateCanonicalIdOptions, f as createCanonicalId, h as validateCanonicalId, i as buildAstPath, l as CanonicalIdSchema, m as parseCanonicalId, n as ScopeFrame, o as createOccurrenceTracker, p as isRelativeCanonicalId, r as ScopeHandle, s as createPathTracker, t as CanonicalPathTracker, u as CanonicalIdValidationResult } from "./index-KB_f9ZJF.mjs"; import { a as __resetPortableHasherForTests, c as PortableFS, d as getPortableFS, i as PortableHasher, l as __resetPortableFSForTests, n as runtime, o as createPortableHasher, r as HashAlgorithm, s as getPortableHasher, t as resetPortableForTests, u as createPortableFS } from "./index-B7A6qmX_.mjs"; import { a as normalizePath, c as resolveRelativeImportWithReferences, d as createAliasResolver, f as TsconfigPathsConfig, i as isRelativeSpecifier, l as cachedFn, m as readTsconfigPaths, n as MODULE_EXTENSION_CANDIDATES, o as parseJsExtension, p as TsconfigReadError, r as isExternalSpecifier, s as resolveRelativeImportWithExistenceCheck, t as JsExtensionInfo, u as AliasResolver } from "./index-BIgjHIdk.mjs"; import { n as createSwcSpanConverter, t as SwcSpanConverter } from "./swc-span-C4QReqWr.mjs"; import { n as ShapeFor, r as defineSchemaFor, t as SchemaFor } from "./index-DeJfMmkU.mjs"; import { Result } from "neverthrow"; //#region packages/common/src/scheduler/types.d.ts /** * Abstract base class for all effects. * Effects encapsulate both the data and the execution logic. * * @template TResult - The type of value this effect produces when executed * * @example * ```typescript * function* myGenerator() { * const value = yield* new PureEffect(42).run(); * return value; // 42 * } * ``` */ declare abstract class Effect { /** * Execute the effect synchronously and return the result. */ executeSync(): TResult; /** * Execute the effect asynchronously and return the result. */ executeAsync(): Promise; /** * Returns a generator that yields this effect and returns the result. * Enables the `yield*` pattern for cleaner effect handling. * * @example * ```typescript * const value = yield* effect.run(); * ``` */ run(): Generator, TResult, EffectReturn>; /** * Internal synchronous execution logic. * Subclasses must implement this method. */ protected abstract _executeSync(): TResult; /** * Internal asynchronous execution logic. * Subclasses must implement this method. */ protected abstract _executeAsync(): Promise; } declare const EFFECT_RETURN: unique symbol; declare class EffectReturn { private readonly [EFFECT_RETURN]; private constructor(); static wrap(value: TResult): EffectReturn; static unwrap(value: EffectReturn): TResult; } /** * Extract the result type from an Effect. */ type EffectResult = E extends Effect ? T : never; /** * Generator type that yields Effects. */ type EffectGenerator = Generator; /** * Generator function type that creates an EffectGenerator. */ type EffectGeneratorFn = () => EffectGenerator; /** * Error type for scheduler operations. */ type SchedulerError = { readonly kind: "scheduler-error"; readonly message: string; readonly cause?: unknown; }; /** * Create a SchedulerError. */ declare const createSchedulerError: (message: string, cause?: unknown) => SchedulerError; /** * Synchronous scheduler interface. * Throws if an async-only effect (defer, yield) is encountered. */ interface SyncScheduler { run(generatorFn: EffectGeneratorFn): Result; } /** * Asynchronous scheduler interface. * Handles all effect types including defer, yield, and parallel. */ interface AsyncScheduler { run(generatorFn: EffectGeneratorFn): Promise>; } //#endregion //#region packages/common/src/scheduler/async-scheduler.d.ts /** * Create an asynchronous scheduler. * * This scheduler can handle all effect types including defer and yield. * Parallel effects are executed concurrently using Promise.all. * * @returns An AsyncScheduler instance * * @example * const scheduler = createAsyncScheduler(); * const result = await scheduler.run(function* () { * const data = yield* new DeferEffect(fetch('/api/data').then(r => r.json())).run(); * yield* new YieldEffect().run(); // Yield to event loop * return data; * }); */ declare const createAsyncScheduler: () => AsyncScheduler; //#endregion //#region packages/common/src/scheduler/effect.d.ts /** * Pure effect - returns a value immediately. * Works in both sync and async schedulers. * * @example * const result = yield* new PureEffect(42).run(); // 42 */ declare class PureEffect extends Effect { readonly pureValue: T; constructor(pureValue: T); protected _executeSync(): T; protected _executeAsync(): Promise; } /** * Defer effect - wraps a Promise for async execution. * Only works in async schedulers; throws in sync schedulers. * * @example * const data = yield* new DeferEffect(fetch('/api/data').then(r => r.json())).run(); */ declare class DeferEffect extends Effect { readonly promise: Promise; constructor(promise: Promise); protected _executeSync(): T; protected _executeAsync(): Promise; } /** * Parallel effect - executes multiple effects concurrently. * In sync schedulers, effects are executed sequentially. * In async schedulers, effects are executed with Promise.all. * * @example * const results = yield* new ParallelEffect([new PureEffect(1), new PureEffect(2)]).run(); // [1, 2] */ declare class ParallelEffect extends Effect { readonly effects: readonly Effect[]; constructor(effects: readonly Effect[]); protected _executeSync(): readonly unknown[]; protected _executeAsync(): Promise; } /** * Yield effect - yields control back to the event loop. * This helps prevent blocking the event loop in long-running operations. * Only works in async schedulers; throws in sync schedulers. * * @example * for (let i = 0; i < 10000; i++) { * doWork(i); * if (i % 100 === 0) { * yield* new YieldEffect().run(); * } * } */ declare class YieldEffect extends Effect { protected _executeSync(): void; protected _executeAsync(): Promise; } /** * Effect factory namespace for convenience. * Provides static methods to create effects. */ declare const Effects: { /** * Create a pure effect that returns a value immediately. */ readonly pure: (value: T) => PureEffect; /** * Create a defer effect that wraps a Promise. */ readonly defer: (promise: Promise) => DeferEffect; /** * Create a parallel effect that executes multiple effects concurrently. */ readonly parallel: (effects: readonly Effect[]) => ParallelEffect; /** * Create a yield effect that returns control to the event loop. */ readonly yield: () => YieldEffect; }; //#endregion //#region packages/common/src/scheduler/sync-scheduler.d.ts /** * Create a synchronous scheduler. * * This scheduler executes generators synchronously. * It throws an error if an async-only effect (defer, yield) is encountered. * * @returns A SyncScheduler instance * * @example * const scheduler = createSyncScheduler(); * const result = scheduler.run(function* () { * const a = yield* new PureEffect(1).run(); * const b = yield* new PureEffect(2).run(); * return a + b; * }); * // result = ok(3) */ declare const createSyncScheduler: () => SyncScheduler; //#endregion export { AliasResolver, type AsyncScheduler, CanonicalId, CanonicalIdSchema, CanonicalIdValidationResult, CanonicalPathTracker, CreateCanonicalIdOptions, DeferEffect, Effect, type EffectGenerator, type EffectGeneratorFn, type EffectResult, Effects, HashAlgorithm, JsExtensionInfo, MODULE_EXTENSION_CANDIDATES, ParallelEffect, PortableFS, PortableHasher, PureEffect, type SchedulerError, SchemaFor, ScopeFrame, ScopeHandle, ShapeFor, SwcSpanConverter, type SyncScheduler, TsconfigPathsConfig, TsconfigReadError, YieldEffect, __resetPortableFSForTests, __resetPortableHasherForTests, buildAstPath, cachedFn, createAliasResolver, createAsyncScheduler, createCanonicalId, createCanonicalTracker, createOccurrenceTracker, createPathTracker, createPortableFS, createPortableHasher, createSchedulerError, createSwcSpanConverter, createSyncScheduler, defineSchemaFor, getPortableFS, getPortableHasher, isExternalSpecifier, isRelativeCanonicalId, isRelativeSpecifier, normalizePath, parseCanonicalId, parseJsExtension, readTsconfigPaths, resetPortableForTests, resolveRelativeImportWithExistenceCheck, resolveRelativeImportWithReferences, runtime, validateCanonicalId }; //# sourceMappingURL=index.d.mts.map