Options
All
  • Public
  • Public/Protected
  • All
Menu

Midway Api Reference

Index

Type aliases

EggContext

EggContext: ReturnType<mockContext>

Middleware

Middleware: KoaMiddleware<Context>

MiddlewareParamArray

MiddlewareParamArray: KoaMiddlewareParamArray<Context>

MockClassFunctionHandler

MockClassFunctionHandler: function

Type declaration

Variables

Const ARGUMENT_NAMES

ARGUMENT_NAMES: RegExp = /([^\s,]+)/g

Const CONTROLLERS

CONTROLLERS: "controllers" = "controllers"

Const EggLoader

EggLoader: any = require('egg-core').EggLoader

Const FUNCTION_INJECT_KEY

FUNCTION_INJECT_KEY: "midway:function_inject_key" = "midway:function_inject_key"

Const MIDDLEWARES

MIDDLEWARES: "middlewares" = "middlewares"

Const MIDWAY_PATH

MIDWAY_PATH: string = path.dirname(__dirname)

Const Master

Master: any = require('../cluster/master')

Const RELEASE

RELEASE: "VISION" = "VISION"

Const STRIP_COMMENTS

STRIP_COMMENTS: RegExp = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg

Const TS_SRC_DIR

TS_SRC_DIR: "src" = "src"

Const TS_TARGET_DIR

TS_TARGET_DIR: "dist" = "dist"

Const TYPE_LOGGER

TYPE_LOGGER: "logger" = "logger"

Const TYPE_PLUGIN

TYPE_PLUGIN: "plugin" = "plugin"

Const VERSION

VERSION: any = require('../package.json').version

Const app

app: MidwayMockApplication = mock.app(isJest ? {typescript: true} : {})

Const camelcase

camelcase: any = require('camelcase')

Const debug

debug: any = require('debug')(`midway:loader:${process.pid}`)

Const graphviz

graphviz: any = require('graphviz')

Const isJest

isJest: boolean = process.env.MIDWAY_JEST_MODE === 'true'

Const mm

mm: EggMock = mock.default

Functions

buildLoadDir

  • buildLoadDir(baseDir: any, dir: any): any

Const getDefaultFramework

  • getDefaultFramework(): any

getMethodNames

  • getMethodNames(obj: object): string[]

getParamNames

  • getParamNames(func: function): RegExpMatchArray

isTypeScriptEnvironment

  • isTypeScriptEnvironment(): boolean

Const mockClassFunction

mockContainer

providerWrapper

  • providerWrapper(wrapperInfo: Array<object>): void

safelyGet

  • safelyGet(list: string | string[], obj: object): any

startCluster

  • startCluster(options: any, callback: any): void

Object literals

Const MidwayHandlerKey

MidwayHandlerKey: object

CONFIG

CONFIG: string = "config"

LOGGER

LOGGER: string = "logger"

PLUGIN

PLUGIN: string = "plugin"

Generated using TypeDoc