UNPKG

2.19 kBTypeScriptView Raw
1import { Environment } from "../environment/environment";
2import { Job } from "./job";
3import { File } from "./file";
4export declare class FolderJob extends Job {
5 protected path: string;
6 protected dirname: string;
7 protected basename: string;
8 protected files: File[];
9 /**
10 * FolderJob constructor
11 * @param e
12 * @param path
13 */
14 constructor(e: Environment, path: string);
15 protected getStatistics(): void;
16 /**
17 * Creates file objects for folder contents. Async operation returns a callback on completion.
18 * @param callback
19 */
20 createFiles(callback: any): void;
21 /**
22 * Gets the job name.
23 * @returns {string}
24 */
25 getName(): string;
26 /**
27 * Get the basename.
28 * @returns {string}
29 */
30 getBasename(): string;
31 /**
32 * Get the directory name.
33 * @returns {string}
34 */
35 getDirname(): string;
36 /**
37 * Get the path.
38 * @returns {string}
39 */
40 getPath(): string;
41 /**
42 * Set a new path.
43 * @param path
44 */
45 setPath(path: string): void;
46 /**
47 * Add a file object to the job.
48 * @param file
49 */
50 addFile(file: File): void;
51 /**
52 * Get a file object from the job.
53 * @param index
54 * @returns {File}
55 */
56 getFile(index: number): File;
57 /**
58 * Get all files associated with the job.
59 * @returns {File[]}
60 */
61 getFiles(): File[];
62 /**
63 * Get the number of files in this folder.
64 * @returns {number}
65 */
66 count(): number;
67 /**
68 * Get the extension.
69 * @returns {null}
70 */
71 getExtension(): any;
72 /**
73 * Check if job is a folder.
74 * @returns {boolean}
75 */
76 isFolder(): boolean;
77 /**
78 * Check if job is a file.
79 * @returns {boolean}
80 */
81 isFile(): boolean;
82 /**
83 * Moves a folder to a nest. This is an asynchronous method which provides a callback on completion.
84 * @param destinationNest
85 * @param callback
86 */
87 move(destinationNest: any, callback: any): void;
88 /**
89 * Renames the job folder, leaving its content's names alone.
90 * @param newName
91 */
92 rename(newName: string): void;
93}