UNPKG

6.32 kBTypeScriptView Raw
1import { CrossbowConfiguration } from "./config";
2import { CrossbowInput, CLI } from "./index";
3import { ExternalFile, ExternalFileInput, ExternalFileContent, HashDirErrorTypes } from "./file.utils";
4import { TaskReport } from "./task.runner";
5import { CommandTrigger } from "./command.run";
6import { SequenceItem } from "./task.sequence.factories";
7import { InitConfigFileExistsError, InitConfigFileTypeNotSupported } from "./command.init";
8import { ParsedPath } from "path";
9import { Task, TaskCollection } from "./task.resolve";
10import { WatchTask, Watcher, WatchTasks } from "./watch.resolve";
11import { DocsInputFileNotFoundError, DocsOutputFileExistsError } from "./command.docs";
12import Rx = require("rx");
13import { WatchEvent } from "./watch.file-watcher";
14import { TaskCommandSetup } from "./command.tasks";
15import { WatchersCommandOutput } from "./command.watchers";
16import { InputError } from "./task.utils";
17export interface Reporter {
18 errors: {}[];
19 type: ReporterTypes;
20 callable?: Function;
21 sources: ExternalFile[];
22}
23export declare enum ReporterErrorTypes {
24 ReporterFileNotFound,
25 ReporterTypeNotSupported,
26}
27export interface ReporterError {
28 type: ReporterErrorTypes;
29 file?: ExternalFile;
30}
31export interface ReporterFileNotFoundError extends ReporterError {
32}
33export interface ReporterTypeNotSupportedError extends ReporterError {
34}
35export declare enum ReporterTypes {
36 InlineFunction,
37 ExternalFile,
38 UnsupportedValue,
39 Muted,
40}
41export interface Reporters {
42 all: Reporter[];
43 valid: Reporter[];
44 invalid: Reporter[];
45}
46export declare enum ReportTypes {
47 DuplicateInputFile,
48 InputFileCreated,
49 InitInputFileTypeNotSupported,
50 InputError,
51 BinOptionError,
52 InputFileNotFound,
53 InvalidReporter,
54 InvalidBinDirectory,
55 UsingInputFile,
56 TaskList,
57 TaskTree,
58 TaskErrors,
59 TaskReport,
60 NoTasksAvailable,
61 NoTasksProvided,
62 SimpleTaskList,
63 BeforeWatchTaskErrors,
64 BeforeTaskList,
65 BeforeTasksDidNotComplete,
66 BeforeTasksSummary,
67 WatchTaskTasksErrors,
68 WatchTaskErrors,
69 WatchTaskReport,
70 NoFilesMatched,
71 NoWatchersAvailable,
72 NoWatchTasksProvided,
73 Watchers,
74 WatcherNames,
75 WatcherTriggeredTasksCompleted,
76 WatcherTriggeredTasks,
77 WatcherSummary,
78 DocsAddedToFile,
79 DocsGenerated,
80 DocsInputFileNotFound,
81 DocsOutputFileExists,
82 DocsInvalidTasksSimple,
83 HashDirError,
84 Summary,
85 SignalReceived,
86 CLIParserOutput,
87}
88export interface IncomingReport {
89 type: ReportTypes;
90 data?: any;
91}
92export interface OutgoingReport {
93 origin: ReportTypes;
94 data: string[];
95}
96export interface UsingConfigFileReport {
97 sources: ExternalFileInput[];
98}
99export interface InputFileNotFoundReport {
100 sources: ExternalFileInput[];
101}
102export interface InputErrorReport {
103 errors: any[];
104 sources: ExternalFileInput[];
105}
106export interface TaskReportReport {
107 report: TaskReport;
108 config: CrossbowConfiguration;
109}
110export interface SignalReceivedReport {
111 code: number;
112}
113export interface SummaryReport {
114 sequence: SequenceItem[];
115 cli: CLI;
116 config: CrossbowConfiguration;
117 runtime: number;
118 errors: TaskReport[];
119}
120export interface BeforeTasksSummaryReport {
121 sequence: SequenceItem[];
122 cli: CLI;
123 config: CrossbowConfiguration;
124 runtime: number;
125 errors: TaskReport[];
126}
127export interface WatcherSummaryReport {
128 sequence: SequenceItem[];
129 cli: CLI;
130 config: CrossbowConfiguration;
131 runtime: number;
132 errors: TaskReport[];
133 watchEvent: WatchEvent;
134 watcher: Watcher;
135}
136export interface TaskListReport {
137 sequence: SequenceItem[];
138 cli: CLI;
139 titlePrefix: string;
140 config: CrossbowConfiguration;
141}
142export interface SimpleTaskListReport {
143 setup: TaskCommandSetup;
144}
145export interface BinDirectoryLookup {
146 errors: InputError[];
147 input: string;
148 resolved: string;
149}
150export interface InvalidBinDirectoryReport {
151 lookups: {
152 all: BinDirectoryLookup[];
153 valid: BinDirectoryLookup[];
154 invalid: BinDirectoryLookup[];
155 };
156}
157export interface InvalidReporterReport {
158 reporters: Reporters;
159}
160export interface DuplicateConfigFile {
161 error: InitConfigFileExistsError;
162}
163export interface ConfigFileCreatedReport {
164 parsed: ParsedPath;
165}
166export interface InitInputFileTypeNotSupportedReport {
167 error: InitConfigFileTypeNotSupported;
168}
169export interface TaskTreeReport {
170 tasks: Task[];
171 config: CrossbowConfiguration;
172 title: string;
173}
174export interface TaskErrorsReport {
175 tasks: Task[];
176 taskCollection: TaskCollection;
177 input: CrossbowInput;
178 config: CrossbowConfiguration;
179}
180export interface WatchersReport {
181 watchTasks: WatchTask[];
182}
183export interface BeforeWatchTaskErrorsReport {
184 watchTasks: WatchTasks;
185 trigger: CommandTrigger;
186}
187export interface BeforeTaskListReport {
188 sequence: SequenceItem[];
189 cli: CLI;
190 config: CrossbowConfiguration;
191}
192export interface BeforeTasksDidNotCompleteReport {
193 error: Error;
194}
195export interface WatchTaskTasksErrorsReport {
196 tasks: Task[];
197 runner: Watcher;
198 config: CrossbowConfiguration;
199}
200export interface WatchTaskErrorsReport {
201 watchTasks: WatchTask[];
202}
203export interface WatchTaskReportReport {
204 report: TaskReport;
205 trigger: CommandTrigger;
206}
207export interface WatcherTriggeredTasksReport {
208 index: number;
209 taskCollection: TaskCollection;
210}
211export interface WatcherTriggeredTasksCompletedReport {
212 index: number;
213 taskCollection: TaskCollection;
214 time: number;
215}
216export interface WatcherNamesReport {
217 setup: WatchersCommandOutput;
218}
219export interface NoFilesMatchedReport {
220 watcher: Watcher;
221}
222export interface DocsInputFileNotFoundReport {
223 error: DocsInputFileNotFoundError;
224}
225export interface DocsAddedToFileReport {
226 file: ExternalFileContent;
227}
228export interface DocsOutputFileExistsReport {
229 error: DocsOutputFileExistsError;
230}
231export interface HashError extends Error {
232 type: HashDirErrorTypes;
233}
234export interface HashDirErrorReport {
235 error: HashError;
236 cwd: string;
237}
238export declare function getReporters(config: CrossbowConfiguration): Reporters;
239export declare type OutgoingReporter = Rx.Subject<OutgoingReport>;
240export declare function getDefaultReporter(): any;