-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsplit-file.d.ts
More file actions
50 lines (45 loc) · 1.68 KB
/
split-file.d.ts
File metadata and controls
50 lines (45 loc) · 1.68 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
/**
* Type definitions for split-file
* Project: https://github.com/tomvlk/node-split-file
* Definitions: bundled
*/
/**
* Split the given file into the specified number of parts.
*
* @param file Absolute or relative path to the input file.
* @param parts Number of parts to create (must be >= 1).
* @param dest Optional destination directory for the generated parts. Defaults to the input file directory.
* @returns Promise that resolves with an array of full paths to the created part files.
*/
declare function splitFile(
file: string,
parts: number,
dest?: string
): Promise<string[]>;
/**
* Split the given file into multiple parts, each with a maximum size in bytes.
*
* @param file Absolute or relative path to the input file.
* @param maxSize Maximum size (in bytes) for each part. The last part may be smaller.
* @param dest Optional destination directory for the generated parts. Defaults to the input file directory.
* @returns Promise that resolves with an array of full paths to the created part files.
*/
declare function splitFileBySize(
file: string,
maxSize: number,
dest?: string
): Promise<string[]>;
/**
* Merge the specified part files into a single output file.
*
* @param names Array of full paths to the part files, in the correct order.
* @param outputFile Full path to the output file to be written.
* @returns Promise that resolves with the full path to the output file when merging completes.
*/
declare function mergeFiles(names: string[], outputFile: string): Promise<string>;
declare const splitFileModule: {
splitFile: typeof splitFile;
splitFileBySize: typeof splitFileBySize;
mergeFiles: typeof mergeFiles;
};
export = splitFileModule;