@@ -24,7 +24,7 @@ interface AxeViolation {
24
24
nodes : { failureSummary : string ; element : HTMLElement } [ ] ;
25
25
}
26
26
27
- declare var respecConfig : any ;
27
+ declare var respecConfig : Conf ;
28
28
interface Window {
29
29
respecVersion : string ;
30
30
respecUI : {
@@ -110,15 +110,42 @@ interface BiblioData {
110
110
etAl ?: boolean ;
111
111
expires : number ;
112
112
}
113
+
114
+ type ProcessFn = ( config : Conf , doc : Document ) => Promise < void > | void ;
115
+
116
+ /** Configuration object type */
113
117
interface Conf {
114
118
authors ?: Person [ ] ;
119
+ /** Object containing bibliographic data */
115
120
biblio : Record < string , BiblioData > ;
116
121
editors ?: Person [ ] ;
117
122
formerEditors ?: Person [ ] ;
123
+ /** Set of informative references */
118
124
informativeReferences : Set < string > ;
119
125
localBiblio ?: Record < string , BiblioData > ;
126
+ /** Set of normative references */
120
127
normativeReferences : Set < string > ;
121
128
shortName : string ;
129
+ preProcess ?: ProcessFn [ ] ;
130
+ postProcess ?: ProcessFn [ ] ;
131
+ afterEnd ?: ProcessFn ;
132
+ specStatus ?: string ;
133
+ wgId ?: string ;
134
+ noToc : boolean ;
135
+
136
+ /** Indicates whether the document is a preview */
137
+ isPreview ?: boolean ;
138
+ /** The pull request number, if applicable */
139
+ prNumber ?: number ;
140
+ /** The URL of the pull request, if applicable */
141
+ prUrl ?: string ;
142
+ /** The GitHub configuration object */
143
+ github ?: {
144
+ /** The URL of the GitHub repository */
145
+ repoURL : string ;
146
+ } ;
147
+ /** The title of the document */
148
+ title ?: string ;
122
149
}
123
150
124
151
type LicenseInfo = {
@@ -159,14 +186,18 @@ type ResourceHintOption = {
159
186
dontRemove ?: boolean ;
160
187
} ;
161
188
189
+ /** Represents a request to the core/xref module */
162
190
module "core/xref" {
163
191
import { IDBPDatabase , DBSchema } from "idb" ;
164
192
193
+ /** Represents a single request entry */
165
194
export interface RequestEntry {
166
195
term : string ;
167
196
id : string ;
168
197
types : string [ ] ;
198
+ /** Spec URLs to restrict the search to */
169
199
specs ?: string [ ] [ ] ;
200
+ /** The context in which the term appears */
170
201
for ?: string ;
171
202
}
172
203
@@ -244,6 +275,40 @@ type DefinitionValidator = (
244
275
pluginName : string
245
276
) => boolean ;
246
277
278
+ declare class RespecError extends Error {
279
+ constructor (
280
+ message : string ,
281
+ pluginName : string ,
282
+ options : {
283
+ isWarning : boolean ;
284
+ elements ?: HTMLElement [ ] ;
285
+ title ?: string ;
286
+ }
287
+ ) ;
288
+ toJSON ( ) : {
289
+ message : string ;
290
+ name : string ;
291
+ plugin : string ;
292
+ hint ?: string ;
293
+ elements ?: any [ ] ;
294
+ title ?: string ;
295
+ details ?: any ;
296
+ stack ?: string ;
297
+ } ;
298
+ }
299
+
300
+ /**
301
+ * Localization strings for different languages.
302
+ *
303
+ */
304
+ type LocalizationStrings = {
305
+ de : Record < string , string > ;
306
+ en : Record < string , string > ;
307
+ ja : Record < string , string > ;
308
+ nl : Record < string , string > ;
309
+ zh : Record < string , string > ;
310
+ } ;
311
+
247
312
interface LinkProps {
248
313
href : string ;
249
314
title : string ;
0 commit comments