Skip to content

Commit

Permalink
fix: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Feb 8, 2020
1 parent d0809fa commit 1d5a7c1
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions packages/midway-core/src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { ObjectIdentifier, IManagedInstance, ScopeEnum, ObjectDefinitionOptions } from '@midwayjs/decorator';
import {
ObjectIdentifier,
IManagedInstance,
ScopeEnum,
ObjectDefinitionOptions,
} from '@midwayjs/decorator';
/**
* 生命周期定义
*/
Expand All @@ -16,7 +21,12 @@ export type Locale = string;
* 多语言支持接口
*/
export interface IMessageSource {
get(code: string, args?: any[], defaultMessage?: string, locale?: Locale): string;
get(
code: string,
args?: any[],
defaultMessage?: string,
locale?: Locale
): string;
}
/**
* 对象容器抽象
Expand Down Expand Up @@ -70,7 +80,10 @@ export interface IObjectCreator {
export interface IObjectDefinitionRegistry {
readonly identifiers: ObjectIdentifier[];
readonly count: number;
registerDefinition(identifier: ObjectIdentifier, definition: IObjectDefinition);
registerDefinition(
identifier: ObjectIdentifier,
definition: IObjectDefinition
);
getSingletonDefinitionIds(): ObjectIdentifier[];
getDefinition(identifier: ObjectIdentifier): IObjectDefinition;
getDefinitionByPath(path: string): IObjectDefinition;
Expand Down Expand Up @@ -151,8 +164,12 @@ export interface IManagedResolver {
* 提供简化的容器绑定能力
*/
export interface IContainer extends IApplicationContext {
bind<T>(target: T, options?: ObjectDefinitionOptions): void ;
bind<T>(identifier: ObjectIdentifier, target: T, options?: ObjectDefinitionOptions): void;
bind<T>(target: T, options?: ObjectDefinitionOptions): void;
bind<T>(
identifier: ObjectIdentifier,
target: T,
options?: ObjectDefinitionOptions
): void;
createChild(): IContainer;
resolve<T>(target: T): T;
registerCustomBinding(objectDefinition: IObjectDefinition, target): void;
Expand Down Expand Up @@ -196,6 +213,6 @@ export interface IEnvironmentService {
setCurrentEnvironment(environment: string);
}

export interface Middleware<T> {
export interface IMiddleware<T> {
resolve: () => (context: T, next: () => Promise<any>) => any;
}

0 comments on commit 1d5a7c1

Please sign in to comment.