/*! * @Author: richen * @Date: 2026-04-24 16:20:43 * @License: BSD (3-Clause) * @Copyright (c) - * @HomePage: https://koatty.org/ */ import { Config } from 'koatty_config'; import { Helper } from 'koatty_lib'; import { KoattyApplication } from 'koatty_core'; import { Log } from 'koatty_logger'; import { DefaultLogger as Logger } from 'koatty_logger'; import { LogLevelType } from 'koatty_logger'; /** * Decorator for Koatty framework * @author richen * @copyright Copyright (c) - * @license BSD (3-Clause) * @version 2026-02-03 10:00:00 */ /** * Bootstrap decorator for Koatty application class. * * @param bootFunc Optional function to execute during bootstrap process * @returns ClassDecorator * @throws Error if target class does not inherit from Koatty * * @example * ```ts * @Bootstrap() * export class App extends Koatty { * // ... * } * ``` */ export declare function Bootstrap(bootFunc?: (...args: any[]) => any): (target: any, context?: any) => any; /** * Component scan decorator for Koatty application. * Scans the specified path(s) for components and registers them in the IOC container. * * @param {string | string[]} [scanPath] - The path or array of paths to scan for components * @returns {ClassDecorator} A class decorator that enables component scanning * @throws {Error} If the decorated class does not inherit from Koatty * @example * ```typescript * @ComponentScan() * export class App extends Koatty { * // ... * } * ``` */ export declare function ComponentScan(scanPath?: string | string[]): (target: any, context?: any) => any; export { Config } /** * Configuration scan decorator, used to scan and load configuration files. * * @param scanPath - The path or array of paths to scan for configuration files. If not provided, defaults to empty string. * @returns A class decorator function that registers configuration scan metadata. * @throws Error if the decorated class does not inherit from Koatty. * @example * ```typescript * @ConfigurationScan() * export class App extends Koatty { * // ... * } * ``` */ export declare function ConfigurationScan(scanPath?: string | string[]): (target: any, context?: any) => any; /** * Create a fully initialized Koatty application WITHOUT starting a server. * * Use this for: * - Serverless deployment (AWS Lambda, Alibaba Cloud FC, Tencent SCF, etc.) * - Custom server setup (attach handler to an existing HTTP server) * - Testing (use app.getRequestHandler() with supertest) * * @param target - The Koatty application class decorated with @Bootstrap() * @param bootFunc - Optional function to execute during bootstrap process * @returns Promise A ready application instance (not listening) * * @example * ```typescript * // Serverless entry point * import { createApplication } from 'koatty'; * import { App } from './App'; * * let cachedApp: KoattyApplication; * * export async function handler(req, res) { * if (!cachedApp) { * cachedApp = await createApplication(App); * } * return cachedApp.getRequestHandler()(req, res); * } * * // Custom HTTP server * import http from 'http'; * const app = await createApplication(App); * http.createServer(app.getRequestHandler()).listen(3000); * ``` */ export declare function createApplication(target: any, bootFunc?: (...args: any[]) => any): Promise; /** * Decorator function for bootstrapping a Koatty application. * * @param bootFunc Optional function to be executed during bootstrap process * @returns A decorator function that validates and executes the bootstrap process * @throws Error if the target class does not inherit from Koatty * * @example * ```typescript * app = await ExecBootStrap()(App); * ``` */ export declare function ExecBootStrap(bootFunc?: (...args: any[]) => any): (target: any) => Promise; export { Helper } export { Log } export { Logger } export { LogLevelType } export * from "koatty_container"; export * from "koatty_core"; export * from "koatty_exception"; export * from "koatty_router"; export * from "koatty_serve"; export { }