import { c as Sitemap, C as ClientPlugin, d as PluginRoutes, e as ClientLibConfig, f as ClientLib } from '../shared/stack.BoA0xkJv.js';
export { b as ClientStackContext } from '../shared/stack.BoA0xkJv.js';
import '@btst/yar';
import '@btst/db';
import 'better-call';

/**
 * Converts an array of sitemap entries into an XML string following the sitemap.org protocol.
 *
 * @param entries - Array of sitemap entries from `lib.generateSitemap()`
 * @returns Complete XML string for the sitemap
 *
 * @example
 * ```ts
 * const entries = await lib.generateSitemap();
 * const xml = sitemapEntryToXmlString(entries);
 * return new Response(xml, {
 *   headers: { "Content-Type": "application/xml; charset=utf-8" }
 * });
 * ```
 */
declare function sitemapEntryToXmlString(entries: Sitemap): string;

interface Metadata {
    title: string;
    description?: string;
    keywords?: string[];
    applicationName?: string;
    generator?: string;
    referrer?: "no-referrer" | "origin" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin";
    themeColor?: string;
    viewport?: string;
    creator?: string;
    publisher?: string;
    authors?: {
        name: string;
    }[];
    abstract?: string;
    robots?: string;
    alternates?: Partial<{
        canonical: string;
    }>;
    twitter?: Partial<{
        title: string;
        description: string;
        site: string;
        creator: string;
        images?: string[];
    }>;
    openGraph?: Partial<{
        title: string;
        description: string;
        url: string;
        siteName: string;
        locale: string;
        images?: string[];
        videos?: string[];
        audio?: string[];
    }>;
}
/**
 * Converts an array of meta elements to a metadata object
 * @param metaElements - An array of meta elements
 * @example
 * ```ts
 * const metaElements = [
 *   { name: "title", content: "My Page" },
 *   { name: "description", content: "This is my page" },
 * ];
 * const metadata = metaElementsToObject(metaElements);
 * console.log(metadata);
 * ```
 */
declare function metaElementsToObject(metaElements: Array<React.JSX.IntrinsicElements["meta"] | undefined>): Metadata;

/**
 * Normalizes path segments from framework route params into a consistent path string.
 *
 * Handles different framework param formats:
 * - Next.js: `pathParams.all` (string[])
 * - React Router: `params["*"]` (string)
 * - TanStack Router: `params._splat` (string)
 *
 * @param path - Path segments as string, string array, or undefined
 * @returns Normalized path string starting with "/" (or "/" for empty/undefined)
 *
 * @example
 * ```ts
 * // Next.js
 * normalizePath(pathParams?.all) // ["blog", "post"] => "/blog/post"
 *
 * // React Router / TanStack Router
 * normalizePath(params["*"]) // "blog/post" => "/blog/post"
 * normalizePath(undefined) // => "/"
 * ```
 */
declare function normalizePath(path?: string | Array<string> | undefined): string;

/**
 * Creates the client library with plugin support
 *
 * @example
 * ```ts
 * // For Next.js with SSR:
 * const lib = createStackClient({
 *   plugins: {
 *     blog: blogPlugin.client
 *   }
 * });
 *
 * // SPA usage - just render the route
 * function Page() {
 *   return lib.resolveRoute('/blog');
 * }
 *
 * // SSR usage - prefetch data with loader, then render
 * async function Page({ params }) {
 *   const path = '/blog';
 *
 *   // Load data server-side if loader exists
 *   const loader = lib.getLoader(path);
 *   if (loader) await loader(queryClient, baseURL, basePath);
 *
 *   // Render with built-in Suspense + Error Boundary
 *   return lib.resolveRoute(path);
 * }
 *
 * // Next.js with notFound() function
 * import { notFound } from 'next/navigation';
 *
 * async function Page({ params }) {
 *   const path = '/blog';
 *   const loader = lib.getLoader(path);
 *   if (loader) await loader(queryClient, baseURL);
 *
 *   return lib.resolveRoute(path, {
 *     onNotFound: notFound // Calls Next.js notFound() instead of rendering
 *   });
 * }
 *
 * ```
 *
 * @template TPlugins - The exact plugins map (inferred from config)
 * @template TRoutes - All routes from all plugins, merged (computed automatically)
 */
declare function createStackClient<TPlugins extends Record<string, ClientPlugin<any, any>>, TRoutes extends PluginRoutes<TPlugins> = PluginRoutes<TPlugins>>(config: ClientLibConfig<TPlugins>): ClientLib<TRoutes>;

export { ClientLib, ClientLibConfig, ClientPlugin, createStackClient, metaElementsToObject, normalizePath, sitemapEntryToXmlString };
