types-mediawiki-response 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -0
  3. package/README.zh.md +57 -0
  4. package/dist/common/index.d.ts +87 -0
  5. package/dist/core/acquiretempusername.d.ts +17 -0
  6. package/dist/core/block.d.ts +98 -0
  7. package/dist/core/changeauthenticationdata.d.ts +18 -0
  8. package/dist/core/changecontentmodel.d.ts +27 -0
  9. package/dist/core/checktoken.d.ts +28 -0
  10. package/dist/core/clearhasmsg.d.ts +15 -0
  11. package/dist/core/clientlogin.d.ts +48 -0
  12. package/dist/core/compare.d.ts +92 -0
  13. package/dist/core/createaccount.d.ts +41 -0
  14. package/dist/core/delete.d.ts +45 -0
  15. package/dist/core/edit.d.ts +66 -0
  16. package/dist/core/emailuser.d.ts +27 -0
  17. package/dist/core/expandtemplates.d.ts +66 -0
  18. package/dist/core/filerevert.d.ts +20 -0
  19. package/dist/core/imagerotate.d.ts +51 -0
  20. package/dist/core/import.d.ts +29 -0
  21. package/dist/core/index.d.ts +40 -0
  22. package/dist/core/languagesearch.d.ts +24 -0
  23. package/dist/core/login.d.ts +30 -0
  24. package/dist/core/logout.d.ts +16 -0
  25. package/dist/core/managetags.d.ts +28 -0
  26. package/dist/core/mergehistory.d.ts +26 -0
  27. package/dist/core/move.d.ts +62 -0
  28. package/dist/core/options.d.ts +16 -0
  29. package/dist/core/parse.d.ts +324 -0
  30. package/dist/core/patrol.d.ts +21 -0
  31. package/dist/core/protect.d.ts +43 -0
  32. package/dist/core/purge.d.ts +61 -0
  33. package/dist/core/query/allcategories.d.ts +30 -0
  34. package/dist/core/query/alldeletedrevisions.d.ts +29 -0
  35. package/dist/core/query/allfileusages.d.ts +15 -0
  36. package/dist/core/query/allimages.d.ts +25 -0
  37. package/dist/core/query/alllinks.d.ts +34 -0
  38. package/dist/core/query/allmessages.d.ts +43 -0
  39. package/dist/core/query/allpages.d.ts +23 -0
  40. package/dist/core/query/allredirects.d.ts +23 -0
  41. package/dist/core/query/allrevisions.d.ts +30 -0
  42. package/dist/core/query/alltransclusions.d.ts +14 -0
  43. package/dist/core/query/allusers.d.ts +37 -0
  44. package/dist/core/query/authmanagerinfo.d.ts +96 -0
  45. package/dist/core/query/backlinks.d.ts +34 -0
  46. package/dist/core/query/blocks.d.ts +104 -0
  47. package/dist/core/query/categories.d.ts +28 -0
  48. package/dist/core/query/categoryinfo.d.ts +25 -0
  49. package/dist/core/query/categorymembers.d.ts +38 -0
  50. package/dist/core/query/codexicons.d.ts +40 -0
  51. package/dist/core/query/contributors.d.ts +23 -0
  52. package/dist/core/query/deletedrevisions.d.ts +21 -0
  53. package/dist/core/query/deletedrevs.d.ts +84 -0
  54. package/dist/core/query/duplicatefiles.d.ts +30 -0
  55. package/dist/core/query/embeddedin.d.ts +28 -0
  56. package/dist/core/query/extlinks.d.ts +17 -0
  57. package/dist/core/query/exturlusage.d.ts +30 -0
  58. package/dist/core/query/filearchive.d.ts +91 -0
  59. package/dist/core/query/filerepoinfo.d.ts +51 -0
  60. package/dist/core/query/fileusage.d.ts +26 -0
  61. package/dist/core/query/imageinfo.d.ts +214 -0
  62. package/dist/core/query/images.d.ts +20 -0
  63. package/dist/core/query/imageusage.d.ts +36 -0
  64. package/dist/core/query/index.d.ts +489 -0
  65. package/dist/core/query/info.d.ts +208 -0
  66. package/dist/core/query/iwbacklinks.d.ts +28 -0
  67. package/dist/core/query/iwlinks.d.ts +21 -0
  68. package/dist/core/query/langbacklinks.d.ts +28 -0
  69. package/dist/core/query/langlinks.d.ts +32 -0
  70. package/dist/core/query/languageinfo.d.ts +70 -0
  71. package/dist/core/query/links.d.ts +22 -0
  72. package/dist/core/query/linkshere.d.ts +25 -0
  73. package/dist/core/query/logevents.d.ts +77 -0
  74. package/dist/core/query/mystashedfiles.d.ts +39 -0
  75. package/dist/core/query/pagepropnames.d.ts +18 -0
  76. package/dist/core/query/pageprops.d.ts +19 -0
  77. package/dist/core/query/pageswithprop.d.ts +28 -0
  78. package/dist/core/query/prefixsearch.d.ts +27 -0
  79. package/dist/core/query/protectedtitles.d.ts +43 -0
  80. package/dist/core/query/querypage.d.ts +59 -0
  81. package/dist/core/query/random.d.ts +30 -0
  82. package/dist/core/query/recentchanges.d.ts +103 -0
  83. package/dist/core/query/redirects.d.ts +27 -0
  84. package/dist/core/query/revisions.d.ts +176 -0
  85. package/dist/core/query/search.d.ts +141 -0
  86. package/dist/core/query/siteinfo.d.ts +731 -0
  87. package/dist/core/query/stashimageinfo.d.ts +101 -0
  88. package/dist/core/query/tags.d.ts +34 -0
  89. package/dist/core/query/templates.d.ts +20 -0
  90. package/dist/core/query/tokens.d.ts +34 -0
  91. package/dist/core/query/trackingcategories.d.ts +25 -0
  92. package/dist/core/query/transcludedin.d.ts +25 -0
  93. package/dist/core/query/usercontribs.d.ts +72 -0
  94. package/dist/core/query/userinfo.d.ts +141 -0
  95. package/dist/core/query/users.d.ts +164 -0
  96. package/dist/core/query/watchlist.d.ts +109 -0
  97. package/dist/core/query/watchlistraw.d.ts +42 -0
  98. package/dist/core/removeauthenticationdata.d.ts +18 -0
  99. package/dist/core/resetpassword.d.ts +16 -0
  100. package/dist/core/revisiondelete.d.ts +83 -0
  101. package/dist/core/rollback.d.ts +27 -0
  102. package/dist/core/setnotificationtimestamp.d.ts +47 -0
  103. package/dist/core/setpagelanguage.d.ts +24 -0
  104. package/dist/core/stashedit.d.ts +25 -0
  105. package/dist/core/tag.d.ts +49 -0
  106. package/dist/core/upload.d.ts +106 -0
  107. package/dist/core/userrights.d.ts +41 -0
  108. package/dist/core/validatepassword.d.ts +28 -0
  109. package/dist/core/watch.d.ts +45 -0
  110. package/dist/envelope/index.d.ts +122 -0
  111. package/dist/extensions/abusefilters.d.ts +207 -0
  112. package/dist/extensions/babel.d.ts +32 -0
  113. package/dist/extensions/categorytree.d.ts +78 -0
  114. package/dist/extensions/checkuser.d.ts +148 -0
  115. package/dist/extensions/description.d.ts +22 -0
  116. package/dist/extensions/discussiontools.d.ts +273 -0
  117. package/dist/extensions/echo.d.ts +306 -0
  118. package/dist/extensions/extracts.d.ts +24 -0
  119. package/dist/extensions/flaggedrevs.d.ts +192 -0
  120. package/dist/extensions/gadgets.d.ts +148 -0
  121. package/dist/extensions/globalblocks.d.ts +115 -0
  122. package/dist/extensions/globalpreferences.d.ts +62 -0
  123. package/dist/extensions/globalusage.d.ts +41 -0
  124. package/dist/extensions/globaluserinfo.d.ts +95 -0
  125. package/dist/extensions/linter.d.ts +83 -0
  126. package/dist/extensions/massmessage.d.ts +108 -0
  127. package/dist/extensions/oathauth.d.ts +86 -0
  128. package/dist/extensions/pageimages.d.ts +33 -0
  129. package/dist/extensions/pageviews.d.ts +63 -0
  130. package/dist/extensions/scribunto.d.ts +61 -0
  131. package/dist/extensions/sitematrix.d.ts +109 -0
  132. package/dist/extensions/spamblacklist.d.ts +25 -0
  133. package/dist/extensions/templatedata.d.ts +130 -0
  134. package/dist/extensions/thanks.d.ts +29 -0
  135. package/dist/extensions/timedmediahandler.d.ts +121 -0
  136. package/dist/extensions/titleblacklist.d.ts +29 -0
  137. package/dist/extensions/urlshortener.d.ts +42 -0
  138. package/dist/extensions/visualeditor.d.ts +204 -0
  139. package/dist/extensions/wikibase.d.ts +100 -0
  140. package/dist/extensions/wikilove.d.ts +38 -0
  141. package/dist/index.d.ts +3 -0
  142. package/package.json +76 -0
