UNPKG

2 kBTypeScriptView Raw
1export declare enum EnvType {
2 development = "development",
3 test = "test",
4 production = "production",
5}
6export declare const root: string;
7/**
8 * Retrieves a string that represents the name of a branch in git for a
9 * mode.
10 *
11 * - development => "develop"
12 * - test => "master"
13 * - production => "v##.##.##"
14 */
15export declare function getBranch(): string;
16/**
17 * Retrieves the environment mode type. There are three types:
18 *
19 * - development
20 * - test
21 * - production
22 *
23 * It will first try to get the type from the NODE_ENV variable. If this
24 * is not found, then it will look for the a command line argument for the
25 * type. If this is not found, then the default of "development" is
26 * returned.
27 */
28export declare function getMode(): string;
29/**
30 * Checks if the environment is development.
31 * @returns {boolean} returns true if development, otherwise false.
32 */
33export declare function isDevelopment(): boolean;
34/**
35 * Checks if the environment is testing.
36 * @returns {boolean} returns true if testing, otherwise false.
37 */
38export declare function isTesting(): boolean;
39/**
40 * Checks if the environment is production.
41 * @returns {boolean} returns true if production, otherwise false.
42 */
43export declare function isProduction(): boolean;
44/**
45 * Builds the version label from the environment. It determines the current
46 * git branch, the number of revisions in that branch, and the build number
47 * supplied by Jenkins. If the build number is not found it is set to 0. The
48 * resulting version label is:
49 *
50 * {branch}-r{# of revisions}_b{build number}
51 *
52 * e.g.
53 *
54 * develop-r05_b0
55 *
56 * When this is a production environment type, then the semver from the package
57 * is used to create the version label.
58 *
59 * @returns {string} a string that represnets the
60 */
61export declare function getVersion(): string;
62export declare function show(log?: {
63 (message?: any, ...optionalParams: any[]): void;
64 (message?: any, ...optionalParams: any[]): void;
65}): void;