UNPKG

2.02 kBTypeScriptView Raw
1import { AsyncSeriesBailHook, AsyncSeriesWaterfallHook } from "tapable";
2import { ILogger } from "./utils/logger";
3import { AutoRc, RepoInformation, AuthorInformation, PluginConfig } from "./types";
4export interface InteractiveInitHooks {
5 /** Override where/how the rc file is written */
6 writeRcFile: AsyncSeriesBailHook<[AutoRc], true | void>;
7 /** Get or verify the repo information */
8 getRepo: AsyncSeriesBailHook<[], RepoInformation | true | void>;
9 /** Get or verify the author information */
10 getAuthor: AsyncSeriesBailHook<[], AuthorInformation | true | void>;
11 /** Run extra configuration for a plugin */
12 configurePlugin: AsyncSeriesBailHook<[string], PluginConfig | void>;
13 /** Add environment variables to get from the user */
14 createEnv: AsyncSeriesWaterfallHook<[Array<{
15 /** The name of the env var */
16 variable: string;
17 /** The message to ask the user for the the env var */
18 message: string;
19 }>]>;
20}
21/**
22 * Parse the gitlog for commits that are PRs and attach their labels.
23 * This class can also be tapped into via plugin to parse commits
24 * in other ways (ex: conventional-commits)
25 */
26export default class InteractiveInit {
27 /** Plugin entry points */
28 hooks: InteractiveInitHooks;
29 /** The logger for the initializer */
30 logger: ILogger;
31 /** Initialize the the init prompter and tap the default functionality */
32 constructor(options: {
33 /** The logger for the initializer */
34 logger: ILogger;
35 });
36 /** Run a prompt to get the author information */
37 getAuthorInformation(): Promise<{
38 name?: string | undefined;
39 email?: string | undefined;
40 }>;
41 /** Run a prompt to get the repo information */
42 getRepoInformation(): Promise<{
43 repo?: string | undefined;
44 owner?: string | undefined;
45 }>;
46 /** Load the default behavior */
47 private tapDefaults;
48 /** Run the initialization. */
49 run(): Promise<void>;
50}
51//# sourceMappingURL=init.d.ts.map
\No newline at end of file