Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @midwayjs/core

References

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

References

BaseFramework

BaseFramework:

ConfigFramework

ConfigFramework:

ContainerLoader

ContainerLoader:

Context

Context:

EmptyFramework

EmptyFramework:

FUNCTION_INJECT_KEY

FUNCTION_INJECT_KEY:

FrameworkDecoratorMetadata

FrameworkDecoratorMetadata:

HTTP_SERVER_KEY

HTTP_SERVER_KEY:

HandlerFunction

HandlerFunction:

HandlerProp

HandlerProp:

IApplicationContext

IApplicationContext:

IAspectService

IAspectService:

IConfigService

IConfigService:

IConfigurationOptions

IConfigurationOptions:

IContainerConfiguration

IContainerConfiguration:

IEnvironmentService

IEnvironmentService:

IInformationService

IInformationService:

ILifeCycle

ILifeCycle:

IManagedInstance

IManagedInstance:

IManagedResolver

IManagedResolver:

IManagedResolverFactoryCreateOptions

IManagedResolverFactoryCreateOptions:

IMessageSource

IMessageSource:

IMiddleware

IMiddleware:

IMidwayApplication

IMidwayApplication:

IMidwayBaseApplication

IMidwayBaseApplication:

IMidwayBootstrapOptions

IMidwayBootstrapOptions:

IMidwayContainer

IMidwayContainer:

IMidwayContext

IMidwayContext:

IMidwayCoreApplication

IMidwayCoreApplication:

IMidwayFramework

IMidwayFramework:

IMidwayLogger

IMidwayLogger:

IObjectCreator

IObjectCreator:

IObjectDefinition

IObjectDefinition:

IObjectDefinitionMetadata

IObjectDefinitionMetadata:

IObjectDefinitionRegistry

IObjectDefinitionRegistry:

IObjectFactory

IObjectFactory:

IPipelineContext

IPipelineContext:

IPipelineContext

IPipelineContext:

IPipelineHandler

IPipelineHandler:

IPipelineHandler

IPipelineHandler:

IPipelineOptions

IPipelineOptions:

IPipelineOptions

IPipelineOptions:

IPipelineResult

IPipelineResult:

IPipelineResult

IPipelineResult:

IProperties

IProperties:

IResolverHandler

IResolverHandler:

IResource

IResource:

IValveHandler

IValveHandler:

IValveHandler

IValveHandler:

KEYS

KEYS:

LightFramework

LightFramework:

Locale

Locale:

MIDWAY_LOGGER_WRITEABLE_DIR

MIDWAY_LOGGER_WRITEABLE_DIR:

MidwayConfigService

MidwayConfigService:

MidwayContainer

MidwayContainer:

MidwayContextLogger

MidwayContextLogger:

MidwayEnvironmentService

MidwayEnvironmentService:

MidwayFrameworkType

MidwayFrameworkType:

MidwayInformationService

MidwayInformationService:

MidwayProcessTypeEnum

MidwayProcessTypeEnum:

MidwayRequestContainer

MidwayRequestContainer:

ObjectDefinitionOptions

ObjectDefinitionOptions:

ObjectDependencyTree

ObjectDependencyTree:

ObjectIdentifier

ObjectIdentifier:

PathFileUtil

PathFileUtil:

REQUEST_CTX_KEY

REQUEST_CTX_KEY:

REQUEST_OBJ_CTX_KEY

REQUEST_OBJ_CTX_KEY:

RouterCollectorOptions

RouterCollectorOptions:

RouterInfo

RouterInfo:

RouterPriority

RouterPriority:

ScopeEnum

ScopeEnum:

ServerlessTriggerCollector

ServerlessTriggerCollector:

ServiceFactory

ServiceFactory:

VALUE_TYPE

VALUE_TYPE:

WebRouterCollector

WebRouterCollector:

attachClassMetadata

attachClassMetadata:

attachMethodDataToClass

attachMethodDataToClass:

attachMethodMetadata

attachMethodMetadata:

attachPropertyDataToClass

attachPropertyDataToClass:

attachPropertyMetadata

attachPropertyMetadata:

classNamed

classNamed:

classToPlain

classToPlain:

clearAllModule

clearAllModule:

clearContainerCache

clearContainerCache:

createConfiguration

createConfiguration:

createMidwayLogger

createMidwayLogger:

delegateTargetMethod

delegateTargetMethod:

delegateTargetProperties

delegateTargetProperties:

delegateTargetPrototypeMethod

delegateTargetPrototypeMethod:

extractExpressLikeValue

extractExpressLikeValue:

extractKoaLikeValue

extractKoaLikeValue:

generateProvideId

generateProvideId:

getClassMetadata

getClassMetadata:

getCurrentApplicationContext

getCurrentApplicationContext:

getCurrentMainApp

getCurrentMainApp:

getCurrentMainFramework

getCurrentMainFramework:

getMethodDataFromClass

getMethodDataFromClass:

