-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypes.d.ts
109 lines (95 loc) · 2.94 KB
/
types.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* read a file and log exceptions to debug
*/
declare function readFile(file: string, debugFn: (...params: any[]) => any): void;
/**
* parse file for environmental variables
* @param file - filepath to parse
*/
declare function parse(file: string): void;
/**
* parse file for environmental variables and log debug message for duplicate definitions
* @param file - filepath to parse
*/
declare function checkForDuplicates(file: string): void;
/**
* returns all keys in o1 that arent in o2
* @returns array of keys
*/
declare function diff(o1: any, o2: any): any[];
/**
* clears prviously hoisted environment variables from process.env
*/
declare function clear(): void;
/**
* This class provides methods to access the config for Adobe I/O libraries.
*/
declare class ConfigAPI {
/**
* Gets the value for a key in the Config.
* If no parameters are specified, it will return all keys and values of the consolidated Config.
* @param [key = ''] - the key to get the value from
* @param [source] - 'global', 'local', or 'env'. Defaults to searching the consolidated config.
*/
get(key?: string, source?: string): void;
/**
* Set the value for a key in the Config.
* @param key - the key to set the value to
* @param value - the value to save for the key
* @param [local = false] - Set to true to save the value in the local config. Defaults to false (save to global config).
*/
set(key: string, value: string, local?: boolean): void;
/**
* Delete a key and its value in the Config.
* @param key - the key to delete the value from
* @param [local = false] - Set to true to delete the value in the local config. Defaults to false (save to global config).
*/
delete(key: string, local?: boolean): void;
/**
* Reload the Config from all the config file(s)
*/
reload(): void;
/**
* Pipe data from stdin.
*/
getPipedData(): Promise<string>;
/**
* Hoists variables in the ./.env file to process.env
* @param the - dotenv object
*/
dotenv(the: any): void;
}
/**
* Support for mkdir -p.
* @param dir - the folder to create
*/
declare function mkdirp(dir: string): void;
/**
* Get property from object with case insensitivity.
*/
declare function getProp(obj: any, key: string): void;
/**
* Get a value in an object by dot notation.
*/
declare function getValue(key: string, obj: any): any;
/**
* Set a value by dot notation.
*/
declare function setValue(key: string, value: string, obj?: any): any;
/**
* Deep merge a collection of objs returning a new object.
* @param objs - array of objects
*/
declare function merge(...objs: any[][]): any;
/**
* Remove empty leaves from an object.
*/
declare function shake(obj: any): any;
/**
* Deserialise from a file.
*/
declare function loadFile(file: string): any;
/**
* yaml serialise an object to a file.
*/
declare function saveFile(file: string, obj: any, format: string): void;