UNPKG

1.01 kBTypeScriptView Raw
1import { ICommit } from 'gitlog';
2import { AsyncSeriesBailHook, AsyncSeriesWaterfallHook } from 'tapable';
3export interface ICommitAuthor {
4 name?: string;
5 email?: string;
6 username?: string;
7}
8export interface IPullRequest {
9 number: number;
10 base?: string;
11 body?: string;
12}
13export declare type IExtendedCommit = ICommit & {
14 authors: ICommitAuthor[];
15 pullRequest?: IPullRequest;
16 labels: string[];
17 packages?: string[];
18};
19export declare function parsePR(commit: IExtendedCommit): IExtendedCommit;
20export declare function parseSquashPR(commit: IExtendedCommit): IExtendedCommit;
21export interface ILogParseHooks {
22 parseCommit: AsyncSeriesWaterfallHook<[IExtendedCommit]>;
23 omitCommit: AsyncSeriesBailHook<[IExtendedCommit], boolean | void>;
24}
25export default class LogParse {
26 hooks: ILogParseHooks;
27 constructor();
28 normalizeCommits(commits: ICommit[]): Promise<IExtendedCommit[]>;
29 normalizeCommit(commit: ICommit): Promise<IExtendedCommit | undefined>;
30}