UNPKG

1.07 kBTypeScriptView Raw
1import { Logger } from "oly-core";
2import { FileService } from "./FileService";
3/**
4 * Provide a safe place to store files
5 */
6export declare class WorkspaceProvider {
7 /**
8 * Workspace directory.
9 */
10 readonly directory: string;
11 /**
12 * Temporary directory.
13 */
14 readonly tmp: string;
15 /**
16 * Remove workspace on start.
17 */
18 readonly reset: boolean;
19 /**
20 *
21 */
22 protected logger: Logger;
23 /**
24 *
25 */
26 protected file: FileService;
27 /**
28 * Absolute path of tmp directory.
29 *
30 * @return {string}
31 */
32 readonly tmpDirectory: string;
33 /**
34 * Get the absolute path of a workspace active.
35 *
36 * @param filename Filename or path replace to the workspace
37 */
38 join(filename: string): string;
39 /**
40 * Generate a filepath. Useful for temp file or test.
41 *
42 * @return Random filepath
43 */
44 rand(ext?: string): string;
45 /**
46 *
47 */
48 protected onStart(): Promise<void>;
49 /**
50 *
51 */
52 protected onStop(): Promise<void>;
53}