forked from finos/SymphonyElectron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-helper.d.ts
More file actions
53 lines (48 loc) · 1.47 KB
/
script-helper.d.ts
File metadata and controls
53 lines (48 loc) · 1.47 KB
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
/**
* Format current size as Bytes to readable unit accordingly as KB, MB, GB....
*
* @param byte @typeDef number - size as bytes
* @return Return {Converted Number} {Unit} as string
*/
export declare function formatSize(byte: number): string;
/**
* Convert Bytes to {unit}
*
* @param unit @typeDef DataMeasurement - which unit we should convert
* @param bytes @typeDef number - input bytes to get converted
*
* @return Return {Converted Number} based on Unit as number
*/
export declare function bytesTo(unit: string, bytes: number): number;
/**
* Recursively get total size of bundle
*
* @param dir as @string - Path to directory
*
* @return total size as number, throw error if dir is invalid
*/
export declare function getTotalSize(dir: string): number;
/**
* Save build meta data to {currentFolderSnapshotFile}
*
* @param data as @object - build meta data
* @param currentFolderSnapshotFile as @string - place to save the metadata file
*
*/
export declare function saveMetaData(data: any, dir: string): void;
/**
* Get general folder and content within sizes
*
* @param dir as @string - directory to read
*
* @returns stats as size of all files. I.E: {'file-001': 100Mb}
*/
export declare function getFolderSizes(dir: string): void;
declare const _default: {
formatSize: typeof formatSize;
bytesTo: typeof bytesTo;
getTotalSize: typeof getTotalSize;
saveMetaData: typeof saveMetaData;
getFolderSizes: typeof getFolderSizes;
};
export default _default;