UNPKG

720 BPlain TextView Raw
1import { ChildProcess } from 'child_process';
2
3const EMPTY_STRING = '';
4
5export interface Project
6{
7 name: string
8
9 cwd: string;
10
11 command: string;
12
13 args?: string[];
14
15 enabled?: boolean;
16
17 delay?: number;
18
19 currentProcess?: ChildProcess;
20}
21
22export interface Play
23{
24 name: string;
25 projects?: Project[];
26}
27
28export interface ProjectHandler
29{
30 name: string;
31
32 desc: string;
33
34 files: string[];
35
36 /**
37 * Checks whether a found project matches this handler.
38 */
39 extract(path: string, content: string): Project[];
40}
41
42export function playToString(play: Play): string {
43 if (!play) return EMPTY_STRING;
44 return `${play.name} (${(play.projects || []).length})`;
45}
\No newline at end of file