1
- export interface Note {
2
- title : string ;
3
- text : string ;
4
- }
1
+ import type { CommitBase , CommitReference } from 'conventional-commits-parser' ;
2
+ import type {
3
+ Context as ContextBase ,
4
+ TemplatesOptions ,
5
+ Options as WriterOptionsBase ,
6
+ } from 'conventional-changelog-writer' ;
7
+
8
+ export type { ParserOptions } from 'conventional-commits-parser' ;
5
9
6
- export interface Reference {
7
- action : string ;
8
- owner : string | null ;
9
- repository : string | null ;
10
- issue : string ;
11
- raw : string ;
12
- prefix : string ;
10
+ export interface Reference extends CommitReference {
13
11
// Beemo
14
- issueLink : string ;
15
- source : string ;
12
+ issueLink ? : string ;
13
+ source ? : string ;
16
14
}
17
15
18
16
export type CommitType =
@@ -64,15 +62,8 @@ export interface Group {
64
62
types : CommitType [ ] ;
65
63
}
66
64
67
- export interface Commit {
68
- body : string | null ;
69
- footer : string | null ;
70
- header : string ;
71
- mentions : string [ ] ;
72
- merge : string | null ;
73
- notes : Note [ ] ;
65
+ export interface Commit extends CommitBase {
74
66
references : Reference [ ] ;
75
- revert : Record < string , string > | null ;
76
67
// Beemo
77
68
hash : string ;
78
69
hashLink : string ;
@@ -84,80 +75,14 @@ export interface Commit {
84
75
type : CommitType ;
85
76
}
86
77
87
- export interface Context {
88
- commit : string ;
89
- date : string ;
90
- host : string ;
91
- isPatch : boolean ;
92
- isMinor : boolean ;
93
- isMajor : boolean ;
94
- issue : string ;
95
- linkReferences : boolean ;
96
- options : Record < string , unknown > ;
97
- owner : string ;
98
- repository : string ;
99
- repoUrl : string ;
100
- title : string ;
101
- version : string ;
102
- // Beemo
103
- headerLevel ?: '#' | '##' | '###' ;
78
+ export interface Context extends ContextBase < Commit > {
104
79
groupEmojis ?: { [ K in CommitGroupLabel ] : string } ;
80
+ headerLevel ?: '#' | '##' | '###' ;
81
+ isMinor ?: boolean ;
82
+ isMajor ?: boolean ;
83
+ options ?: Record < string , unknown > ;
105
84
}
106
85
107
- export type Pattern = RegExp | string | null ;
108
-
109
- export type Correspondence = string [ ] | string ;
110
-
111
- export type Sorter < T > = string [ ] | string | ( ( a : T , b : T ) => number ) ;
112
-
113
- export interface ParserOptions {
114
- fieldPattern : Pattern ;
115
- headerPattern : Pattern ;
116
- headerCorrespondence : Correspondence ;
117
- issuePrefixes : string [ ] | string ;
118
- mergePattern : Pattern ;
119
- mergeCorrespondence : Correspondence ;
120
- noteKeywords : string [ ] | string ;
121
- referenceActions : string [ ] | string | null ;
122
- revertPattern : Pattern ;
123
- revertCorrespondence : Correspondence ;
124
- warn : boolean | ( ( ) => void ) ;
125
- }
126
-
127
- export interface WriterOptions {
128
- commitGroupsSort : Sorter < {
129
- title : CommitGroupLabel ;
130
- commits : Commit [ ] ;
131
- } > ;
132
- commitPartial : string ;
133
- commitsSort : Sorter < Commit > ;
134
- debug : ( ) => void ;
135
- doFlush : boolean ;
136
- finalizeContext :
137
- | ( ( context : Context , options : WriterOptions , commits : Commit [ ] , keyCommit : Commit ) => Context )
138
- | undefined ;
139
- footerPartial : string ;
140
- generateOn :
141
- | string
142
- | ( ( commit : Commit , commits : Commit [ ] , context : Context , options : WriterOptions ) => unknown ) ;
143
- groupBy : string ;
144
- headerPartial : string ;
145
- ignoreReverted : boolean ;
146
- includeDetails : boolean ;
147
- mainTemplate : string ;
148
- noteGroupsSort : Sorter < {
149
- title : string ;
150
- notes : Note [ ] ;
151
- } > ;
152
- notesSort : Sorter < Note > ;
153
- partials : Record < string , unknown > ;
154
- reverse : boolean ;
155
- transform : ( commit : Commit , context : Context ) => Commit | undefined ;
156
- }
157
-
158
- export type SemverLevel = 0 | 1 | 2 | null ; // major | minor | patch
159
-
160
- export interface BumpOptions {
161
- parserOpts : Partial < ParserOptions > ;
162
- whatBump : ( commits : Commit [ ] ) => { level : SemverLevel ; reason : string } ;
86
+ export interface WriterOptions extends WriterOptionsBase < Commit > , TemplatesOptions {
87
+ includeDetails ?: boolean ;
163
88
}
0 commit comments