@@ -0,0 +1,731 @@
1
+ /**
2
+ * `meta=siteinfo` — wiki configuration, merged into {@link ApiQueryResult} via
3
+ * declaration merging.
4
+ *
5
+ * The module is a set of sub-object groups selected by `siprop`; every group with
6
+ * a stable shape is modeled below (`statistics`, `usergroups`, `restrictions`,
7
+ * `interwikimap`, `extensions`, `uploaddialog`, …).
8
+ *
9
+ * `general` lists every key the 1.43 core writes (see `ApiQuerySiteinfo::
10
+ * appendGeneralInfo`), so it is closed on purpose: sites and extensions inject
11
+ * further keys, and those are the consumer's to add by declaration merging,
12
+ * like any other extension field.
13
+ *
14
+ * @see https://www.mediawiki.org/wiki/API:Siteinfo
15
+ */
16
+ import type { ContentModel, Flag, Timestamp } from "../../common";
17
+ /**
18
+ * Whether/case-sensitivity of page titles in a namespace. Open union for
19
+ * forward compatibility.
20
+ */
21
+ export type CaseSensitivity = "first-letter" | "case-sensitive" | (string & {});
22
+ /** One namespace entry in `query.namespaces`, keyed by namespace index. */
23
+ export interface ApiNamespaceInfo {
24
+ /** Namespace index. */
25
+ id: number;
26
+ /** Canonical name (e.g. `Talk`), the language-independent identifier. */
27
+ canonical?: string;
28
+ /** Localized name for this wiki. */
29
+ name: string;
30
+ /** Title case-sensitivity within the namespace. */
31
+ case: CaseSensitivity;
32
+ /** Whether subpages are allowed. A real `boolean` under `formatversion=2`. */
33
+ subpages: boolean;
34
+ /** Whether the namespace is a content namespace. A real `boolean`. */
35
+ content: boolean;
36
+ /** Whether pages here are non-includable. A real `boolean`. */
37
+ nonincludable: boolean;
38
+ /**
39
+ * Right required to edit this namespace, e.g. `editinterface` for `MediaWiki:`.
40
+ * Absent when the namespace is unrestricted. A single right, or several joined
41
+ * with `|` when the config lists more than one.
42
+ */
43
+ namespaceprotection?: string;
44
+ /** Default content model for the namespace, e.g. `javascript`. Absent for wikitext. */
45
+ defaultcontentmodel?: ContentModel;
46
+ }
47
+ /**
48
+ * `query.namespaces`: a map from namespace index to its info. Negative indexes
49
+ * are pseudo-namespaces; some indexes are absent (gaps), hence `| undefined`.
50
+ */
51
+ export interface ApiNamespaces {
52
+ [nsIndex: string]: ApiNamespaceInfo | undefined;
53
+ }
54
+ /**
55
+ * Fields of `query.general` (`siprop=general`), closed on the 1.43 core key
56
+ * set — extend by declaration merging for site- or extension-specific keys.
57
+ */
58
+ export interface ApiSiteGeneral {
59
+ /** Main page title. */
60
+ mainpage: string;
61
+ /** Canonical URL of the main page. */
62
+ base: string;
63
+ /** Site name. */
64
+ sitename: string;
65
+ /** Site logo URL. */
66
+ logo: string;
67
+ /** Generator, e.g. `MediaWiki 1.43.0`. */
68
+ generator: string;
69
+ /** PHP version string. */
70
+ phpversion: string;
71
+ /** Title case-sensitivity for the wiki. */
72
+ case: CaseSensitivity;
73
+ /** Content language code, e.g. `en`. */
74
+ lang: string;
75
+ /** Whether the content language is right-to-left. A real `boolean`. */
76
+ rtl: boolean;
77
+ /** Whether the wiki is read-only. A real `boolean`. */
78
+ readonly: boolean;
79
+ /**
80
+ * Whether the write API is enabled. A {@link Flag}.
81
+ *
82
+ * @deprecated since MediaWiki 1.32; the write API can no longer be disabled.
83
+ */
84
+ writeapi: Flag;
85
+ /** Path pattern to an article, with `$1` for the title. */
86
+ articlepath: string;
87
+ /** Path to `index.php`, without the host. */
88
+ scriptpath: string;
89
+ /** Full path to `index.php`. */
90
+ script: string;
91
+ /** Server host (protocol-relative or bare), e.g. `//www.mediawiki.org`. */
92
+ server: string;
93
+ /** Server host name. */
94
+ servername: string;
95
+ /** Wiki id, e.g. `mediawikiwiki`. */
96
+ wikiid: string;
97
+ /** Current server time. */
98
+ time: Timestamp;
99
+ /** Site timezone id. */
100
+ timezone: string;
101
+ /** Timezone offset from UTC in seconds. */
102
+ timeoffset: number;
103
+ /** Maximum article size in bytes. */
104
+ maxarticlesize: number;
105
+ /**
106
+ * Whether the main page is served at the domain root (i.e. `$wgArticlePath`
107
+ * is `/$1`). A real `boolean`.
108
+ */
109
+ mainpageisdomainroot: boolean;
110
+ /** PHP SAPI name, e.g. `apache2handler` / `fpm-fcgi`. */
111
+ phpsapi: string;
112
+ /** DBMS driver, e.g. `sqlite` / `mysql`. */
113
+ dbtype: string;
114
+ /** DBMS server version string. */
115
+ dbversion: string;
116
+ /**
117
+ * Whether the image whitelist is active. A real `boolean`, emitted only while
118
+ * the site disallows inline external images (`$wgAllowExternalImages` off).
119
+ */
120
+ imagewhitelistenabled?: boolean;
121
+ /** Whether language conversion is enabled. A real `boolean`. */
122
+ langconversion: boolean;
123
+ /**
124
+ * Whether title conversion is enabled. A real `boolean`, mirroring
125
+ * {@link linkconversion}.
126
+ *
127
+ * @deprecated Soft-deprecated since MediaWiki 1.36; use `linkconversion`.
128
+ */
129
+ titleconversion: boolean;
130
+ /** Whether interwiki-link conversion is enabled. A real `boolean`. */
131
+ linkconversion: boolean;
132
+ /** Charset allowed for interwiki link prefixes (`""` when unused). */
133
+ linkprefixcharset: string;
134
+ /** Link-prefix regex (legacy; `""` when unused). */
135
+ linkprefix: string;
136
+ /** Regex deciding how much of a link trails into surrounding text. */
137
+ linktrail: string;
138
+ /** Characters legal in page titles, as a regex character class body. */
139
+ legaltitlechars: string;
140
+ /** Characters illegal in usernames. */
141
+ invalidusernamechars: string;
142
+ /** Whether all Unicode normalization fixes are applied. A real `boolean`. */
143
+ allunicodefixes: boolean;
144
+ /**
145
+ * Whether Arabic-specific Unicode fixes are applied. A {@link Flag}.
146
+ *
147
+ * @deprecated since MediaWiki 1.45; the underlying config was removed in 1.35
148
+ * (the field always reported `true`) and is no longer emitted.
149
+ */
150
+ fixarabicunicode?: Flag;
151
+ /**
152
+ * Whether Malayalam-specific Unicode fixes are applied. A {@link Flag}.
153
+ *
154
+ * @deprecated since MediaWiki 1.45; the underlying config was removed in 1.35
155
+ * (the field always reported `true`) and is no longer emitted.
156
+ */
157
+ fixmalayalamunicode?: Flag;
158
+ /**
159
+ * Language fallback chain of the content language, one entry per fallback
160
+ * code. An empty PHP list serializes as `[]`.
161
+ */
162
+ fallback: {
163
+ code: string;
164
+ }[];
165
+ /** Fallback encoding for 8-bit text, e.g. `windows-1252`. */
166
+ fallback8bitEncoding: string;
167
+ /** Language variants of the content language; absent without variant support. */
168
+ variants?: {
169
+ code: string;
170
+ name: string;
171
+ }[];
172
+ /**
173
+ * Why the wiki is read-only; only present while {@link readonly} is `true`.
174
+ */
175
+ readonlyreason?: string;
176
+ /** Whether uploads are enabled. A real `boolean` (`$wgEnableUploads`). */
177
+ uploadsenabled: boolean;
178
+ /**
179
+ * Maximum upload size in bytes; an array `$wgMaxUploadSize` collapses to its
180
+ * `*` entry.
181
+ */
182
+ maxuploadsize: number;
183
+ /** Minimum chunk size for staged uploads, in bytes. */
184
+ minuploadchunksize: number;
185
+ /** Site favicon URL; absent when the site sets no `$wgFavicon`. */
186
+ favicon?: string;
187
+ /**
188
+ * Host prefixes external images may be loaded from; present only when such an
189
+ * allow-list applies (`$wgAllowExternalImagesFrom`).
190
+ */
191
+ externalimages?: string[];
192
+ /** Gallery rendering defaults (`$wgGalleryOptions`). */
193
+ galleryoptions: ApiGalleryOptions;
194
+ /**
195
+ * Selectable thumbnail widths, in pixels, keyed by position. Always an object
196
+ * under `formatversion=2`, even though the value is a list server-side.
197
+ */
198
+ thumblimits: Record<string, number>;
199
+ /** Selectable image-display size presets, keyed by position. Always an object under `formatversion=2`. */
200
+ imagelimits: Record<string, ApiImageLimit>;
201
+ /** Whether `nofollow` is added to external links. A real `boolean`. */
202
+ nofollowlinks: boolean;
203
+ /** Namespaces exempted from {@link nofollowlinks}. */
204
+ nofollownsexceptions: number[];
205
+ /** Domains exempted from {@link nofollowlinks}. */
206
+ nofollowdomainexceptions: string[];
207
+ /**
208
+ * `target` for external links. A real `boolean` (`false`) while the site sets
209
+ * no target, otherwise the attribute string such as `_blank`.
210
+ */
211
+ externallinktarget: string | boolean;
212
+ /** Whether interwiki prefixes may be used as magic links. A real `boolean`. */
213
+ interwikimagic: boolean;
214
+ /** Magic-link keywords and whether each is enabled. */
215
+ magiclinks: Record<string, boolean>;
216
+ /** Method used to look up a user's central account id. */
217
+ centralidlookupprovider: string;
218
+ /** All available central-id lookup providers. */
219
+ allcentralidlookupproviders: string[];
220
+ /** Whether misc (miser-mode) features are enabled. A real `boolean`. */
221
+ misermode: boolean;
222
+ /** Category sort order algorithm, e.g. `uppercase` / `unicode`. */
223
+ categorycollation: string;
224
+ /**
225
+ * `$wgVariantArticlePath` as configured: the URL pattern, or `false` when
226
+ * unset.
227
+ */
228
+ variantarticlepath: string | boolean;
229
+ /** Git branch of the deployment; only present on git checkouts. */
230
+ "git-branch"?: string;
231
+ /** Git commit hash of the deployment; only present on git checkouts. */
232
+ "git-hash"?: string;
233
+ }
234
+ /** `general.galleryoptions`: the site's `$wgGalleryOptions`. */
235
+ export interface ApiGalleryOptions {
236
+ /** Images per row; `0` lets the skin decide. */
237
+ imagesPerRow?: number;
238
+ /** Thumbnail width in pixels. */
239
+ imageWidth?: number;
240
+ /** Thumbnail height in pixels. */
241
+ imageHeight?: number;
242
+ /** Whether captions are length-limited. A real `boolean`. */
243
+ captionLength?: boolean;
244
+ /** Whether file sizes are shown. A real `boolean`. */
245
+ showBytes?: boolean;
246
+ /** Whether dimensions are shown. A real `boolean`. */
247
+ showDimensions?: boolean;
248
+ /** Gallery layout, e.g. `traditional`, `nolines`, `packed`, `modified-packed`. */
249
+ mode?: string;
250
+ }
251
+ /** One entry of `general.imagelimits`: a selectable display size. */
252
+ export interface ApiImageLimit {
253
+ /** Width in pixels. */
254
+ width: number;
255
+ /** Height in pixels. */
256
+ height: number;
257
+ }
258
+ /** Site counters (`siprop=statistics`). */
259
+ export interface ApiSiteStatistics {
260
+ /** Total pages in all namespaces. */
261
+ pages: number;
262
+ /** Pages in content namespaces. */
263
+ articles: number;
264
+ /** Total revisions. */
265
+ edits: number;
266
+ /** Stored files. */
267
+ images: number;
268
+ /** Registered users. */
269
+ users: number;
270
+ /** Users active within the activity window. */
271
+ activeusers: number;
272
+ /** Members of the `sysop` group. */
273
+ admins: number;
274
+ /** Queued jobs. */
275
+ jobs: number;
276
+ }
277
+ /**
278
+ * One user group (`siprop=usergroups`). The right-granting lists come from
279
+ * `$wgAddGroups`/`$wgRemoveGroups`/…, so they are absent when unconfigured.
280
+ */
281
+ export interface ApiUserGroup {
282
+ /** Group key; `*` is the anonymous group. */
283
+ name: string;
284
+ /** Rights granted by the group. */
285
+ rights: string[];
286
+ /** Member count. Only with `sinumberingroup`; absent for `*` and autopromote groups. */
287
+ number?: number;
288
+ /** Groups an admin may add this group to. */
289
+ add?: string[];
290
+ /** Groups an admin may remove this group from. */
291
+ remove?: string[];
292
+ /** Groups a user may grant to themselves. */
293
+ "add-self"?: string[];
294
+ /** Groups a user may revoke from themselves. */
295
+ "remove-self"?: string[];
296
+ }
297
+ /**
298
+ * `siprop=restrictions`: protection types and levels. `levels` is **not** a flat
299
+ * string list — FlaggedRevs registers a protection class as a nested array, so an
300
+ * element can be `string[]` (e.g. `["sreview"]`).
301
+ */
302
+ export interface ApiSiteRestrictions {
303
+ /** Restriction kinds, e.g. `create`, `edit`, `move`, `upload`. */
304
+ types?: string[];
305
+ /** Selectable protection levels; `""` means unrestricted. */
306
+ levels?: (string | string[])[];
307
+ /** Levels that may cascade. */
308
+ cascadinglevels?: string[];
309
+ /** Levels treated as semi-protection. */
310
+ semiprotectedlevels?: string[];
311
+ }
312
+ /** `siprop=rightsinfo`: where to read the site's content-rights statement. */
313
+ export interface ApiRightsInfo {
314
+ /** Rights-page/account URL; empty string when unset (not absent). */
315
+ url?: string;
316
+ /** Link text override; empty string when unset. */
317
+ text?: string;
318
+ }
319
+ /** One localized namespace alias (`siprop=namespacealiases`). */
320
+ export interface ApiNamespaceAlias {
321
+ /** Alias of the namespace this entry belongs to, not a page id. */
322
+ id: number;
323
+ /** The alias, e.g. `Image`. */
324
+ alias: string;
325
+ }
326
+ /** One localized special-page alias (`siprop=specialpagealiases`). */
327
+ export interface ApiSpecialPageAlias {
328
+ /** Canonical page name, e.g. `Ancientpages`. */
329
+ realname: string;
330
+ /** Aliases recognized for it in the content language. */
331
+ aliases: string[];
332
+ }
333
+ /** One uploadable file extension (`siprop=fileextensions`). */
334
+ export interface ApiFileExtension {
335
+ /** Extension without the dot, e.g. `png`. */
336
+ ext: string;
337
+ }
338
+ /**
339
+ * `siprop=extensions`: one installed extension or skin, flattened from
340
+ * `SpecialPage::getCredits`. Keys other than {@link type} appear only when the
341
+ * component's `extension.json` declares them.
342
+ */
343
+ export interface ApiSiteExtension {
344
+ /** Component class, e.g. `skin`, `media`, `parserhook`, `other`. Open union. */
345
+ type: string;
346
+ /** Display name. */
347
+ name?: string;
348
+ /** Message key holding the name. */
349
+ namemsg?: string;
350
+ /** Literal description, when configured. */
351
+ description?: string;
352
+ /** Message key holding the description. */
353
+ descriptionmsg?: string;
354
+ /** Parameters for {@link descriptionmsg}. */
355
+ descriptionmsgparams?: string[];
356
+ /** Authors, joined with `, ` (links are embedded as URLs). */
357
+ author?: string;
358
+ /** Project URL. */
359
+ url?: string;
360
+ /** Declared version. */
361
+ version?: string;
362
+ /** VCS system, e.g. `git`; only for checkout-installed components. */
363
+ "vcs-system"?: string;
364
+ /** VCS commit of the checkout. */
365
+ "vcs-version"?: string;
366
+ /**
367
+ * VCS URL of the checkout; `false` when the repository has no viewable
368
+ * remote URL.
369
+ */
370
+ "vcs-url"?: string | false;
371
+ /** VCS commit date of the checkout. */
372
+ "vcs-date"?: Timestamp;
373
+ /** License identifier from `extension.json`. */
374
+ "license-name"?: string;
375
+ /** URL of `Special:Version/License/<name>`. */
376
+ license?: string;
377
+ /** URL of `Special:Version/Credits/<name>`. */
378
+ credits?: string;
379
+ }
380
+ /** One installed skin (`siprop=skins`). */
381
+ export interface ApiSiteSkin {
382
+ /** Skin key, e.g. `vector-2022`. */
383
+ code: string;
384
+ /** Display name, localized when `skinname-*` exists. */
385
+ name: string;
386
+ /** Present when the skin is the site default. A {@link Flag}. */
387
+ default?: Flag;
388
+ /** Present when the skin is installed but not selectable. A {@link Flag}. */
389
+ unusable?: Flag;
390
+ }
391
+ /** One magic word (`siprop=magicwords`). */
392
+ export interface ApiMagicWord {
393
+ /** Internal name, e.g. `img_lossy`. */
394
+ name: string;
395
+ /** Alias patterns, with `$1` for the argument. */
396
+ aliases: string[];
397
+ /** Whether matching is case-sensitive. A real `boolean`. */
398
+ "case-sensitive": boolean;
399
+ }
400
+ /** One hook and its subscribers (`siprop=showhooks`). */
401
+ export interface ApiShowHook {
402
+ /** Hook name. */
403
+ name?: string;
404
+ /** `Class::method` handlers registered for it. */
405
+ subscribers?: string[];
406
+ }
407
+ /** One database host (`siprop=dbrepllag`). */
408
+ export interface ApiDbReplLag {
409
+ /** Host name; empty string when `$wgShowHostnames` hides it. */
410
+ host: string;
411
+ /** Seconds of lag; `-1` when the host is not a replica. */
412
+ lag: number;
413
+ }
414
+ /** One interwiki prefix (`siprop=interwikimap`). */
415
+ export interface ApiInterwikiMapEntry {
416
+ /** Interwiki prefix, e.g. `mw`. */
417
+ prefix: string;
418
+ /** `true` when links using this prefix are always local (`iw_local`). A {@link Flag}. */
419
+ local?: Flag;
420
+ /** `true` when the prefix may be transcluded (`iw_trans`). A {@link Flag}. */
421
+ trans?: Flag;
422
+ /** URL template, with `$1` for the target title. */
423
+ url: string;
424
+ /** Whether the stored template is protocol-relative. A real `boolean`. */
425
+ protorel: boolean;
426
+ /** Language name, for language-coded prefixes. */
427
+ language?: string;
428
+ /**
429
+ * Current code when {@link prefix} is a deprecated language code.
430
+ *
431
+ * @since MediaWiki 1.40
432
+ */
433
+ deprecated?: string;
434
+ /** BCP 47 form of the language code. */
435
+ bcp47?: string;
436
+ /** Present for a locally defined prefix (`$wgLocalInterwikis`). A {@link Flag}. */
437
+ localinterwiki?: Flag;
438
+ /** Present when the prefix feeds interlanguage links. A {@link Flag}. */
439
+ extralanglink?: Flag;
440
+ /** Effective language code of an `extralanglink` prefix. */
441
+ code?: string;
442
+ /** Link text from `interlanguage-link-<prefix>`. */
443
+ linktext?: string;
444
+ /** Site name from `interlanguage-link-sitename-<prefix>`. */
445
+ sitename?: string;
446
+ /** Wiki id, for `wikiid`-scoped prefixes. */
447
+ wikiid?: string;
448
+ /** API endpoint from the `interwiki` table. */
449
+ api?: string;
450
+ }
451
+ /** One language entry (`siprop=languages`). */
452
+ export interface ApiSiteLanguage {
453
+ /** Language code. */
454
+ code?: string;
455
+ /** BCP 47 form of {@link code}. */
456
+ bcp47?: string;
457
+ /** Localized language name. */
458
+ name?: string;
459
+ }
460
+ /** One language variant and its fallbacks (`siprop=languagevariants`). */
461
+ export interface ApiLanguageVariant {
462
+ /** Variant codes tried before falling back to the base language. */
463
+ fallbacks?: string[];
464
+ }
465
+ /** One software component (`siprop=libraries` / `siprop=clientlibraries`). */
466
+ export interface ApiSoftwareLibrary {
467
+ /** Package name, e.g. `bacon/bacon-qr-code`. */
468
+ name: string;
469
+ /** Installed version. */
470
+ version: string;
471
+ }
472
+ /**
473
+ * One autopromote condition. A group's set is an **object with numeric keys**
474
+ * under fv2 (the PHP array also carries `operand`), so nested sets surface as
475
+ * `"0"`, `"1"`, … entries alongside {@link operand}.
476
+ */
477
+ export interface ApiAutopromoteCondition {
478
+ /** Condition constant name, e.g. `APCOND_EDITCOUNT`. */
479
+ condname?: string;
480
+ /** Arguments for the condition (counts in days, edits, …). */
481
+ params?: unknown[];
482
+ /** Operator combining the set: `&`, `|`, `^`, or `!`. */
483
+ operand?: string;
484
+ /** Nested condition sets, keyed by position. */
485
+ [position: string]: ApiAutopromoteCondition | string | unknown[] | undefined;
486
+ }
487
+ /**
488
+ * Autopromote condition sets keyed by group name (`siprop=autopromote`). A full
489
+ * condition set arrives as a single {@link ApiAutopromoteCondition} carrying an
490
+ * `operand`; a single-condition or bare-string configuration arrives wrapped in
491
+ * a one-element array.
492
+ */
493
+ export interface ApiAutopromoteConditions {
494
+ [group: string]: ApiAutopromoteCondition | ApiAutopromoteCondition[] | string[] | undefined;
495
+ }
496
+ /**
497
+ * Autopromote-once configuration keyed by hook name (`siprop=autopromoteonce`).
498
+ * A hook with nothing configured arrives as an empty **array**, because
499
+ * `formatversion=2` cannot tell an empty PHP list from an empty map.
500
+ */
501
+ export interface ApiAutopromoteOnce {
502
+ [hook: string]: ApiAutopromoteConditions | unknown[] | undefined;
503
+ }
504
+ /** Temporary-account creation config (`siprop=autocreatetempuser`). */
505
+ export interface ApiAutoCreateTempUser {
506
+ /**
507
+ * Whether automatic temporary-account creation is on. A real `boolean`.
508
+ *
509
+ * @since MediaWiki 1.41
510
+ */
511
+ enabled?: boolean;
512
+ /**
513
+ * Name patterns reserved for temporary accounts; only when configured.
514
+ *
515
+ * @since MediaWiki 1.43
516
+ */
517
+ matchPatterns?: string[];
518
+ }
519
+ /**
520
+ * Upload dialog configuration (`siprop=uploaddialog`), mirroring
521
+ * `$wgUploadDialog` verbatim.
522
+ */
523
+ export interface ApiUploadDialog {
524
+ /** Which extra form fields are shown. Keys are absent when not applicable. */
525
+ fields?: {
526
+ description?: boolean;
527
+ date?: boolean;
528
+ categories?: boolean;
529
+ };
530
+ /** Message keys for the license selectors, per image source. */
531
+ licensemessages?: {
532
+ local?: string;
533
+ foreign?: string;
534
+ };
535
+ /**
536
+ * Default edit summaries, per image source (`local`/`foreign`), or a single
537
+ * string on wikis that configure one.
538
+ */
539
+ comment?: string | {
540
+ local?: string;
541
+ foreign?: string;
542
+ };
543
+ /** Templates/placeholder text used to build the file page. */
544
+ format?: {
545
+ filepage?: string;
546
+ description?: string;
547
+ ownwork?: string;
548
+ license?: string;
549
+ uncategorized?: string;
550
+ };
551
+ }
552
+ /**
553
+ * One component of the CycloneDX SBOM (`siprop=sbom`). Components nest: the
554
+ * platform entries carry their PHP extensions, MediaWiki core carries its
555
+ * composer packages and foreign resources, each extension carries its own
556
+ * composer packages.
557
+ */
558
+ export interface ApiSbomComponent {
559
+ /** CycloneDX component type, e.g. `platform`, `library`, `application`. */
560
+ type: "platform" | "library" | "application" | (string & {});
561
+ /** Component name, e.g. `PHP`, `MediaWiki`, an extension/skin or package name. */
562
+ name: string;
563
+ /**
564
+ * Version string; `null` when a foreign resource declares none, absent when
565
+ * the source does not report one.
566
+ */
567
+ version?: string | null;
568
+ /** Authors; extensions report `{ name }`, composer packages carry the raw
569
+ * `installed.json` entries (`name`, `email`, `homepage`, `role`). */
570
+ authors?: {
571
+ name?: string;
572
+ email?: string;
573
+ homepage?: string;
574
+ role?: string;
575
+ }[];
576
+ /** License name declared by the extension (`license-name`). */
577
+ licences?: string[];
578
+ /** SPDX license expressions of foreign-resource components (CycloneDX
579
+ * spelling, distinct from {@link licences}). */
580
+ licenses?: {
581
+ expression?: string;
582
+ license?: {
583
+ id: string;
584
+ };
585
+ }[];
586
+ /** Package URL of a foreign-resource component. */
587
+ purl?: string;
588
+ /** External references of a foreign-resource component (e.g. upstream site). */
589
+ externalReferences?: {
590
+ url: string;
591
+ type: "website" | (string & {});
592
+ }[];
593
+ /** Home URL declared by the extension. */
594
+ url?: string;
595
+ /** Localized description (from `descriptionmsg`/`description`). */
596
+ description?: string;
597
+ /** Nested components (e.g. PHP extensions, composer packages). */
598
+ components?: ApiSbomComponent[];
599
+ }
600
+ /**
601
+ * Software Bill of Materials in CycloneDX 1.6 form (`siprop=sbom`). Requires a
602
+ * named (logged-in, non-temporary) account. `serialNumber` embeds a fresh UUID
603
+ * per request.
604
+ *
605
+ * @since MediaWiki 1.46
606
+ * @see https://cyclonedx.org/docs/1.6/json/
607
+ */
608
+ export interface ApiSbom {
609
+ /** JSON schema URL, `http://cyclonedx.org/schema/bom-1.6.schema.json`. */
610
+ $schema?: string;
611
+ /** Always `CycloneDX`. */
612
+ bomFormat?: string;
613
+ /** CycloneDX spec version, e.g. `1.6`. */
614
+ specVersion?: string;
615
+ /** Unique BOM serial, `urn:uuid:` + a fresh UUIDv4 per request. */
616
+ serialNumber?: string;
617
+ /** BOM revision, always `1`. */
618
+ version?: number;
619
+ metadata?: {
620
+ /** When the BOM was generated, in ISO 8601. */
621
+ timestamp?: Timestamp;
622
+ };
623
+ /** Platform (PHP/ICU/database), MediaWiki core and extension components. */
624
+ components?: ApiSbomComponent[];
625
+ }
626
+ declare module "./index" {
627
+ interface ApiQueryResult {
628
+ /** General site configuration (`meta=siteinfo`, `siprop=general`). */
629
+ general?: ApiSiteGeneral;
630
+ /** Upload-dialog config (`siprop=uploaddialog`). */
631
+ uploaddialog?: ApiUploadDialog;
632
+ /**
633
+ * Domains allowed to send authenticated CORS requests, from
634
+ * `$wgCrossSiteAJAXdomains`; always a JSON array (empty when unconfigured).
635
+ * `siprop=crosssiteajaxdomains`.
636
+ *
637
+ * @since MediaWiki 1.47
638
+ */
639
+ crosssiteajaxdomains?: string[];
640
+ /**
641
+ * Software Bill of Materials in CycloneDX 1.6 form. `siprop=sbom`;
642
+ * requires a named (logged-in, non-temporary) account, so anonymous
643
+ * requests error out.
644
+ *
645
+ * @since MediaWiki 1.46
646
+ */
647
+ sbom?: ApiSbom;
648
+ /**
649
+ * Domains copy-uploads may fetch from (`$wgCopyUploadsDomains`, plus the
650
+ * on-wiki allowlist page since 1.46). `siprop=copyuploaddomains`.
651
+ *
652
+ * @since MediaWiki 1.45
653
+ */
654
+ copyuploaddomains?: string[];
655
+ /**
656
+ * Behavior-switch magic words (the `__NOTOC__` set).
657
+ * `siprop=doubleunderscores`.
658
+ *
659
+ * @since MediaWiki 1.46
660
+ */
661
+ doubleunderscores?: string[];
662
+ /** Namespace definitions (`meta=siteinfo`, `siprop=namespaces`). */
663
+ namespaces?: ApiNamespaces;
664
+ /** Site counters (`siprop=statistics`). */
665
+ statistics?: ApiSiteStatistics;
666
+ /** User groups and their rights (`siprop=usergroups`). */
667
+ usergroups?: ApiUserGroup[];
668
+ /** Protection types and levels (`siprop=restrictions`). */
669
+ restrictions?: ApiSiteRestrictions;
670
+ /** Where the site points for its content-rights statement (`siprop=rightsinfo`). */
671
+ rightsinfo?: ApiRightsInfo;
672
+ /** Localized namespace aliases (`siprop=namespacealiases`). */
673
+ namespacealiases?: ApiNamespaceAlias[];
674
+ /** Localized special-page aliases (`siprop=specialpagealiases`). */
675
+ specialpagealiases?: ApiSpecialPageAlias[];
676
+ /** Uploadable file extensions (`siprop=fileextensions`). */
677
+ fileextensions?: ApiFileExtension[];
678
+ /** Installed extensions and skins with credits (`siprop=extensions`). */
679
+ extensions?: ApiSiteExtension[];
680
+ /** Recognised URL protocols (`siprop=protocols`). */
681
+ protocols?: string[];
682
+ /** Installed skins (`siprop=skins`). */
683
+ skins?: ApiSiteSkin[];
684
+ /** Parser extension tags such as `<gallery>` (`siprop=extensiontags`). */
685
+ extensiontags?: string[];
686
+ /** Parser function names (`siprop=functionhooks`). */
687
+ functionhooks?: string[];
688
+ /** Parser variable ids (`siprop=variables`). */
689
+ variables?: string[];
690
+ /** Magic words and their aliases (`siprop=magicwords`). */
691
+ magicwords?: ApiMagicWord[];
692
+ /** Subscriber list per hook (`siprop=showhooks`). */
693
+ showhooks?: ApiShowHook[];
694
+ /** Database replica lag (`siprop=dbrepllag`). */
695
+ dbrepllag?: ApiDbReplLag[];
696
+ /** Interwiki prefixes and their URL templates (`siprop=interwikimap`). */
697
+ interwikimap?: ApiInterwikiMapEntry[];
698
+ /** Known language codes (`siprop=languages`). */
699
+ languages?: ApiSiteLanguage[];
700
+ /** Variant fallbacks, keyed by language then variant (`siprop=languagevariants`). */
701
+ languagevariants?: Record<string, Record<string, ApiLanguageVariant | undefined> | undefined>;
702
+ /** Composer packages (`siprop=libraries`). */
703
+ libraries?: ApiSoftwareLibrary[];
704
+ /**
705
+ * Bundled client-side libraries (`siprop=clientlibraries`).
706
+ *
707
+ * @since MediaWiki 1.42
708
+ */
709
+ clientlibraries?: ApiSoftwareLibrary[];
710
+ /**
711
+ * Autopromote conditions per group (`siprop=autopromote`).
712
+ *
713
+ * @since MediaWiki 1.42
714
+ */
715
+ autopromote?: ApiAutopromoteConditions;
716
+ /**
717
+ * Autopromote-once hooks and their conditions (`siprop=autopromoteonce`).
718
+ *
719
+ * @since MediaWiki 1.42
720
+ */
721
+ autopromoteonce?: ApiAutopromoteOnce;
722
+ /**
723
+ * Temporary-account creation config (`siprop=autocreatetempuser`).
724
+ *
725
+ * @since MediaWiki 1.41
726
+ */
727
+ autocreatetempuser?: ApiAutoCreateTempUser;
728
+ /** Default user options, keyed by option name (`siprop=defaultoptions`). */
729
+ defaultoptions?: Record<string, string | number | boolean | undefined>;
730
+ }
731
+ }