import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
import * as better_call from 'better-call';
import { S as StackContext } from '../../../shared/stack.7n9Y_u7N.js';
import '@btst/yar';
import '@btst/db';

/**
 * Scalar API Reference themes
 */
type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none";
/**
 * OpenAPI plugin configuration options
 */
interface OpenAPIOptions {
    /**
     * The path to the OpenAPI reference page
     * This path is relative to the API base path
     * @default "/reference"
     */
    path?: string;
    /**
     * Disable the default HTML reference page
     * Only the JSON schema endpoint will be available
     * @default false
     */
    disableDefaultReference?: boolean;
    /**
     * Theme for the Scalar API Reference page
     * @default "default"
     */
    theme?: ScalarTheme;
    /**
     * CSP nonce for inline scripts
     * Required for strict Content Security Policy
     */
    nonce?: string;
    /**
     * Custom title for the API documentation
     * @default "BTST API"
     */
    title?: string;
    /**
     * Custom description for the API documentation
     */
    description?: string;
    /**
     * API version string
     * @default "1.0.0"
     */
    version?: string;
}
/**
 * OpenAPI plugin for BTST
 *
 * Automatically generates OpenAPI 3.1 documentation for all registered plugins.
 * Provides both a JSON schema endpoint and an interactive Scalar UI reference page.
 *
 * @example
 * ```ts
 * const { handler } = stack({
 *   basePath: "/api/data",
 *   plugins: {
 *     blog: blogBackendPlugin(),
 *     cms: cmsBackendPlugin({ ... }),
 *     openApi: openApiBackendPlugin({ theme: "moon" }),
 *   },
 *   adapter: (db) => createMemoryAdapter(db)({}),
 * });
 *
 * // Access:
 * // - GET /api/data/open-api/schema - JSON schema
 * // - GET /api/data/reference - Interactive Scalar UI
 * ```
 */
declare const openApiBackendPlugin: (options?: OpenAPIOptions) => _btst_stack_plugins_api.BackendPlugin<{
    readonly generateSchema: better_call.StrictEndpoint<"/open-api/schema", {
        method: "GET";
    }, Record<string, any>>;
    readonly reference: better_call.StrictEndpoint<string, {
        method: "GET";
    }, Response>;
}, never>;
type OpenApiRouter = ReturnType<ReturnType<typeof openApiBackendPlugin>["routes"]>;

/**
 * Generate OpenAPI 3.1 schema from BTST context
 */
declare function generateOpenAPISchema(context: StackContext, options?: {
    title?: string;
    description?: string;
    version?: string;
}): Record<string, any>;

export { generateOpenAPISchema, openApiBackendPlugin };
export type { OpenAPIOptions, OpenApiRouter, ScalarTheme };