getMethodMetadata

getMethodMetadata:

getObjectDefinition

getObjectDefinition:

getParamNames

getParamNames:

getPropertyDataFromClass

getPropertyDataFromClass:

getPropertyMetadata

getPropertyMetadata:

getProviderId

getProviderId:

listMethodDataFromClass

listMethodDataFromClass:

listModule

listModule:

listPreloadModule

listPreloadModule:

listPropertyDataFromClass

listPropertyDataFromClass:

plainToClass

plainToClass:

providerWrapper

providerWrapper:

resetModule

resetModule:

safeRequire

safeRequire:

safelyGet

safelyGet:

saveClassMetadata

saveClassMetadata:

saveMethodDataToClass

saveMethodDataToClass:

saveMethodMetadata

saveMethodMetadata:

saveModule

saveModule:

savePreloadModule

savePreloadModule:

savePropertyDataToClass

savePropertyDataToClass:

savePropertyMetadata

savePropertyMetadata:

Type aliases

HandlerFunction

HandlerFunction: function

Type declaration

    • (handlerKey: string, instance?: any): any
    • Parameters

      • handlerKey: string
      • Optional instance: any

      Returns any

IMidwayApplication

IMidwayApplication<T, FrameworkApplication>: IMidwayBaseApplication<T> & FrameworkApplication

Type parameters

IMidwayContext

IMidwayContext<FrameworkContext>: Context & FrameworkContext

Type parameters

  • FrameworkContext

Locale

Locale: string

Variables

Const DEFAULT_IGNORE_PATTERN

DEFAULT_IGNORE_PATTERN: string[] = ['**/**.d.ts','**/logs/**','**/run/**','**/public/**','**/app/view/**','**/app/views/**','**/app/extend/**','**/node_modules/**','**/**.test.ts','**/**.test.js','**/__test__/**',]

Const DEFAULT_PATTERN

DEFAULT_PATTERN: string[] = ['**/**.ts', '**/**.tsx', '**/**.js']

Const FUNCTION_INJECT_KEY

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

Const HTTP_SERVER_KEY

HTTP_SERVER_KEY: "_midway_http_server" = "_midway_http_server"

Const MIDWAY_LOGGER_WRITEABLE_DIR

MIDWAY_LOGGER_WRITEABLE_DIR: "MIDWAY_LOGGER_WRITEABLE_DIR" = "MIDWAY_LOGGER_WRITEABLE_DIR"

Const PREFIX

PREFIX: "_id_default_" = "_id_default_"

Const REQUEST_CTX_KEY

REQUEST_CTX_KEY: "ctx" = "ctx"

Const REQUEST_OBJ_CTX_KEY

REQUEST_OBJ_CTX_KEY: "_req_ctx" = "_req_ctx"

Let containerIdx

containerIdx: number = 0

Const debug

debug: DebugLogger = debuglog('midway:container:util')

Const debug

debug: DebugLogger = util.debuglog('midway:container:configuration')

Const debug

debug: DebugLogger = util.debuglog('midway:config')

Const debug

debug: DebugLogger = util.debuglog('midway:managedresolver')

Const debug

debug: DebugLogger = util.debuglog('midway:container')

Const debugLogger

debugLogger: DebugLogger = util.debuglog('midway:container:aspect')

Const functionPrototype

functionPrototype: any = Object.getPrototypeOf(Function)

Const globalDebugLogger

globalDebugLogger: DebugLogger = util.debuglog('midway:container')

Const isArray

isArray: isArray = Array.isArray

Functions

buildLoadDir

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

buildLoadDir

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

clearContainerCache

  • clearContainerCache(): void

Const createConfiguration

Const createMidwayLogger

  • createMidwayLogger(framework: IMidwayFramework<any, any>, name: string, options?: LoggerOptions): ILogger

delegateTargetMethod

  • delegateTargetMethod(derivedCtor: any, methods: string[]): void

delegateTargetProperties

  • delegateTargetProperties(derivedCtor: any, properties: string[]): void

delegateTargetPrototypeMethod

  • delegateTargetPrototypeMethod(derivedCtor: any, constructors: any[]): void
  • 代理目标所有的原型方法,不包括构造器和内部隐藏方法

    Parameters

    • derivedCtor: any
    • constructors: any[]

    Returns void

Const extractExpressLikeValue

  • extractExpressLikeValue(key: any, data: any): (Anonymous function)

Const extractKoaLikeValue

  • extractKoaLikeValue(key: any, data: any): (Anonymous function)

Const getCurrentApplicationContext

Const getCurrentEnvironment

  • getCurrentEnvironment(): string

Const getCurrentMainApp

  • getCurrentMainApp<APP>(): APP

Const getCurrentMainFramework

getOwnMetadata

  • getOwnMetadata(metadataKey: any, target: any, propertyKey?: string | symbol): ReflectResult

getUserHome

  • getUserHome(): string

