@@ -6,181 +6,24 @@ export declare class AureliaConfiguration {
6
6
private cascade_mode ;
7
7
private _config_object ;
8
8
private _config_merge_object ;
9
- /**
10
- * Set Directory
11
- *
12
- * Sets the location to look for the config file
13
- *
14
- * @param path
15
- */
16
9
setDirectory ( path : string ) : void ;
17
- /**
18
- * Set Config
19
- *
20
- * Sets the filename to look for in the defined directory
21
- *
22
- * @param name
23
- */
24
10
setConfig ( name : string ) : void ;
25
- /**
26
- * Set Environment
27
- *
28
- * Changes the environment value
29
- *
30
- * @param environment
31
- */
32
11
setEnvironment ( environment : string ) : void ;
33
- /**
34
- * Set Environments
35
- *
36
- * Specify multiple environment domains to allow for
37
- * dynamic environment switching.
38
- *
39
- * @param environments
40
- */
41
- setEnvironments ( environments ?: null ) : void ;
42
- /**
43
- * Set Cascade Mode
44
- *
45
- * By default if a environment config value is not found, it will
46
- * go looking up the config file to find it (a la inheritance style). Sometimes
47
- * you just want a config value from a specific environment and nowhere else
48
- * use this to disabled this functionality
49
- *
50
- * @param bool
51
- */
12
+ setEnvironments ( environments ?: any ) : void ;
52
13
setCascadeMode ( bool ?: boolean ) : void ;
53
- /**
54
- * Get Config
55
- * Returns the entire configuration object pulled and parsed from file
56
- *
57
- * @returns {V }
58
- */
59
14
readonly obj : any ;
60
- /**
61
- * Get Config
62
- *
63
- * Get the config file name
64
- *
65
- * @returns {V }
66
- */
67
15
readonly config : string ;
68
- /**
69
- * Is
70
- *
71
- * A method for determining if the current environment
72
- * equals that of the supplied environment value*
73
- * @param environment
74
- * @returns {boolean }
75
- */
76
16
is ( environment : string ) : boolean ;
77
- /**
78
- * Check
79
- * Looks for a match of the hostName to any of the domain
80
- * values specified during the configuration bootstrapping
81
- * phase of Aurelia.
82
- *
83
- */
84
17
check ( ) : void ;
85
- /**
86
- * Environment Enabled
87
- * A handy method for determining if we are using the default
88
- * environment or have another specified like; staging
89
- *
90
- * @returns {boolean }
91
- */
92
18
environmentEnabled ( ) : boolean ;
93
- /**
94
- * Environment Exists
95
- * Checks if the environment section actually exists within
96
- * the configuration file or defaults to default
97
- *
98
- * @returns {boolean }
99
- */
100
19
environmentExists ( ) : boolean ;
101
- /**
102
- * Get
103
- * Gets a configuration value from the main config object
104
- * with support for a default value if nothing found
105
- *
106
- * @param key
107
- * @param defaultValue
108
- * @returns {* }
109
- */
110
- get ( key : string , defaultValue ?: null ) : any ;
111
- /**
112
- * Set
113
- * Saves a config value temporarily
114
- *
115
- * @param key
116
- * @param val
117
- */
20
+ get ( key : string , defaultValue ?: any ) : any ;
118
21
set ( key : string , val : string ) : void ;
119
- /**
120
- * Merge
121
- *
122
- * Allows you to merge in configuration options.
123
- * This method might be used to merge in server-loaded
124
- * configuration options with local ones.
125
- *
126
- * @param obj
127
- *
128
- */
129
22
merge ( obj : { } | any ) : void ;
130
- /**
131
- * Lazy Merge
132
- *
133
- * Allows you to merge in configuration options.
134
- * This method might be used to merge in server-loaded
135
- * configuration options with local ones. The merge
136
- * occurs after the config has been loaded.
137
- *
138
- * @param obj
139
- *
140
- */
141
23
lazyMerge ( obj : { } | any ) : void ;
142
- /**
143
- * Set All
144
- * Sets and overwrites the entire configuration object
145
- * used internally, but also can be used to set the configuration
146
- * from outside of the usual JSON loading logic.
147
- *
148
- * @param obj
149
- */
150
24
setAll ( obj : { } | any ) : void ;
151
- /**
152
- * Get All
153
- * Returns all configuration options as an object
154
- *
155
- * @returns {V }
156
- */
157
25
getAll ( ) : any ;
158
- /**
159
- * Load Config
160
- * Loads the configuration file from specified location,
161
- * merges in any overrides, then returns a Promise.
162
- *
163
- * @returns {Promise }
164
- */
165
26
loadConfig ( ) : Promise < void > ;
166
- /**
167
- * Load Config File
168
- * Loads the configuration file from the specified location
169
- * and then returns a Promise.
170
- *
171
- * @returns {Promise }
172
- */
173
27
loadConfigFile ( path : string , action : Function ) : Promise < { } > ;
174
- /**
175
- * Merge Config File
176
- *
177
- * Allows you to merge in configuration options from a file.
178
- * This method might be used to merge in server-loaded
179
- * configuration options with local ones.
180
- *
181
- * @param path The path to the config file to load.
182
- * @param optional When true, errors encountered while loading the config file will be ignored.
183
- *
184
- */
185
28
mergeConfigFile ( path : string , optional : boolean ) : Promise < { } > ;
186
29
}
0 commit comments