import { Mode, ModeValue } from "./parser.cjs"; //#region src/internal/mode-dispatch.d.ts /** * Dispatches to sync or async implementation based on mode. * * This function encapsulates the necessary type assertions when branching * on runtime mode values. TypeScript cannot narrow `ModeValue` based * on `mode === "async"` checks, so we must use type assertions. * * @param mode The execution mode. * @param syncFn Function to call for sync execution. * @param asyncFn Function to call for async execution. * @returns The result with correct mode wrapping. * @since 0.10.0 */ declare function dispatchByMode(mode: M, syncFn: () => T, asyncFn: () => Promise): ModeValue; /** * Wraps a value so it matches the parser execution mode. * * @param mode The execution mode. * @param value The value to wrap. * @returns The wrapped value with correct mode semantics. * @since 1.0.0 */ declare function wrapForMode(mode: "sync", value: T | Promise): T; declare function wrapForMode(mode: "async", value: T | Promise): Promise; declare function wrapForMode(mode: M, value: T | Promise): ModeValue; /** * Maps a mode-wrapped value while preserving its execution mode. * * @param mode The execution mode. * @param value The mode-wrapped value to transform. * @param mapFn Mapping function applied to the unwrapped value. * @returns The mapped value with correct mode wrapping. * @since 1.0.0 */ declare function mapModeValue(mode: M, value: ModeValue, mapFn: (value: T) => U): ModeValue; /** * Dispatches iterable to sync or async implementation based on mode. * * @param mode The execution mode. * @param syncFn Function returning sync iterable. * @param asyncFn Function returning async iterable. * @returns The iterable with correct mode wrapping. * @internal * @since 0.10.0 */ //#endregion export { dispatchByMode, mapModeValue, wrapForMode };