forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-environment.d.ts
52 lines (47 loc) · 1.25 KB
/
angular-environment.d.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Type definitions for angular-environment v1.0.4
// Project: https://github.com/juanpablob/angular-environment
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
// Definitions: https://github.com/LiberisLabs
declare namespace angular.environment {
interface ServiceProvider {
/**
* Sets the configuration object
*/
config: (config: angular.environment.Config) => void;
/**
* Evaluates the current domain and
* loads the correct environment variables.
*/
check: () => void;
}
interface Service {
/**
* Retrieve the current environment
*/
get: () => string,
/**
* Force sets the current environment
*/
set: (environment: string) => void,
/**
* Evaluates current environment against
* environment parameter.
*/
is: (environment: string) => boolean,
/**
* Retrieves the correct version of a
* variable for the current environment.
*/
read: (key: string) => any;
}
interface Config {
/**
* Map of domains to their environments
*/
domains: { [environment: string]: Array<string> },
/**
* List of variables split by environment
*/
vars: { [environment: string]: { [variable: string]: any }},
}
}