UNPKG

@mvx/mvc

Version:

@mvx/mvc is mvc framework on server, base on koa, @tsdi frameworks

88 lines (87 loc) 2.01 kB
/// <reference types="node" /> import { BootContext, BootOption, ConfigureManager } from '@tsdi/boot'; import { IConfiguration } from './IConfiguration'; import * as Koa from 'koa'; import { MvcModuleMetadata } from './metadata'; import { IMvcServer } from './IMvcServer'; import { Server } from 'net'; /** * mvc boot option * * @export * @interface MvcOptions * @extends {BootOption} */ export interface MvcOptions extends BootOption { /** * annoation metadata config. * * @type {IConfiguration} * @memberof AnnoationContext */ annoation?: IConfiguration; /** * custom configures * * @type {((string | IConfiguration)[])} * @memberof BootOptions */ configures?: (string | IConfiguration)[]; koa?: Koa; httpServer?: Server; listener?: Function; } /** * mvc context token. */ export declare const MvcContextToken: import("@tsdi/ioc").TokenId<MvcContext>; /** * mvc application context. * * @export * @class MvcContext * @extends {BootContext} */ export declare class MvcContext extends BootContext<MvcOptions> { /** * boot startup service instance. * * @type {IStartup} * @memberof BootContext */ getStartup(): IMvcServer; getAnnoation(): MvcModuleMetadata; /** * configuration, meger configure and annoation metadata. * * @type {IConfiguration} * @memberof MvcContext */ getConfiguration(): IConfiguration; /** * get configure manager. * * @returns {ConfigureManager<IConfiguration>} * @memberof BootContext */ getConfigureManager(): ConfigureManager<IConfiguration>; private koa; getKoa(): Koa; app: Koa; getRootPath(): string; /** * http server. * * @type {Server} * @memberof MvcContext */ httpServer: Server; /** * cusmtom listener. * * @type {Function} * @memberof MvcContext */ listener?: () => void; static ρAnn(): any; }