-
Notifications
You must be signed in to change notification settings - Fork 568
/
configuration.ts
34 lines (30 loc) 路 1003 Bytes
/
configuration.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { saveClassMetadata, CONFIGURATION_KEY } from '../';
import { IFileDetector } from '../../interface';
export interface IComponentInfo {
component: any;
enabledEnvironment?: string[];
}
export interface ResolveFilter {
pattern: string | RegExp;
filter: (module, filter, bindModule) => any;
ignoreRequire?: boolean;
}
export interface InjectionConfigurationOptions {
imports?: Array<string | IComponentInfo | { Configuration: any }>;
importObjects?: Record<string, unknown>;
importConfigs?:
| Array<{ [environmentName: string]: Record<string, any> }>
| Record<string, any>;
importConfigFilter?: (config: Record<string, any>) => Record<string, any>;
namespace?: string;
detector?: IFileDetector | false;
detectorOptions?: Record<string, any>;
conflictCheck?: boolean;
}
export function Configuration(
options: InjectionConfigurationOptions = {}
): ClassDecorator {
return (target: any) => {
saveClassMetadata(CONFIGURATION_KEY, options, target);
};
}