/** * Per-tick batched load against a Stacks model. The model object is the * batch identity — one queue per `model`. Ids posted in the same * microtask are merged into a single `findMany([...])` call. * * @example * ```ts * import { batchLoad } from '@stacksjs/orm' * import User from '~/app/Models/User' * * // Without batching: 100 SELECTs * for (const id of orderUserIds) await User.find(id) * * // With batching: 1 SELECT (`WHERE id IN (1, 2, … 100)`) * await Promise.all(orderUserIds.map(id => batchLoad(User, id))) * ``` */ // eslint-disable-next-line pickier/no-unused-vars export declare function batchLoad>(model: { name?: string findMany?: (ids: TKey[]) => Promise find?: (id: TKey) => Promise }, key: TKey): Promise;