Options
All
  • Public
  • Public/Protected
  • All
Menu

Midway Api Reference

Index

Type aliases

Middleware

Middleware: KoaMiddleware<Context>

MiddlewareParamArray

MiddlewareParamArray: KoaMiddlewareParamArray<Context>

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"

current release name

member

{String} Midway#RELEASE

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

current version of midway

member

{String} Midway#VERSION

Const app

app: MidwayMockApplication = mock.app({})

Const camelcase

camelcase: any = require('camelcase')

Const debug

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

Const defaultFramework

defaultFramework: string = resolveModule('midway') || resolveModule('midway-mirror')

Const graphviz

graphviz: any = require('graphviz')

Const mm

mm: EggMock = mock.default

Functions

buildLoadDir

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

getMethodNames

  • getMethodNames(obj: object): string[]
  • Find methods on a given object

    Parameters

    • obj: object

      object to enumerate on

    Returns string[]

    • method names

getParamNames

  • getParamNames(func: function): RegExpMatchArray

isTypeScriptEnvironment

  • isTypeScriptEnvironment(): boolean

mockContainer

providerWrapper

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

safelyGet

  • safelyGet(list: string | string[], obj?: object): any
  • safelyGet(['a','b'],{a: {b: 2}}) // => 2 safelyGet(['a','b'],{c: {b: 2}}) // => undefined safelyGet(['a','1'],{a: {"1": 2}}) // => 2 safelyGet(['a','1'],{a: {b: 2}}) // => undefined safelyGet('a.b',{a: {b: 2}}) // => 2 safelyGet('a.b',{c: {b: 2}}) // => undefined

    Parameters

    • list: string | string[]
    • Optional obj: object

    Returns 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