import { g as PrefixedPluginRoutes, h as BackendLibConfig, i as BackendLib } from '../shared/stack.BoA0xkJv.js';
export { B as BackendPlugin, S as StackContext } from '../shared/stack.BoA0xkJv.js';
export { toNodeHandler } from 'better-call/node';
import '@btst/yar';
import '@btst/db';
import 'better-call';

/**
 * Creates the backend library with plugin support
 *
 * @example
 * ```ts
 * const api = stack({
 *   plugins: {
 *     messages: messagesPlugin.backend
 *   },
 *   adapter: memoryAdapter
 * });
 *
 * // Use in API route:
 * export const GET = api.handler;
 * export const POST = api.handler;
 * ```
 *
 * @template TPlugins - The exact plugins map (inferred from config)
 * @template TRoutes - All routes with prefixed keys like "pluginName_routeName" (computed automatically)
 */
declare function stack<TPlugins extends Record<string, any>, TRoutes extends PrefixedPluginRoutes<TPlugins> = PrefixedPluginRoutes<TPlugins>>(config: BackendLibConfig<TPlugins>): BackendLib<TRoutes>;

export { BackendLib, BackendLibConfig, stack };
