UNPKG

6.34 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 EnvFileOptionError,
53 InputFileNotFound,
54 InvalidReporter,
55 InvalidBinDirectory,
56 UsingInputFile,
57 TaskList,
58 TaskTree,
59 TaskErrors,
60 TaskReport,
61 NoTasksAvailable,
62 NoTasksProvided,
63 SimpleTaskList,
64 BeforeWatchTaskErrors,
65 BeforeTaskList,
66 BeforeTasksDidNotComplete,
67 BeforeTasksSummary,
68 WatchTaskTasksErrors,
69 WatchTaskErrors,
70 WatchTaskReport,
71 NoFilesMatched,
72 NoWatchersAvailable,
73 NoWatchTasksProvided,
74 Watchers,
75 WatcherNames,
76 WatcherTriggeredTasksCompleted,
77 WatcherTriggeredTasks,
78 WatcherSummary,
79 DocsAddedToFile,
80 DocsGenerated,
81 DocsInputFileNotFound,
82 DocsOutputFileExists,
83 DocsInvalidTasksSimple,
84 HashDirError,
85 Summary,
86 SignalReceived,
87 CLIParserOutput,
88}
89export interface IncomingReport {
90 type: ReportTypes;
91 data?: any;
92}
93export interface OutgoingReport {
94 origin: ReportTypes;
95 data: string[];
96}
97export interface UsingConfigFileReport {
98 sources: ExternalFileInput[];
99}
100export interface InputFileNotFoundReport {
101 sources: ExternalFileInput[];
102}
103export interface InputErrorReport {
104 errors: any[];
105 sources: ExternalFileInput[];
106}
107export interface TaskReportReport {
108 report: TaskReport;
109 config: CrossbowConfiguration;
110}
111export interface SignalReceivedReport {
112 code: number;
113}
114export interface SummaryReport {
115 sequence: SequenceItem[];
116 cli: CLI;
117 config: CrossbowConfiguration;
118 runtime: number;
119 errors: TaskReport[];
120}
121export interface BeforeTasksSummaryReport {
122 sequence: SequenceItem[];
123 cli: CLI;
124 config: CrossbowConfiguration;
125 runtime: number;
126 errors: TaskReport[];
127}
128export interface WatcherSummaryReport {
129 sequence: SequenceItem[];
130 cli: CLI;
131 config: CrossbowConfiguration;
132 runtime: number;
133 errors: TaskReport[];
134 watchEvent: WatchEvent;
135 watcher: Watcher;
136}
137export interface TaskListReport {
138 sequence: SequenceItem[];
139 cli: CLI;
140 titlePrefix: string;
141 config: CrossbowConfiguration;
142}
143export interface SimpleTaskListReport {
144 setup: TaskCommandSetup;
145}
146export interface BinDirectoryLookup {
147 errors: InputError[];
148 input: string;
149 resolved: string;
150}
151export interface InvalidBinDirectoryReport {
152 lookups: {
153 all: BinDirectoryLookup[];
154 valid: BinDirectoryLookup[];
155 invalid: BinDirectoryLookup[];
156 };
157}
158export interface InvalidReporterReport {
159 reporters: Reporters;
160}
161export interface DuplicateConfigFile {
162 error: InitConfigFileExistsError;
163}
164export interface ConfigFileCreatedReport {
165 parsed: ParsedPath;
166}
167export interface InitInputFileTypeNotSupportedReport {
168 error: InitConfigFileTypeNotSupported;
169}
170export interface TaskTreeReport {
171 tasks: Task[];
172 config: CrossbowConfiguration;
173 title: string;
174}
175export interface TaskErrorsReport {
176 tasks: Task[];
177 taskCollection: TaskCollection;
178 input: CrossbowInput;
179 config: CrossbowConfiguration;
180}
181export interface WatchersReport {
182 watchTasks: WatchTask[];
183}
184export interface BeforeWatchTaskErrorsReport {
185 watchTasks: WatchTasks;
186 trigger: CommandTrigger;
187}
188export interface BeforeTaskListReport {
189 sequence: SequenceItem[];
190 cli: CLI;
191 config: CrossbowConfiguration;
192}
193export interface BeforeTasksDidNotCompleteReport {
194 error: Error;
195}
196export interface WatchTaskTasksErrorsReport {
197 tasks: Task[];
198 runner: Watcher;
199 config: CrossbowConfiguration;
200}
201export interface WatchTaskErrorsReport {
202 watchTasks: WatchTask[];
203}
204export interface WatchTaskReportReport {
205 report: TaskReport;
206 trigger: CommandTrigger;
207}
208export interface WatcherTriggeredTasksReport {
209 index: number;
210 taskCollection: TaskCollection;
211}
212export interface WatcherTriggeredTasksCompletedReport {
213 index: number;
214 taskCollection: TaskCollection;
215 time: number;
216}
217export interface WatcherNamesReport {
218 setup: WatchersCommandOutput;
219}
220export interface NoFilesMatchedReport {
221 watcher: Watcher;
222}
223export interface DocsInputFileNotFoundReport {
224 error: DocsInputFileNotFoundError;
225}
226export interface DocsAddedToFileReport {
227 file: ExternalFileContent;
228}
229export interface DocsOutputFileExistsReport {
230 error: DocsOutputFileExistsError;
231}
232export interface HashError extends Error {
233 type: HashDirErrorTypes;
234}
235export interface HashDirErrorReport {
236 error: HashError;
237 cwd: string;
238}
239export declare function getReporters(config: CrossbowConfiguration): Reporters;
240export declare type OutgoingReporter = Rx.Subject<OutgoingReport>;
241export declare function getDefaultReporter(): any;