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,28 @@
1
+ /**
2
+ * `list=iwbacklinks` — pages that link to a given interwiki target, merged into
3
+ * {@link ApiQueryResult}. The reverse of `prop=iwlinks`.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Iwbacklinks
6
+ */
7
+ import type { Flag, NamespaceIndex } from "../../common";
8
+ /** One page carrying the searched interwiki link. */
9
+ export interface ApiIwbacklink {
10
+ /** Page id of the linking page. */
11
+ pageid: number;
12
+ /** Namespace index. */
13
+ ns: NamespaceIndex;
14
+ /** Full page title. */
15
+ title: string;
16
+ /** `true` when the linking page is a redirect. A {@link Flag}. */
17
+ redirect?: Flag;
18
+ /** Interwiki prefix of the matched link, e.g. `q`. `iwblprop=iwprefix`. */
19
+ iwprefix?: string;
20
+ /** Target title on the remote wiki. `iwblprop=iwtitle`. */
21
+ iwtitle?: string;
22
+ }
23
+ declare module "./index" {
24
+ interface ApiQueryResult {
25
+ /** Pages linking to `iwblprefix`:`iwbltitle` (`list=iwbacklinks`). */
26
+ iwbacklinks?: ApiIwbacklink[];
27
+ }
28
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `prop=iwlinks` — interwiki links on a page, merged into the shared
3
+ * {@link ApiPage} shape via declaration merging.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Iwlinks
6
+ */
7
+ /** One interwiki link. */
8
+ export interface ApiInterwikiLink {
9
+ /** Interwiki prefix, e.g. `en` / `m`. */
10
+ prefix: string;
11
+ /** Target title. */
12
+ title: string;
13
+ /** Resolved target URL. `iwprop=url`, or the deprecated boolean `iwurl` parameter. */
14
+ url?: string;
15
+ }
16
+ declare module "./index" {
17
+ interface ApiPage {
18
+ /** Interwiki links on the page (`prop=iwlinks`). */
19
+ iwlinks?: ApiInterwikiLink[];
20
+ }
21
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `list=langbacklinks` — pages that link to a given interlanguage target,
3
+ * merged into {@link ApiQueryResult}. The reverse of `prop=langlinks`.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Langbacklinks
6
+ */
7
+ import type { Flag, NamespaceIndex } from "../../common";
8
+ /** One page carrying the searched language link. */
9
+ export interface ApiLangbacklink {
10
+ /** Page id of the linking page. */
11
+ pageid: number;
12
+ /** Namespace index. */
13
+ ns: NamespaceIndex;
14
+ /** Full page title. */
15
+ title: string;
16
+ /** `true` when the linking page is a redirect. A {@link Flag}. */
17
+ redirect?: Flag;
18
+ /** Language code of the matched link, e.g. `de`. `lblprop=lllang`. */
19
+ lllang?: string;
20
+ /** Target title on the other language's wiki. `lblprop=lltitle`. */
21
+ lltitle?: string;
22
+ }
23
+ declare module "./index" {
24
+ interface ApiQueryResult {
25
+ /** Pages linking to `lbllang`:`lbltitle` (`list=langbacklinks`). */
26
+ langbacklinks?: ApiLangbacklink[];
27
+ }
28
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `prop=langlinks` — interlanguage links (links to the same subject in other
3
+ * language wikis), merged into {@link ApiPage}. Rows appear when the pages
4
+ * carry interlanguage links; a wiki (or page) without any yields none.
5
+ *
6
+ * `lang` and `title` are always present; `url` / `langname` / `autonym` come from
7
+ * `llprop`.
8
+ *
9
+ * @see https://www.mediawiki.org/wiki/API:Langlinks
10
+ */
11
+ /** One interlanguage link. */
12
+ export interface ApiLangLink {
13
+ /** Target language code, e.g. `de`. */
14
+ lang: string;
15
+ /** Title of the linked page on the target wiki. */
16
+ title: string;
17
+ /** Full URL of the linked page. `llprop=url`. */
18
+ url?: string;
19
+ /**
20
+ * Language name, localized to `inlanguagecode`, which defaults to the site's
21
+ * content language (not the requesting user's UI language). `llprop=langname`.
22
+ */
23
+ langname?: string;
24
+ /** Language name in its own language. `llprop=autonym`. */
25
+ autonym?: string;
26
+ }
27
+ declare module "./index" {
28
+ interface ApiPage {
29
+ /** Interlanguage links from this page (`prop=langlinks`). */
30
+ langlinks?: ApiLangLink[];
31
+ }
32
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * `meta=languageinfo` — information about languages, merged into
3
+ * {@link ApiQueryResult} as an object keyed by language code. Which fields
4
+ * appear depends on `liprop`.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Languageinfo
7
+ */
8
+ /** Information about one language (`meta=languageinfo`, keyed by code). */
9
+ export interface ApiLanguageInfo {
10
+ /** Language code. `liprop=code`. */
11
+ code?: string;
12
+ /** BCP 47 language tag. `liprop=bcp47`. */
13
+ bcp47?: string;
14
+ /** Writing direction. `liprop=dir`. Open union for forward compatibility. */
15
+ dir?: "ltr" | "rtl" | (string & {});
16
+ /** Name in the language itself. `liprop=autonym`. */
17
+ autonym?: string;
18
+ /** Name in the content/`uselang` language. `liprop=name`. */
19
+ name?: string;
20
+ /** Fallback language codes, in order. `liprop=fallbacks`. */
21
+ fallbacks?: string[];
22
+ /** Language-variant codes. `liprop=variants`. */
23
+ variants?: string[];
24
+ /**
25
+ * Variant display names, keyed by variant code. `liprop=variantnames`.
26
+ *
27
+ * @since MediaWiki 1.40
28
+ */
29
+ variantnames?: Record<string, string>;
30
+ /**
31
+ * Digit transforms: an ASCII-digit → localized-digit mapping. `liprop=digittransforms`.
32
+ * A PHP map keyed `0..9`; when a language omits some entries it serializes as an
33
+ * object, and an empty table surfaces as `[]`.
34
+ *
35
+ * @since MediaWiki 1.47
36
+ */
37
+ digittransforms?: string[] | Record<string, string>;
38
+ /**
39
+ * CLDR digit-grouping pattern (e.g. `#,##0.###`). `liprop=digitgroupingpattern`.
40
+ *
41
+ * @since MediaWiki 1.47
42
+ */
43
+ digitgroupingpattern?: string;
44
+ /**
45
+ * Minimum number of digits required before grouping applies. `liprop=minimumgroupingdigits`.
46
+ *
47
+ * @since MediaWiki 1.47
48
+ */
49
+ minimumgroupingdigits?: number;
50
+ /**
51
+ * Localized namespace names, keyed by numeric namespace id. `liprop=namespacenames`;
52
+ * the main namespace's value is the empty string.
53
+ *
54
+ * @since MediaWiki 1.47
55
+ */
56
+ namespacenames?: Record<string, string>;
57
+ /**
58
+ * Localized namespace aliases, mapping each alias to its namespace id.
59
+ * `liprop=namespacealiases`.
60
+ *
61
+ * @since MediaWiki 1.47
62
+ */
63
+ namespacealiases?: Record<string, number>;
64
+ }
65
+ declare module "./index" {
66
+ interface ApiQueryResult {
67
+ /** Language information keyed by language code (`meta=languageinfo`). */
68
+ languageinfo?: Record<string, ApiLanguageInfo>;
69
+ }
70
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `prop=links` — the wikilinks a page makes (forward links), merged into
3
+ * {@link ApiPage}. The inverse of `prop=linkshere`.
4
+ *
5
+ * Under `formatversion=2` each row is exactly `{ ns, title }`.
6
+ *
7
+ * @see https://www.mediawiki.org/wiki/API:Links
8
+ */
9
+ import type { NamespaceIndex } from "../../common";
10
+ /** One link made by a page. */
11
+ export interface ApiPageLink {
12
+ /** Namespace index. */
13
+ ns: NamespaceIndex;
14
+ /** Linked page title. */
15
+ title: string;
16
+ }
17
+ declare module "./index" {
18
+ interface ApiPage {
19
+ /** Pages linked-to by this page (`prop=links`). */
20
+ links?: ApiPageLink[];
21
+ }
22
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `prop=linkshere` — pages that link to the queried page, merged into
3
+ * {@link ApiPage} via declaration merging. Each entry is a lightweight page
4
+ * reference (not a full {@link ApiPage}).
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Linkshere
7
+ */
8
+ import type { NamespaceIndex } from "../../common";
9
+ /** One page in a `linkshere` result. `lhprop` controls which fields appear. */
10
+ export interface ApiLinksHere {
11
+ /** Page id. `lhprop=pageid`. */
12
+ pageid?: number;
13
+ /** Namespace index. */
14
+ ns?: NamespaceIndex;
15
+ /** Full page title. */
16
+ title?: string;
17
+ /** Whether the linking page is a redirect. `lhprop=redirect`; a real `boolean`. */
18
+ redirect?: boolean;
19
+ }
20
+ declare module "./index" {
21
+ interface ApiPage {
22
+ /** Pages linking to this page (`prop=linkshere`). */
23
+ linkshere?: ApiLinksHere[];
24
+ }
25
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * `list=logevents` — the page/user action log, merged into {@link ApiQueryResult}
3
+ * via declaration merging. Central to admin tooling (audit trails).
4
+ *
5
+ * `type` + `action` together identify the event (e.g. `delete` / `delete`); the
6
+ * structured details live under `params` (`leprop=details`).
7
+ *
8
+ * @see https://www.mediawiki.org/wiki/API:Logevents
9
+ */
10
+ import type { Flag, NamespaceIndex, Timestamp } from "../../common";
11
+ /** One log event. `leprop` controls which fields appear. */
12
+ export interface ApiLogEvent {
13
+ /** Log record id. `leprop=ids`. */
14
+ logid?: number;
15
+ /** Namespace of the affected page. */
16
+ ns?: NamespaceIndex;
17
+ /** Title of the affected page. `leprop=title`. */
18
+ title?: string;
19
+ /** Page id of the target; `0` when there is no page. `leprop=ids`. */
20
+ pageid?: number;
21
+ /** Page id the log is filed under. `leprop=ids`. */
22
+ logpage?: number;
23
+ /**
24
+ * Revision id associated with the event (when applicable). `leprop=ids`.
25
+ *
26
+ * @since MediaWiki 1.40
27
+ */
28
+ revid?: number;
29
+ /** Log type, e.g. `delete`, `move`, `newusers`. `leprop=type`. */
30
+ type?: string;
31
+ /** Log action, e.g. `create`, `delete`. `leprop=type`. */
32
+ action?: string;
33
+ /** Structured log details; shape varies by `type`/`action`. `leprop=details`. */
34
+ params?: Record<string, unknown>;
35
+ /** Performing user name (or IP). `leprop=user`. */
36
+ user?: string;
37
+ /** Performing user id. `leprop=userid`. */
38
+ userid?: number;
39
+ /** Event timestamp. `leprop=timestamp`. */
40
+ timestamp?: Timestamp;
41
+ /** Raw log comment. `leprop=comment`. */
42
+ comment?: string;
43
+ /** HTML-rendered comment. `leprop=parsedcomment`. */
44
+ parsedcomment?: string;
45
+ /** Change tags. `leprop=tags`. */
46
+ tags?: string[];
47
+ /**
48
+ * Made by an anonymous (IP) actor. `leprop=user|userid`; a {@link Flag}.
49
+ */
50
+ anon?: Flag;
51
+ /**
52
+ * The actor is a temporary account. `leprop=user|userid`; a {@link Flag}.
53
+ *
54
+ * @since MediaWiki 1.42
55
+ */
56
+ temp?: Flag;
57
+ /**
58
+ * The log action/target is hidden (log-deleted). `leprop=ids|title`, or
59
+ * `leprop=details` on rows that have stored params. A {@link Flag}.
60
+ */
61
+ actionhidden?: Flag;
62
+ /** The actor is hidden. Log-deleted; a {@link Flag}. */
63
+ userhidden?: Flag;
64
+ /** The comment is hidden. Log-deleted; a {@link Flag}. */
65
+ commenthidden?: Flag;
66
+ /**
67
+ * Oversight/suppression applies to this log event (set together with the
68
+ * `*hidden` flags). A {@link Flag}.
69
+ */
70
+ suppressed?: Flag;
71
+ }
72
+ declare module "./index" {
73
+ interface ApiQueryResult {
74
+ /** Log events (`list=logevents`). */
75
+ logevents?: ApiLogEvent[];
76
+ }
77
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * `list=mystashedfiles` — files the requesting user has stashed but not yet
3
+ * published, merged into {@link ApiQueryResult}. Requires being logged in.
4
+ *
5
+ * A stash row is produced by `action=upload` with `stash=1` (or by an interrupted
6
+ * chunked upload) and is consumed by a later `action=upload` with `filekey=`, so
7
+ * this list is how a client recovers resumable uploads. Sizes here are **numbers**,
8
+ * unlike the same quantities in `list=filearchive`.
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Mystashedfiles
11
+ */
12
+ /** One stashed file. `msfprop` controls the measurement fields. */
13
+ export interface ApiStashedFile {
14
+ /** Handle to pass as `action=upload`'s `filekey`. */
15
+ filekey: string;
16
+ /**
17
+ * Stash state. `finished` once the whole file is stored; chunked uploads sit on
18
+ * `chunks` until assembled. Open union for other internal states.
19
+ */
20
+ status: "finished" | "chunks" | (string & {});
21
+ /** Stored size in bytes. `msfprop=size`. */
22
+ size?: number;
23
+ /** Image width; `0` for non-raster files. `msfprop=size`. */
24
+ width?: number;
25
+ /** Image height; `0` for non-raster files. `msfprop=size`. */
26
+ height?: number;
27
+ /** Colour depth in bits. `msfprop=size`. */
28
+ bits?: number;
29
+ /** Full MIME type, e.g. `image/png`. `msfprop=type`. */
30
+ mimetype?: string;
31
+ /** MediaWiki media bucket, e.g. `BITMAP`. `msfprop=type`. */
32
+ mediatype?: string;
33
+ }
34
+ declare module "./index" {
35
+ interface ApiQueryResult {
36
+ /** Files the caller has stashed but not published (`list=mystashedfiles`). */
37
+ mystashedfiles?: ApiStashedFile[];
38
+ }
39
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `list=pagepropnames` — every page property name in use on the wiki, merged
3
+ * into {@link ApiQueryResult}. Feeds `pwppropname` of `list=pageswithprop` and
4
+ * `ppprop` of `prop=pageprops`.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Pagepropnames
7
+ */
8
+ /** One page property name in use. */
9
+ export interface ApiPagePropName {
10
+ /** Property name as stored in `page_props`, e.g. `displaytitle`. */
11
+ propname: string;
12
+ }
13
+ declare module "./index" {
14
+ interface ApiQueryResult {
15
+ /** Distinct page property names (`list=pagepropnames`). */
16
+ pagepropnames?: ApiPagePropName[];
17
+ }
18
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `prop=pageprops` — page properties set by wikitext magic words, parser
3
+ * functions or extensions (e.g. `wikibase_item`, `displaytitle`, `defaultsort`),
4
+ * merged into {@link ApiPage} as a flat map.
5
+ *
6
+ * Values are strings; boolean-ish properties (e.g. `notoc`, `forceuncategorized`)
7
+ * serialize as the empty string `""`. A page that has none of the requested
8
+ * properties is returned without the `pageprops` key at all.
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Pageprops
11
+ */
12
+ /** The set of known property values is open-ended and site/extension-specific. */
13
+ export type ApiPageProps = Record<string, string>;
14
+ declare module "./index" {
15
+ interface ApiPage {
16
+ /** Page properties (`prop=pageprops`), keyed by property name. */
17
+ pageprops?: ApiPageProps;
18
+ }
19
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `list=pageswithprop` — pages carrying a given page property, merged into
3
+ * {@link ApiQueryResult}. The reverse lookup of `prop=pageprops`; enumerate the
4
+ * usable property names with `list=pagepropnames`.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Pageswithprop
7
+ */
8
+ import type { NamespaceIndex } from "../../common";
9
+ /** One page that defines the requested property. */
10
+ export interface ApiPagesWithProp {
11
+ /** Page id. `pwpprop=ids`. */
12
+ pageid?: number;
13
+ /** Namespace index. `pwpprop=title` (default). */
14
+ ns?: NamespaceIndex;
15
+ /** Full page title. */
16
+ title?: string;
17
+ /**
18
+ * Property value. `pwpprop=value` — a string, empty for switch-like
19
+ * properties (`__DISAMBIG__`), same as `prop=pageprops`.
20
+ */
21
+ value?: string;
22
+ }
23
+ declare module "./index" {
24
+ interface ApiQueryResult {
25
+ /** Pages defining `pwppropname` (`list=pageswithprop`). */
26
+ pageswithprop?: ApiPagesWithProp[];
27
+ }
28
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `list=prefixsearch` — titles beginning with a given prefix (the autocomplete
3
+ * backend of the search box), merged into {@link ApiQueryResult}.
4
+ *
5
+ * As `generator=prefixsearch` it populates `query.pages`, injecting only `index`
6
+ * into each entry.
7
+ *
8
+ * @see https://www.mediawiki.org/wiki/API:Prefixsearch
9
+ */
10
+ import type { Flag, NamespaceIndex } from "../../common";
11
+ /** One prefix-search hit. */
12
+ export interface ApiPrefixSearchResult {
13
+ /** Page id. Absent on a {@link special} hit, which takes its place. */
14
+ pageid?: number;
15
+ /** The hit is a special page; takes the place of `pageid`. A {@link Flag}. */
16
+ special?: Flag;
17
+ /** Namespace index. */
18
+ ns: NamespaceIndex;
19
+ /** Full page title. */
20
+ title: string;
21
+ }
22
+ declare module "./index" {
23
+ interface ApiQueryResult {
24
+ /** Prefix-search results (`list=prefixsearch`). */
25
+ prefixsearch?: ApiPrefixSearchResult[];
26
+ }
27
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `list=protectedtitles` — titles protected against creation (pre-emptive
3
+ * protection of pages that do not exist yet), merged into {@link ApiQueryResult}.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Protectedtitles
6
+ */
7
+ import type { NamespaceIndex, Timestamp } from "../../common";
8
+ /**
9
+ * Create-protection level of a protected title — an entry of
10
+ * `$wgRestrictionLevels` (core default: `autoconfirmed`, `sysop`). **Open
11
+ * union**: `sreview` comes from FlaggedRevs, so the set is site-dependent.
12
+ */
13
+ export type ProtectedTitleLevel = "autoconfirmed" | "sysop" | (string & {});
14
+ /** One protected title. `ptprop` controls which fields appear. */
15
+ export interface ApiProtectedTitle {
16
+ /** Namespace index. */
17
+ ns: NamespaceIndex;
18
+ /** The protected (non-existent) title. */
19
+ title: string;
20
+ /** Restriction level applied, e.g. `sysop`. `ptprop=level`. */
21
+ level?: ProtectedTitleLevel;
22
+ /** When the protection was applied. `ptprop=timestamp`. */
23
+ timestamp?: Timestamp;
24
+ /** Name of the protecting user. `ptprop=user`. */
25
+ user?: string;
26
+ /**
27
+ * Id of the protecting user. `ptprop=userid`; also emitted with
28
+ * `ptprop=user` (B/C).
29
+ */
30
+ userid?: number;
31
+ /** Raw protection reason. `ptprop=comment`. */
32
+ comment?: string;
33
+ /** HTML-rendered protection reason. `ptprop=parsedcomment`. */
34
+ parsedcomment?: string;
35
+ /** When the protection lapses, or `infinity`. `ptprop=expiry`. */
36
+ expiry?: Timestamp | "infinity";
37
+ }
38
+ declare module "./index" {
39
+ interface ApiQueryResult {
40
+ /** Titles protected against creation (`list=protectedtitles`). */
41
+ protectedtitles?: ApiProtectedTitle[];
42
+ }
43
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * `list=querypage` — one of the wiki's special-page reports (`Special:Ancientpages`,
3
+ * `Special:Longpages`, …), merged into {@link ApiQueryResult}.
4
+ *
5
+ * Pagination uses the numeric `qpoffset` cursor rather than a string one. A row's
6
+ * columns depend on the report: every report yields `ns`/`title`, most add a
7
+ * `value`, and date-keyed reports add a formatted `timestamp`.
8
+ *
9
+ * @see https://www.mediawiki.org/wiki/API:Querypage
10
+ */
11
+ import type { Flag, NamespaceIndex, Timestamp } from "../../common";
12
+ /** One row of a report. */
13
+ export interface ApiQueryPageResult {
14
+ /**
15
+ * The report's sort value — a **string** even when it carries a count or a
16
+ * `yyyymmddhhmmss` date (e.g. `"4"`, `"20240115083000"`).
17
+ */
18
+ value?: string;
19
+ /** Row timestamp; appears on date-keyed reports (`Ancientpages`). */
20
+ timestamp?: Timestamp;
21
+ /** Namespace index. */
22
+ ns: NamespaceIndex;
23
+ /** Full page title. */
24
+ title: string;
25
+ /**
26
+ * Raw database columns the report did not fold into named fields, keyed by
27
+ * column name (all values are strings). Reports that select extra columns —
28
+ * `DoubleRedirects` exposes its `b_*`/`c_*` redirect columns this way — leak
29
+ * them here instead of surfacing each one.
30
+ */
31
+ databaseResult?: Record<string, string>;
32
+ }
33
+ /** The `querypage` container: the requested report and its rows. */
34
+ export interface ApiQueryPage {
35
+ /** CamelCase report name, e.g. `Ancientpages`. */
36
+ name: string;
37
+ /** The rows come from the job cache. A {@link Flag}. */
38
+ cached?: Flag;
39
+ /**
40
+ * The report is cached but not cacheable, so its rows are withheld. A
41
+ * {@link Flag}.
42
+ */
43
+ disabled?: Flag;
44
+ /**
45
+ * When the cached report was built; appears alongside {@link cached} when
46
+ * the cache timestamp is known.
47
+ */
48
+ cachedtimestamp?: Timestamp;
49
+ /** Largest result set the report can yield, independent of `qplimit`. */
50
+ maxresults?: number;
51
+ /** Rows of the report. */
52
+ results?: ApiQueryPageResult[];
53
+ }
54
+ declare module "./index" {
55
+ interface ApiQueryResult {
56
+ /** The requested special-page report (`list=querypage`). */
57
+ querypage?: ApiQueryPage;
58
+ }
59
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * `list=random` — a random selection of pages, merged into
3
+ * {@link ApiQueryResult}. Entries carry no `prop=` data; pair the module with
4
+ * `generator=random` to feed the selection into other modules instead.
5
+ *
6
+ * Note the id key is `id`, not the `pageid` other modules use.
7
+ *
8
+ * @see https://www.mediawiki.org/wiki/API:Random
9
+ */
10
+ import type { NamespaceIndex } from "../../common";
11
+ /** One randomly selected page. */
12
+ export interface ApiRandomPage {
13
+ /** Page id — keyed `id` here, unlike the `pageid` elsewhere. */
14
+ id: number;
15
+ /** Namespace index. */
16
+ ns: NamespaceIndex;
17
+ /** Full page title. */
18
+ title: string;
19
+ /**
20
+ * The page is a redirect. A real `boolean` (explicitly `false` too);
21
+ * present only with `rnfilterredir=all`.
22
+ */
23
+ redirect?: boolean;
24
+ }
25
+ declare module "./index" {
26
+ interface ApiQueryResult {
27
+ /** Randomly selected pages (`list=random`). */
28
+ random?: ApiRandomPage[];
29
+ }
30
+ }