Setu-TS
    Preparing search index...

    Interface IApplication

    The application: registers plugins, owns the router and middleware pipeline, and manages the server lifecycle.

    0.1.0

    interface IApplication {
        diagnostics?: IDiagnosticsSource;
        middleware: IMiddlewareApi;
        router: IRouterApi;
        services: IServiceRegistry;
        fetch(request: Request): Promise<Response>;
        register(plugin: IPlugin): IApplication;
        start(options?: StartOptions): Promise<void>;
        stop(): Promise<void>;
    }

    Hierarchy (View Summary)

    Index
    diagnostics?: IDiagnosticsSource

    Read-only kernel diagnostics reader, present ONLY when the application was created with diagnostics explicitly enabled; the property is absent (and this member reads as undefined) otherwise. Absence creates no collector, metadata mirror, ring buffer, or timer anywhere in the kernel.

    This member is the consumer's whole access path: it is a pull-only reader (snapshot() / read()), never a registry token, never a writer, and never a service to resolve. Reading it can neither execute application code nor mutate application state, and the data it returns is a bounded, frozen projection — see IDiagnosticsSource for the exact contract.

    Optional by contract so a third-party IApplication implementation written before diagnostics existed remains valid without adopting it. (| undefined is explicit for exactOptionalPropertyTypes: an implementation may satisfy this with a getter that answers undefined, which is exactly what the disabled kernel does.)

    0.8.0

    middleware: IMiddlewareApi

    The global middleware pipeline.

    router: IRouterApi

    The application router.

    The application-scoped service registry.

    • Delegates a web-standard Request to the registered IHttpAdapter.fetch. This works regardless of whether start() was called (Cloudflare Workers path: setHandler runs at start() time, fetch works without listen).

      Parameters

      • request: Request

        A web-standard Request

      Returns Promise<Response>

      A web-standard Response

    • Resolves plugins, builds the pipeline and router, and starts the server.

      Parameters

      Returns Promise<void>

      If plugin dependencies are unsatisfied or cyclic, or if no plugin provides the runtime capability