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,30 @@
1
+ /**
2
+ * `list=exturlusage` — pages that carry a given external URL, merged into
3
+ * {@link ApiQueryResult}. The list-side counterpart of `prop=extlinks`, which
4
+ * reads a page's URLs rather than searching for a URL's pages.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Exturlusage
7
+ */
8
+ import type { NamespaceIndex } from "../../common";
9
+ /** One page whose content links to the searched URL. */
10
+ export interface ApiExtUrlUsage {
11
+ /** Page id. `euprop=ids`. */
12
+ pageid?: number;
13
+ /** Namespace index. `euprop=title` (default). */
14
+ ns?: NamespaceIndex;
15
+ /** Full page title. */
16
+ title?: string;
17
+ /**
18
+ * The matched URL, reconstructed from the `externallinks` row (domain index
19
+ * plus stored path), not verbatim page text. `euprop=url` (default);
20
+ * `euexpandurl=1` expands protocol-relative URLs to the canonical protocol
21
+ * (deprecated since MediaWiki 1.43).
22
+ */
23
+ url?: string;
24
+ }
25
+ declare module "./index" {
26
+ interface ApiQueryResult {
27
+ /** Pages using the URL given to `euquery` (`list=exturlusage`). */
28
+ exturlusage?: ApiExtUrlUsage[];
29
+ }
30
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * `list=filearchive` — files removed by deletion (whole-page deletes and
3
+ * overwritten uploads alike), merged into {@link ApiQueryResult}. Viewing the
4
+ * description fields needs `deletedhistory`; the file itself needs `deletedtext`.
5
+ *
6
+ * Sizes are **strings** here (`"70"`, `"1"`, `"8"`): the module passes the
7
+ * `filearchive` columns through without casting, unlike `prop=imageinfo` (numbers)
8
+ * and `list=mystashedfiles` (numbers).
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Filearchive
11
+ */
12
+ import type { Flag, NamespaceIndex, Timestamp } from "../../common";
13
+ import type { ApiImageMetadataItem } from "./imageinfo";
14
+ /**
15
+ * One archived file. `faprop` selects the optional fields; `id`, `name`, `ns`
16
+ * and `title` are always present.
17
+ */
18
+ export interface ApiFileArchiveEntry {
19
+ /** `filearchive` row id. */
20
+ id: number;
21
+ /** File name with underscores, without the `File:` prefix. */
22
+ name: string;
23
+ /** Namespace the file page lived in (always the File namespace). */
24
+ ns: NamespaceIndex;
25
+ /** Full file page title. */
26
+ title: string;
27
+ /**
28
+ * Stored name of a superseded version. Only on an archived *old* version —
29
+ * absent for the newest stored file, even with `faprop=archivename`.
30
+ */
31
+ archivename?: string;
32
+ /** Upload timestamp. `faprop=timestamp`. */
33
+ timestamp?: Timestamp;
34
+ /** Uploader name. `faprop=user`. */
35
+ user?: string;
36
+ /** Uploader id. `faprop=user`. */
37
+ userid?: number;
38
+ /** The file's stored content is missing. A {@link Flag}. */
39
+ filemissing?: Flag;
40
+ /** Raw upload description (the file page's text). `faprop=description`. */
41
+ description?: string;
42
+ /** HTML-rendered upload description. `faprop=parseddescription`. */
43
+ parseddescription?: string;
44
+ /**
45
+ * File size in bytes, as a string. Emitted with either `faprop=size` or
46
+ * `faprop=dimensions`.
47
+ */
48
+ size?: string;
49
+ /**
50
+ * Number of pages, for multi-page formats; absent for formats without pages.
51
+ * Emitted with either `faprop=size` or `faprop=dimensions`.
52
+ */
53
+ pagecount?: number;
54
+ /** Pixel height, as a string. Emitted with either `faprop=size` or `faprop=dimensions`. */
55
+ height?: string;
56
+ /** Pixel width, as a string. Emitted with either `faprop=size` or `faprop=dimensions`. */
57
+ width?: string;
58
+ /** Content checksum (hex). `faprop=sha1`. */
59
+ sha1?: string;
60
+ /**
61
+ * MIME type, e.g. `image/png`. `faprop=mime`; requires the file content to be
62
+ * visible to the requester (revision-delete bitfield) and present.
63
+ */
64
+ mime?: string;
65
+ /** MediaWiki media bucket, e.g. `BITMAP`. `faprop=mediatype`. */
66
+ mediatype?: string;
67
+ /**
68
+ * Colour depth in bits, as a string. `faprop=bitdepth`; same visibility gate
69
+ * as `mime`.
70
+ */
71
+ bitdepth?: string;
72
+ /**
73
+ * Raw format metadata (EXIF / PNG chunks / …). `faprop=metadata`; `null` when the
74
+ * row carries none.
75
+ */
76
+ metadata?: ApiImageMetadataItem[] | null;
77
+ /** The file itself is hidden. A {@link Flag}. */
78
+ filehidden?: Flag;
79
+ /** The upload description is hidden. A {@link Flag}. */
80
+ commenthidden?: Flag;
81
+ /** The uploader is hidden. A {@link Flag}. */
82
+ userhidden?: Flag;
83
+ /** Hidden from ordinary admins (oversight). A {@link Flag}. */
84
+ suppressed?: Flag;
85
+ }
86
+ declare module "./index" {
87
+ interface ApiQueryResult {
88
+ /** Deleted/overwritten files (`list=filearchive`). */
89
+ filearchive?: ApiFileArchiveEntry[];
90
+ }
91
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * `meta=filerepoinfo` — the wiki's file repositories (local upload dir plus any
3
+ * shared repo), merged into {@link ApiQueryResult}. Explains the `url`/`thumburl`
4
+ * shapes that `prop=imageinfo` and `list=allimages` return.
5
+ *
6
+ * Config values, so the switches are real booleans (`false` is returned), not
7
+ * {@link Flag}s. Repos report only the optional settings they configure, so
8
+ * the key set varies by site; `apiurl` exists only for `ForeignAPIRepo`
9
+ * backends.
10
+ *
11
+ * @see https://www.mediawiki.org/wiki/API:Filerepoinfo
12
+ */
13
+ /** One file repository: an element of the `query.repos` array. */
14
+ export interface ApiFileRepoInfo {
15
+ /** Repo id; `local` is the wiki's own repo. `friprop=name` (default). */
16
+ name?: string;
17
+ /** Human-readable repo name. `friprop=displayname`. */
18
+ displayname?: string;
19
+ /** Whether this is the wiki's own repo. `friprop=local`. */
20
+ local?: boolean;
21
+ /** Public base path of the repo. `friprop=url`. */
22
+ url?: string;
23
+ /** Repo root without the hashed subpath. `friprop=rootUrl`. */
24
+ rootUrl?: string;
25
+ /** Base path for thumbnails. `friprop=thumbUrl`. */
26
+ thumbUrl?: string;
27
+ /** Base path of the repo's wiki, e.g. `https://www.mediawiki.org/w`. `friprop=scriptDirUrl`. */
28
+ scriptDirUrl?: string;
29
+ /** URL of the repo wiki's favicon. `friprop=favicon`. */
30
+ favicon?: string;
31
+ /** Whether titles on the repo wiki are capitalized on first letter. `friprop=initialCapital`. */
32
+ initialCapital?: boolean;
33
+ /** Whether the requesting user may upload here. `friprop=canUpload`. */
34
+ canUpload?: boolean;
35
+ /** Base path of the repo wiki's API, for `ForeignAPIRepo` backends. `friprop=apiurl`. */
36
+ apiurl?: string;
37
+ /** URL prefix of the repo wiki's file description pages (e.g. `…/wiki/File:`). `friprop=descBaseUrl`. */
38
+ descBaseUrl?: string;
39
+ /** URL prefix of the repo wiki's article pages. `friprop=articleUrl`. */
40
+ articleUrl?: string;
41
+ /** Whether description pages are fetched from the remote wiki. `friprop=fetchDescription`. */
42
+ fetchDescription?: boolean;
43
+ /** How long fetched descriptions are cached, in seconds. `friprop=descriptionCacheExpiry`. */
44
+ descriptionCacheExpiry?: number;
45
+ }
46
+ declare module "./index" {
47
+ interface ApiQueryResult {
48
+ /** File repositories (`meta=filerepoinfo`). */
49
+ repos?: ApiFileRepoInfo[];
50
+ }
51
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `prop=fileusage` — local pages that use (embed) a file, merged into
3
+ * {@link ApiPage} via declaration merging. For usage across the whole wiki farm
4
+ * (including this wiki), use `prop=globalusage`, which offers `gufilterlocal=1`
5
+ * to drop the local wiki's rows.
6
+ *
7
+ * @see https://www.mediawiki.org/wiki/API:Fileusage
8
+ */
9
+ import type { NamespaceIndex } from "../../common";
10
+ /** One local usage record. `fuprop` controls which fields appear. */
11
+ export interface ApiFileUsage {
12
+ /** Page id of the using page. `fuprop=pageid`. */
13
+ pageid?: number;
14
+ /** Namespace index. */
15
+ ns?: NamespaceIndex;
16
+ /** Full title of the using page. */
17
+ title?: string;
18
+ /** Whether the using page is a redirect. `fuprop=redirect`; a real `boolean`. */
19
+ redirect?: boolean;
20
+ }
21
+ declare module "./index" {
22
+ interface ApiPage {
23
+ /** Local pages using this file (`prop=fileusage`). */
24
+ fileusage?: ApiFileUsage[];
25
+ }
26
+ }
@@ -0,0 +1,214 @@
1
+ /**
2
+ * `prop=imageinfo` — metadata about a file (image) page's current (or archived)
3
+ * version, merged into the shared {@link ApiPage} via declaration merging.
4
+ * Central to any file-heavy wiki. Which sub-fields appear depends on `iiprop`.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Imageinfo
7
+ */
8
+ import type { Flag, Timestamp } from "../../common";
9
+ /** One entry in a file's raw format `metadata` array (may nest further items). */
10
+ export interface ApiImageMetadataItem {
11
+ /** Metadata field name, e.g. `width`, `XResolution`. */
12
+ name?: string;
13
+ /**
14
+ * Field value; a scalar (booleans occur, e.g. through `META_BC_BOOLS`
15
+ * serialization; EXIF RATIONALs serialize as `"num/den"` strings) or a
16
+ * nested list of {@link ApiImageMetadataItem}.
17
+ */
18
+ value?: string | number | boolean | ApiImageMetadataItem[];
19
+ }
20
+ /**
21
+ * A multilang metadata value (`iiextmetadatamultilang=1`): the map of language
22
+ * codes to values that the API otherwise collapses to the best-matching
23
+ * language. `x-default` holds the fallback translation.
24
+ */
25
+ export interface ApiExtMetadataMultilangValue {
26
+ /** Serialization marker of the multilang map. */
27
+ _type?: "lang";
28
+ /** The value per language code (e.g. `en`, `de`, `x-default`). */
29
+ [lang: string]: string | number | undefined;
30
+ }
31
+ /** One structured `extmetadata` field. */
32
+ export interface ApiExtMetadataField {
33
+ /**
34
+ * Field value: a string for most fields, numeric for a few (e.g. the
35
+ * extension version), or the raw {@link ApiExtMetadataMultilangValue} map
36
+ * when the request set `iiextmetadatamultilang=1`.
37
+ */
38
+ value?: string | number | ApiExtMetadataMultilangValue;
39
+ /** Where the value came from, e.g. `mediawiki-metadata`. */
40
+ source?: string;
41
+ /** Presentation hint; serialized as an empty string when set (fv2 quirk). */
42
+ hidden?: string;
43
+ }
44
+ /** One scaled thumbnail entry (a keyed value of {@link ApiImageInfo.thumburls}). */
45
+ export interface ApiThumbUrlEntry {
46
+ /** Thumbnail source URL. */
47
+ url?: string;
48
+ /** Rendered width in pixels. */
49
+ width?: number;
50
+ /** Rendered height in pixels. */
51
+ height?: number;
52
+ /**
53
+ * Additional pre-rendered `<img>` attributes merged by the transform
54
+ * (typically `src`, `decoding` and `loading`, plus `srcset` when HiDPI
55
+ * variants exist), same shape as {@link ApiImageInfo.thumbattribs}.
56
+ */
57
+ [attribute: string]: string | number | undefined;
58
+ }
59
+ /** One image-info entry for a file page. */
60
+ export interface ApiImageInfo {
61
+ /** Timestamp of the file's upload/reversion. `iiprop=timestamp`. */
62
+ timestamp?: Timestamp;
63
+ /** Uploader user name. `iiprop=user`. */
64
+ user?: string;
65
+ /** Uploader user id. `iiprop=userid`. */
66
+ userid?: number;
67
+ /** Raw upload comment. `iiprop=comment`. */
68
+ comment?: string;
69
+ /** HTML-rendered comment. `iiprop=parsedcomment`. */
70
+ parsedcomment?: string;
71
+ /** File size in bytes. `iiprop=size|dimensions`. */
72
+ size?: number;
73
+ /**
74
+ * Width in pixels; `0` for files without dimensions (e.g. audio).
75
+ * `iiprop=size|dimensions`.
76
+ */
77
+ width?: number;
78
+ /**
79
+ * Height in pixels; `0` for files without dimensions (e.g. audio).
80
+ * `iiprop=size|dimensions`.
81
+ */
82
+ height?: number;
83
+ /** Canonical localized file title. `iiprop=canonicaltitle`. */
84
+ canonicaltitle?: string;
85
+ /** Direct URL to the file. `iiprop=url`. */
86
+ url?: string;
87
+ /** URL of the file description page. `iiprop=url`. */
88
+ descriptionurl?: string;
89
+ /** Shortened description-page URL. `iiprop=url`. */
90
+ descriptionshorturl?: string;
91
+ /**
92
+ * Scaled thumbnail URL. Requires `iiprop=url`, plus a transform requested
93
+ * via `iiurlwidth`, `iiurlheight` or `iiurlparam`.
94
+ */
95
+ thumburl?: string;
96
+ /**
97
+ * Scaled thumbnail width (px). Falls back to the file's own width when the
98
+ * thumbnail URL equals the original URL (no resize happened). Same
99
+ * requirements as {@link thumburl}.
100
+ */
101
+ thumbwidth?: number;
102
+ /**
103
+ * Scaled thumbnail height (px). Falls back to the file's own height like
104
+ * {@link thumbwidth}.
105
+ */
106
+ thumbheight?: number;
107
+ /**
108
+ * Pre-rendered `<img>` attributes for the thumbnail (e.g. `src`, `width`,
109
+ * `srcset`).
110
+ *
111
+ * @since MediaWiki 1.47
112
+ */
113
+ thumbattribs?: Record<string, string | number>;
114
+ /**
115
+ * Scaled thumbnail URLs at multiple widths, keyed by the produced
116
+ * thumbnail's width (normally the requested width; e.g. `"400"`, `"800"`).
117
+ * `iiprop=thumburls`. Each entry also folds in the transform's HTML `<img>`
118
+ * attributes.
119
+ *
120
+ * @since MediaWiki 1.47
121
+ */
122
+ thumburls?: Record<string, ApiThumbUrlEntry>;
123
+ /**
124
+ * HiDPI (`2x`, …) source URLs keyed by pixel-density multiplier. Requires
125
+ * `iiprop=url`, plus a successful transform.
126
+ */
127
+ responsiveUrls?: Record<string, string>;
128
+ /** File SHA-1 (hex). `iiprop=sha1`. */
129
+ sha1?: string;
130
+ /** MIME type, e.g. `image/png`. `iiprop=mime`. */
131
+ mime?: string;
132
+ /** Media type, e.g. `BITMAP`, `OFFICE`, `ARCHIVE`. `iiprop=mediatype`. */
133
+ mediatype?: string;
134
+ /** Color bit depth; `0` for files without dimensions (e.g. audio). `iiprop=bitdepth`. */
135
+ bitdepth?: number;
136
+ /**
137
+ * Raw format metadata (EXIF / PNG chunks / …). `iiprop=metadata`; an
138
+ * explicit `null` when the file has no metadata at all.
139
+ */
140
+ metadata?: ApiImageMetadataItem[] | null;
141
+ /**
142
+ * Metadata keys common to all file types, same item shape as {@link metadata}.
143
+ * `iiprop=commonmetadata`; an empty PHP map, so `[]` when there is none.
144
+ */
145
+ commonmetadata?: ApiImageMetadataItem[];
146
+ /** Structured/extended metadata keyed by field name. `iiprop=extmetadata`. */
147
+ extmetadata?: Record<string, ApiExtMetadataField>;
148
+ /**
149
+ * MIME type the thumbnail will be rendered as. `iiprop=thumbmime`, which
150
+ * requires `iiprop=url` and a transform via `iiurlwidth`/`iiurlheight`.
151
+ */
152
+ thumbmime?: string;
153
+ /**
154
+ * Rendered text of the thumbnail error, when the thumbnail could not be
155
+ * made. Requires `iiprop=url`, plus a transform.
156
+ */
157
+ thumberror?: string;
158
+ /**
159
+ * Upload-warning HTML ("a file with this name exists already…").
160
+ * `iiprop=uploadwarning`; `""` when there is nothing to warn about.
161
+ */
162
+ html?: string;
163
+ /** `true` when the file itself does not exist on this wiki (a stub row). A {@link Flag}. */
164
+ filemissing?: Flag;
165
+ /**
166
+ * Media duration in seconds (audio/video), when the handler reports one.
167
+ * Emitted under `iiprop=size|dimensions`; there is no `iiprop=duration`.
168
+ */
169
+ duration?: number;
170
+ /**
171
+ * Page count (multi-page documents such as PDFs/TIFFs), when the handler
172
+ * supports one. Emitted under `iiprop=size|dimensions`; there is no
173
+ * `iiprop=pagecount`.
174
+ */
175
+ pagecount?: number;
176
+ /** Archive name for a historical version. `iiprop=archivename`. */
177
+ archivename?: string;
178
+ /** The uploader is hidden (file revision-deleted). A {@link Flag}. */
179
+ userhidden?: Flag;
180
+ /** The upload comment is hidden. A {@link Flag}. */
181
+ commenthidden?: Flag;
182
+ /** The file itself is hidden. A {@link Flag}. */
183
+ filehidden?: Flag;
184
+ /** Made by an anonymous (IP) uploader. A {@link Flag}. */
185
+ anon?: Flag;
186
+ /**
187
+ * The uploader is a temporary account. A {@link Flag}.
188
+ *
189
+ * @since MediaWiki 1.42
190
+ */
191
+ temp?: Flag;
192
+ /**
193
+ * Oversight/suppression applies to this file revision (set together with the
194
+ * `*hidden` flags). A {@link Flag}.
195
+ */
196
+ suppressed?: Flag;
197
+ }
198
+ declare module "./index" {
199
+ interface ApiPage {
200
+ /**
201
+ * Where the file is hosted: the repository name, `local` for this wiki;
202
+ * `''` when the file does not exist. Framework field for file pages.
203
+ */
204
+ imagerepository?: "local" | "shared" | (string & {});
205
+ /**
206
+ * Whether the file is on the "bad images" list (`$wgBadImageList`).
207
+ * `iiprop=badfile` — a real `boolean`, and a **page-level sibling** of
208
+ * {@link ApiPage.imageinfo}, not a member of the imageinfo entry.
209
+ */
210
+ badfile?: boolean;
211
+ /** Image/file info entries (`prop=imageinfo`); usually one for the current file. */
212
+ imageinfo?: ApiImageInfo[];
213
+ }
214
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `prop=images` — the files (images) used/embedded by a page, merged into
3
+ * {@link ApiPage}. `formatversion=2` returns `{ ns, title }` per image.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Images
6
+ */
7
+ import type { NamespaceIndex } from "../../common";
8
+ /** One image used by a page. */
9
+ export interface ApiUsedImage {
10
+ /** Namespace index (the File namespace). */
11
+ ns: NamespaceIndex;
12
+ /** Full file title, e.g. `File:Example.png`. */
13
+ title: string;
14
+ }
15
+ declare module "./index" {
16
+ interface ApiPage {
17
+ /** Files embedded by this page (`prop=images`). */
18
+ images?: ApiUsedImage[];
19
+ }
20
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `list=imageusage` — pages that use a given file, merged into
3
+ * {@link ApiQueryResult}. The title-based sibling of `prop=fileusage` (which is
4
+ * keyed per queried file rather than by a single `iutitle`).
5
+ *
6
+ * The module has no `iuprop` parameter: every entry always carries `pageid`,
7
+ * `ns` and `title`. `iufilterredir` selects which using pages are listed
8
+ * (default `all`, i.e. redirects included); a listed page that is itself a
9
+ * redirect carries a `redirect` flag, and with `iuredirect=1` such an entry
10
+ * nests the pages using the file through it under `redirlinks`.
11
+ *
12
+ * @see https://www.mediawiki.org/wiki/API:Imageusage
13
+ */
14
+ import type { Flag, NamespaceIndex } from "../../common";
15
+ /** One page that uses the target file. */
16
+ export interface ApiImageUsage {
17
+ /** Page id of the using page. */
18
+ pageid: number;
19
+ /** Namespace index. */
20
+ ns: NamespaceIndex;
21
+ /** Full page title. */
22
+ title: string;
23
+ /** The using page is itself a redirect. A {@link Flag}. */
24
+ redirect?: Flag;
25
+ /**
26
+ * Pages that use the file through this redirect. Only on a `redirect`
27
+ * entry, and only with `iuredirect=1`.
28
+ */
29
+ redirlinks?: ApiImageUsage[];
30
+ }
31
+ declare module "./index" {
32
+ interface ApiQueryResult {
33
+ /** Pages using the file given to `iutitle` (`list=imageusage`). */
34
+ imageusage?: ApiImageUsage[];
35
+ }
36
+ }