import { Record } from '@quenk/noni/lib/data/record'; import { Maybe } from '@quenk/noni/lib/data/maybe'; import { PVM } from '@quenk/potoo/lib/actor/system/vm'; import { LogSink } from '@quenk/potoo/lib/actor/system/vm/log'; import { TendrilServer } from '../net/http/server'; import { ModuleConf } from './module/conf'; import { Pool } from './connection/pool'; import { Module, ModuleInfo } from './module'; import { StartupManager } from './startup'; import { EventDispatcher } from './events'; import { ConfigureEventListenersTask } from './startup/events'; import { PoolConnectionsTask } from './startup/connections'; import { ConfigureRequestLoggerTask } from './startup/log'; import { SessionSupportTask } from './startup/session'; import { CookieSupportTask } from './startup/cookie'; import { ConfigureBodyParserTask } from './startup/body-parser'; import { BuildAvailableMiddlewareTask, BuildEnabledMiddlewareTask, BuildGlobalFiltersTask, BuildRouteFiltersTask, ConfigureFinalRoutesTask, ConfigureRoutesTask } from './startup/routing'; import { CSRFTokenSupportTask } from './startup/csrf'; import { StaticDirSupportTask } from './startup/static'; export declare const defaultStartupTasks: (app: App) => (CSRFTokenSupportTask | ConfigureEventListenersTask | PoolConnectionsTask | ConfigureRequestLoggerTask | CookieSupportTask | SessionSupportTask | ConfigureBodyParserTask | BuildGlobalFiltersTask | BuildRouteFiltersTask | BuildAvailableMiddlewareTask | BuildEnabledMiddlewareTask | ConfigureRoutesTask | ConfigureFinalRoutesTask | StaticDirSupportTask)[]; /** * App is the main class of the tendril framework. * * An App is a collection of one or more modules each of which in turn are * configured to handle specific incoming requests via routes. Routes are * handled by spawning a child actor (in the same process) that can communicate * with other actors in the app via the PVM apis. * * Modules are configurable and hierarchical with the first one serving as the * root. Most of the App configuration should be done there as many directives * are either inherited by children or do not have a productive effect. * * When an App is started, it will spawn the root module and all its children, * it will also execute a series of startup tasks that prepare the modules for * routing requests. These tasks are also responsible for opening connections * to resources and configuring the underlying framework. * * At this time tasks are meant to be an internal API and not configurable * in userland. This may change if a need arises for plugins etc. */ export declare class App { conf: ModuleConf; vm: PVM; modules: Record; rootInfo: Maybe; pool: typeof Pool; server: TendrilServer; events: EventDispatcher; startup: StartupManager; log: LogSink; constructor(conf: ModuleConf, vm?: PVM, modules?: Record, rootInfo?: Maybe, pool?: typeof Pool, server?: TendrilServer, events?: EventDispatcher, startup?: StartupManager, log?: LogSink); /** * registerModule creates internal tracking information for newly created * modules. */ registerModule(module: Module): ModuleInfo; /** * start the App. */ start(): Promise; /** * stop the App * * Note: At this time, a stopped App should be considered in an invalid * state and not started again. This may change in a future version. */ stop(): Promise; }