Const isDevelopmentEnvironment

  • isDevelopmentEnvironment(env: any): boolean

joinURLPath

  • joinURLPath(...strArray: any[]): string

ordinaryGetPrototypeOf

  • ordinaryGetPrototypeOf(O: any): any

parsePrefix

  • parsePrefix(provideId: string): string

pipelineFactory

providerWrapper

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

recursiveGetMetadata

  • recursiveGetMetadata(metadataKey: any, target: any, propertyKey?: string | symbol): ReflectResult[]
  • get metadata value of a metadata key on the prototype chain of an object and property

    Parameters

    • metadataKey: any

      metadata's key

    • target: any

      the target of metadataKey

    • Optional propertyKey: string | symbol

    Returns ReflectResult[]

recursiveGetPrototypeOf

  • recursiveGetPrototypeOf(target: any): any[]

Const safeRequire

  • safeRequire(p: any, enabledCache?: boolean): any

safelyGet

  • safelyGet(list: string | string[], obj?: Record<string, unknown>): 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: Record<string, unknown>

    Returns any

setupAppDir

  • setupAppDir(baseDir: string): string

Object literals

Const KEYS

KEYS: object

静态参数

AROUND_ELEMENT

AROUND_ELEMENT: string = "around"

ASPECT_ELEMENT

ASPECT_ELEMENT: string = "aspect"

ASYNC_ATTRIBUTE

ASYNC_ATTRIBUTE: string = "async"

AUTOWIRE_ATTRIBUTE

AUTOWIRE_ATTRIBUTE: string = "autowire"

CONFIGURATION_ELEMENT

CONFIGURATION_ELEMENT: string = "configuration"

CONSTRUCTORARG_ELEMENT

CONSTRUCTORARG_ELEMENT: string = "constructor-arg"

DIRECT_ATTRIBUTE

DIRECT_ATTRIBUTE: string = "direct"

ENTRY_ELEMENT

ENTRY_ELEMENT: string = "entry"

EXECUTE_ATTRIBUTE

EXECUTE_ATTRIBUTE: string = "execute"

EXPRESSION_ATTRIBUTE

EXPRESSION_ATTRIBUTE: string = "expression"

EXTERNAL_ATTRIBUTE

EXTERNAL_ATTRIBUTE: string = "external"

ID_ATTRIBUTE

ID_ATTRIBUTE: string = "id"

IMPORT_ELEMENT

IMPORT_ELEMENT: string = "import"

JSON_ELEMENT

JSON_ELEMENT: string = "json"

KEY_ATTRIBUTE

KEY_ATTRIBUTE: string = "key"

LIST_ELEMENT

LIST_ELEMENT: string = "list"

MAP_ELEMENT

MAP_ELEMENT: string = "map"

NAME_ATTRIBUTE

NAME_ATTRIBUTE: string = "name"

OBJECTS_ELEMENT

OBJECTS_ELEMENT: string = "objects"

OBJECT_ATTRIBUTE

OBJECT_ATTRIBUTE: string = "object"

OBJECT_ELEMENT

OBJECT_ELEMENT: string = "object"

PATH_ATTRIBUTE

PATH_ATTRIBUTE: string = "path"

PROPERTY_ELEMENT

PROPERTY_ELEMENT: string = "property"

PROPS_ELEMENT

PROPS_ELEMENT: string = "props"

PROP_ELEMENT

PROP_ELEMENT: string = "prop"

REF_ATTRIBUTE

REF_ATTRIBUTE: string = "ref"

REF_ELEMENT

REF_ELEMENT: string = "ref"

RESOURCE_ATTRIBUTE

RESOURCE_ATTRIBUTE: string = "resource"

SCOPE_ATTRIBUTE

SCOPE_ATTRIBUTE: string = "scope"

SET_ELEMENT

SET_ELEMENT: string = "set"

TYPE_ATTRIBUTE

TYPE_ATTRIBUTE: string = "type"

VALUE_ATTRIBUTE

VALUE_ATTRIBUTE: string = "value"

VALUE_ELEMENT

VALUE_ELEMENT: string = "value"

Const PathFileUtil

PathFileUtil: object

getFileContentSync

  • getFileContentSync(filePath: any, encoding?: BufferEncoding): any

isPath

  • isPath(p: any): boolean

isPathEqual

  • isPathEqual(one: string, two: string): boolean

Const VALUE_TYPE

VALUE_TYPE: object

BOOLEAN

BOOLEAN: string = "boolean"

DATE

DATE: string = "date"

INTEGER

INTEGER: string = "int"

MANAGED

MANAGED: string = "managed"

NUMBER

NUMBER: string = "number"

OBJECT

OBJECT: string = "object"

STRING

STRING: string = "string"

TEMPLATE

TEMPLATE: string = "template"

Const noop

noop: object

debug

  • debug(): void

error

  • error(): void

info

  • info(): void

warn

  • warn(): void

write

  • write(): void

Generated using TypeDoc