/** * @license * Copyright 2026 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * Type definition for a function that selects an item based on the context. */ export type Router = (items: Readonly>, context: C, errorContext?: { failedKeys: ReadonlySet; lastError: unknown; }) => Promise | string | undefined; /** * Runs a core operation with selection and failover support. * Internal helper to unify Promise and Generator logic. */ export declare function runWithRouting(items: Readonly>, context: C, router: Router, runFn: (item: T) => AsyncGenerator | Promise): AsyncGenerator;