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=allrevisions` — revisions enumerated across the wiki, grouped per page,
3
+ * merged into {@link ApiQueryResult}. The list-side counterpart of
4
+ * `prop=revisions`, useful without a title list (pair it with a generator, or
5
+ * page the whole namespace with `arvnamespace`).
6
+ *
7
+ * Rows are formatted exactly like `prop=revisions`, so they reuse
8
+ * {@link ApiRevision}; `list=alldeletedrevisions` groups identically.
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Allrevisions
11
+ */
12
+ import type { NamespaceIndex } from "../../common";
13
+ import type { ApiRevision } from "./revisions";
14
+ /** One page with the revisions requested for it. */
15
+ export interface ApiAllRevisions {
16
+ /** Page id. */
17
+ pageid: number;
18
+ /** Namespace index. */
19
+ ns: NamespaceIndex;
20
+ /** Full page title. */
21
+ title: string;
22
+ /** Revisions of the page, ordered per `arvdir`. */
23
+ revisions: ApiRevision[];
24
+ }
25
+ declare module "./index" {
26
+ interface ApiQueryResult {
27
+ /** Revisions grouped by page (`list=allrevisions`). */
28
+ allrevisions?: ApiAllRevisions[];
29
+ }
30
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `list=alltransclusions` — enumerate titles that are transcluded, merged into
3
+ * {@link ApiQueryResult}. Shares {@link ApiAllLink} with the `alllinks` family
4
+ * (same MediaWiki class, `at*` parameters).
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Alltransclusions
7
+ */
8
+ import type { ApiAllLink } from "./alllinks";
9
+ declare module "./index" {
10
+ interface ApiQueryResult {
11
+ /** Transcluded titles on the wiki (`list=alltransclusions`). */
12
+ alltransclusions?: ApiAllLink[];
13
+ }
14
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `list=allusers` — enumerate all registered users, merged into
3
+ * {@link ApiQueryResult} via declaration merging. `auprop` selects which fields
4
+ * appear, and every entry always carries `userid` and `name`.
5
+ *
6
+ * Entries share the `list=users` shape ({@link ApiUser}) minus the fields this
7
+ * module can never emit: `gender`, `emailable`, `cancreate`,
8
+ * `cancreateerror`, `groupmemberships`, `missing` and `systemuser`.
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Allusers
11
+ */
12
+ import type { Timestamp } from "../../common";
13
+ import type { ApiUser } from "./users";
14
+ /** One user listed by `list=allusers`. */
15
+ export type ApiAllusersEntry = Omit<ApiUser, "gender" | "emailable" | "cancreate" | "cancreateerror" | "groupmemberships" | "missing" | "systemuser" | "userid" | "name"> & {
16
+ /** User id. */
17
+ userid: number;
18
+ /** User name. */
19
+ name: string;
20
+ /**
21
+ * Registration timestamp, or an **empty string** for accounts created before
22
+ * registration timestamps were tracked (unlike the `null` of `list=users`).
23
+ * `auprop=registration`.
24
+ */
25
+ registration?: Timestamp | "";
26
+ /**
27
+ * Effective actions over the last `$wgActiveUserDays` days. Emitted only with
28
+ * `auactiveusers=1`.
29
+ */
30
+ recentactions?: number;
31
+ };
32
+ declare module "./index" {
33
+ interface ApiQueryResult {
34
+ /** Users listed by `list=allusers`. */
35
+ allusers?: ApiAllusersEntry[];
36
+ }
37
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * `meta=authmanagerinfo` — introspection over the AuthManager providers for a
3
+ * given flow (`amirequestsfor`), merged into {@link ApiQueryResult} via
4
+ * declaration merging. Drives the `clientlogin`/`createaccount` request shapes.
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Authmanagerinfo
7
+ */
8
+ /**
9
+ * A message attached to an AuthManager request or field. Its shape follows the
10
+ * request's `amimessageformat` parameter (default `wikitext`): a rendered
11
+ * string under `wikitext`/`html`, an {@link ApiAuthManagerRawMessage} under
12
+ * `raw`, and the key is absent under `none`.
13
+ */
14
+ export type ApiAuthManagerMessage = string | ApiAuthManagerRawMessage;
15
+ /** A message in raw form (`amimessageformat=raw`): the i18n key plus parameters. */
16
+ export interface ApiAuthManagerRawMessage {
17
+ /** i18n message key. */
18
+ key?: string;
19
+ /** i18n message parameters. */
20
+ params?: unknown[];
21
+ }
22
+ /**
23
+ * AuthManager / password-flow status. The uppercase values are the
24
+ * `AuthenticationResponse` statuses that surface through the API (`PASS`/
25
+ * `FAIL`/`UI`/`REDIRECT`/`RESTART`; the internal `ABSTAIN` never does); the
26
+ * lowercase `success` is emitted by `ApiResetPassword` itself. Open union.
27
+ */
28
+ export type ApiAuthManagerStatus = "PASS" | "FAIL" | "UI" | "REDIRECT" | "RESTART" | "success" | (string & {});
29
+ /** One AuthManager request descriptor returned by `meta=authmanagerinfo`. */
30
+ export interface ApiQueryAuthManagerInfoRequest {
31
+ /** Fully-qualified request class name (PHP namespace separators escaped). */
32
+ id?: string;
33
+ /** Arbitrary provider metadata; always an object under `formatversion=2` (possibly empty). */
34
+ metadata?: Record<string, unknown>;
35
+ /** How the request is required for the flow. */
36
+ required?: "required" | "optional" | "primary-required" | (string & {});
37
+ /** Human-readable provider name. */
38
+ provider?: ApiAuthManagerMessage;
39
+ /** Provider account label (often the request class name for core providers). */
40
+ account?: ApiAuthManagerMessage;
41
+ /** Field descriptors keyed by field name. */
42
+ fields?: Record<string, ApiQueryAuthManagerField>;
43
+ }
44
+ /** A single field descriptor of an {@link ApiQueryAuthManagerInfoRequest}. */
45
+ export interface ApiQueryAuthManagerField {
46
+ /** Input type (e.g. `string`, `password`, `info`). */
47
+ type?: string;
48
+ /** The field's current value (e.g. a username prefilled by a preserved session). */
49
+ value?: string;
50
+ /** Allowed values mapped to their rendered labels, for choice-like fields. */
51
+ options?: Record<string, string>;
52
+ /** Rendered label. */
53
+ label?: ApiAuthManagerMessage;
54
+ /** Help text. */
55
+ help?: ApiAuthManagerMessage;
56
+ /** The field may be omitted. */
57
+ optional?: boolean;
58
+ /** The field carries a secret (password) and is masked. */
59
+ sensitive?: boolean;
60
+ /** Additional provider-specific field metadata. */
61
+ [extra: string]: unknown;
62
+ }
63
+ /** The `authmanagerinfo` object returned under `query`. */
64
+ export interface ApiQueryAuthManagerInfo {
65
+ /** Whether the current session can authenticate right now. */
66
+ canauthenticatenow: boolean;
67
+ /** Whether account creation is available. */
68
+ cancreateaccounts: boolean;
69
+ /** Whether account linking (CentralAuth) is available. */
70
+ canlinkaccounts: boolean;
71
+ /**
72
+ * Security-sensitive operation status, present only when
73
+ * `amisecuritysensitiveoperation` names an action.
74
+ */
75
+ securitysensitiveoperationstatus?: string;
76
+ /** Whether a preserved AuthManager state exists for the session. */
77
+ haspreservedstate?: boolean;
78
+ /** Whether a preserved *primary* AuthManager state exists. */
79
+ hasprimarypreservedstate?: boolean;
80
+ /** Preserved username, or an empty string when none. */
81
+ preservedusername?: string;
82
+ /**
83
+ * Field descriptors merged across all {@link requests}, present only when the
84
+ * request passed `amimergerequestfields=1` — the per-request `fields` are
85
+ * omitted in that mode.
86
+ */
87
+ fields?: Record<string, ApiQueryAuthManagerField>;
88
+ /** Provider requests the flow needs, ordered. */
89
+ requests?: ApiQueryAuthManagerInfoRequest[];
90
+ }
91
+ declare module "./index" {
92
+ interface ApiQueryResult {
93
+ /** AuthManager provider introspection requested via `meta=authmanagerinfo`. */
94
+ authmanagerinfo?: ApiQueryAuthManagerInfo;
95
+ }
96
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `list=backlinks` — pages that link to a given title, merged into
3
+ * {@link ApiQueryResult}. The title-based sibling of `prop=linkshere` (which is
4
+ * keyed per queried page rather than by a single `bltitle`).
5
+ *
6
+ * The module has no `blprop` parameter: every entry always carries `pageid`,
7
+ * `ns` and `title`. With `blredirect=1`, an entry that is itself a redirect
8
+ * nests the pages linking through it under `redirlinks`.
9
+ *
10
+ * @see https://www.mediawiki.org/wiki/API:Backlinks
11
+ */
12
+ import type { Flag, NamespaceIndex } from "../../common";
13
+ /** One page that links to the target title. */
14
+ export interface ApiBacklink {
15
+ /** Page id. */
16
+ pageid: number;
17
+ /** Namespace index. */
18
+ ns: NamespaceIndex;
19
+ /** Full page title. */
20
+ title: string;
21
+ /** The linking page is itself a redirect. A {@link Flag}. */
22
+ redirect?: Flag;
23
+ /**
24
+ * Pages that link through this redirect to the target title. Only on a
25
+ * `redirect` entry, and only with `blredirect=1`.
26
+ */
27
+ redirlinks?: ApiBacklink[];
28
+ }
29
+ declare module "./index" {
30
+ interface ApiQueryResult {
31
+ /** Pages linking to `bltitle` (`list=backlinks`). */
32
+ backlinks?: ApiBacklink[];
33
+ }
34
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * `list=blocks` — current active blocks, merged into {@link ApiQueryResult} via
3
+ * declaration merging. `bkprop=flags` expands each block flag into its own real
4
+ * boolean key under `formatversion=2` (present as `false` when unset).
5
+ *
6
+ * @see https://www.mediawiki.org/wiki/API:Blocks
7
+ */
8
+ import type { NamespaceIndex, Timestamp } from "../../common";
9
+ /** Restriction targets of a partial block, grouped by kind. */
10
+ export interface ApiBlockRestrictions {
11
+ /** Restricted pages. */
12
+ pages?: {
13
+ id: number;
14
+ ns?: NamespaceIndex;
15
+ title?: string;
16
+ }[];
17
+ /** Restricted namespace ids. */
18
+ namespaces?: number[];
19
+ /** Restricted actions; only on wikis with `$wgEnablePartialActionBlocks` enabled. */
20
+ actions?: string[];
21
+ }
22
+ /** One block record. `bkprop` controls which fields appear. */
23
+ export interface ApiBlock {
24
+ /** Block id. `bkprop=id`. */
25
+ id?: number;
26
+ /**
27
+ * Blocked user name, IP address or IP range; absent for every autoblock.
28
+ * `bkprop=user`.
29
+ */
30
+ user?: string;
31
+ /**
32
+ * Blocked user id; `0` when the target is an IP address or IP range, absent
33
+ * for every autoblock. `bkprop=userid`.
34
+ */
35
+ userid?: number;
36
+ /** Name of the admin who applied the block. `bkprop=by`. */
37
+ by?: string;
38
+ /** User id of the blocking admin. `bkprop=byid`. */
39
+ byid?: number;
40
+ /** When the block was applied. `bkprop=timestamp`. */
41
+ timestamp?: Timestamp;
42
+ /** When the block expires, or `infinity`. `bkprop=expiry`. */
43
+ expiry?: Timestamp | "infinity";
44
+ /**
45
+ * Human-readable duration, e.g. `3 months`, or the localized "infinite"
46
+ * message for a permanent block. `bkprop=expiry`.
47
+ *
48
+ * @since MediaWiki 1.44
49
+ */
50
+ "duration-l10n"?: string;
51
+ /** Raw block reason. `bkprop=reason`. */
52
+ reason?: string;
53
+ /**
54
+ * HTML-rendered block reason. `bkprop=parsedreason`; the 1.43 baseline
55
+ * rejects that value, so it only appears on newer wikis.
56
+ *
57
+ * @since MediaWiki 1.44
58
+ */
59
+ parsedreason?: string;
60
+ /**
61
+ * Start of the blocked IP range (hex form). `bkprop=range` on a range block;
62
+ * before 1.43 also emitted for single-IP blocks.
63
+ */
64
+ rangestart?: string;
65
+ /**
66
+ * End of the blocked IP range (hex form). `bkprop=range` on a range block;
67
+ * before 1.43 also emitted for single-IP blocks.
68
+ */
69
+ rangeend?: string;
70
+ /**
71
+ * Restriction targets of a partial block, grouped by kind; `[]` for a sitewide
72
+ * block. `bkprop=restrictions`.
73
+ */
74
+ restrictions?: ApiBlockRestrictions | unknown[];
75
+ /** Applied automatically by the autoblock feature. `bkprop=flags`. */
76
+ automatic?: boolean;
77
+ /** Blocks anonymous (edit-only) users. `bkprop=flags`. */
78
+ anononly?: boolean;
79
+ /** Prevents account creation. `bkprop=flags`. */
80
+ nocreate?: boolean;
81
+ /** Autoblock enabled for the offending IP. `bkprop=flags`. */
82
+ autoblock?: boolean;
83
+ /** Prevents sending email. `bkprop=flags`. */
84
+ noemail?: boolean;
85
+ /** Block is hidden from the block log. `bkprop=flags`. */
86
+ hidden?: boolean;
87
+ /**
88
+ * Suppression visibility of the block. `bkprop=flags`. Written as a separate
89
+ * key alongside {@link hidden}, with the same value (the block is oversighted).
90
+ *
91
+ * @since MediaWiki 1.46
92
+ */
93
+ "block-hidden"?: boolean;
94
+ /** Blocked user may still edit their own talk page. `bkprop=flags`. */
95
+ allowusertalk?: boolean;
96
+ /** Whether this is a partial block. `bkprop=flags`. */
97
+ partial?: boolean;
98
+ }
99
+ declare module "./index" {
100
+ interface ApiQueryResult {
101
+ /** Active blocks (`list=blocks`). */
102
+ blocks?: ApiBlock[];
103
+ }
104
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `prop=categories` — the categories a page belongs to, merged into the shared
3
+ * {@link ApiPage} shape via declaration merging.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Categories
6
+ */
7
+ import type { NamespaceIndex, Timestamp } from "../../common";
8
+ /** One category membership entry; `clprop` selects the optional fields. */
9
+ export interface ApiCategory {
10
+ /** Namespace index (the Category namespace, 14). */
11
+ ns: NamespaceIndex;
12
+ /** Full category title, e.g. `Category:Manual`. */
13
+ title: string;
14
+ /** Raw (hex) sort key. `clprop=sortkey`. */
15
+ sortkey?: string;
16
+ /** Human-readable sort key prefix. `clprop=sortkey`. */
17
+ sortkeyprefix?: string;
18
+ /** When the page was added to the category. `clprop=timestamp`. */
19
+ timestamp?: Timestamp;
20
+ /** Whether the category is hidden. `clprop=hidden`; a real `boolean` (not a `Flag`). */
21
+ hidden?: boolean;
22
+ }
23
+ declare module "./index" {
24
+ interface ApiPage {
25
+ /** Categories the page belongs to (`prop=categories`). */
26
+ categories?: ApiCategory[];
27
+ }
28
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `prop=categoryinfo` — membership counts for a category page, merged into
3
+ * {@link ApiPage} as an object (not an array).
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Categoryinfo
6
+ */
7
+ /** Category size statistics (`prop=categoryinfo`). */
8
+ export interface ApiCategoryInfo {
9
+ /** Total member count: pages + subcategories + files (the raw `cat_pages` counter). */
10
+ size: number;
11
+ /** Number of content pages, excluding both subcategories and files. */
12
+ pages: number;
13
+ /** Number of files. */
14
+ files: number;
15
+ /** Number of subcategories. */
16
+ subcats: number;
17
+ /** Whether the category is a hidden category. A real `boolean`. */
18
+ hidden: boolean;
19
+ }
20
+ declare module "./index" {
21
+ interface ApiPage {
22
+ /** Category membership counts (`prop=categoryinfo`). */
23
+ categoryinfo?: ApiCategoryInfo;
24
+ }
25
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `list=categorymembers` — the pages/subcategories/files in a category, merged
3
+ * into {@link ApiQueryResult} via declaration merging.
4
+ *
5
+ * Also used as a generator (`generator=categorymembers`), which instead feeds
6
+ * results into `query.pages` (combined with any `prop=`); the generator's
7
+ * cursor is `gcmcontinue`.
8
+ *
9
+ * @see https://www.mediawiki.org/wiki/API:Categorymembers
10
+ */
11
+ import type { NamespaceIndex, Timestamp } from "../../common";
12
+ /**
13
+ * Member type (`cmtype` / `gcmtype`). Open union for forward compatibility.
14
+ */
15
+ export type CategoryMemberType = "page" | "subcat" | "file" | (string & {});
16
+ /** One category member. `cmprop` controls which fields appear. */
17
+ export interface ApiCategoryMember {
18
+ /** Page id. `cmprop=ids`. */
19
+ pageid?: number;
20
+ /** Namespace index. */
21
+ ns?: NamespaceIndex;
22
+ /** Full page title. */
23
+ title?: string;
24
+ /** Raw (hex) sort key. `cmprop=sortkey`. */
25
+ sortkey?: string;
26
+ /** Human-readable sort key prefix. `cmprop=sortkeyprefix`. */
27
+ sortkeyprefix?: string;
28
+ /** Member type. `cmprop=type`. */
29
+ type?: CategoryMemberType;
30
+ /** When the page was added to the category. `cmprop=timestamp`. */
31
+ timestamp?: Timestamp;
32
+ }
33
+ declare module "./index" {
34
+ interface ApiQueryResult {
35
+ /** Category members (`list=categorymembers`). */
36
+ categorymembers?: ApiCategoryMember[];
37
+ }
38
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `list=codexicons` — fetch Codex icon definitions by name, merged into
3
+ * {@link ApiQueryResult}.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:CodexIcons
6
+ * @since MediaWiki 1.44
7
+ */
8
+ /**
9
+ * Directionality/language-aware icon definition (object form of
10
+ * {@link ApiCodexIcon}).
11
+ */
12
+ export interface ApiCodexIconDefinition {
13
+ /** SVG markup used when no direction-specific variant applies. */
14
+ default?: string;
15
+ /** SVG markup for left-to-right contexts. */
16
+ ltr?: string;
17
+ /** SVG markup for right-to-left contexts. */
18
+ rtl?: string;
19
+ /** Whether the icon should be flipped in right-to-left contexts. */
20
+ shouldFlip?: boolean;
21
+ /** Languages excluded from flipping, e.g. `["he", "yi"]`. */
22
+ shouldFlipExceptions?: string[];
23
+ /** Language-specific SVG markup, keyed by language code. */
24
+ langCodeMap?: Record<string, string>;
25
+ }
26
+ /** A Codex icon: raw SVG markup, or a directionality/language-aware definition. */
27
+ export type ApiCodexIcon = string | ApiCodexIconDefinition;
28
+ declare module "./index" {
29
+ interface ApiQueryResult {
30
+ /**
31
+ * Codex icon definitions, keyed by icon name (e.g. `cdxIconInfo`).
32
+ * `list=codexicons&names=…` (`names` is required). Simple icons are raw
33
+ * SVG markup strings; directionality/language-aware icons are definition
34
+ * objects.
35
+ *
36
+ * @since MediaWiki 1.44
37
+ */
38
+ codexicons?: Record<string, ApiCodexIcon> | unknown[];
39
+ }
40
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `prop=contributors` — the distinct editors of a page, merged into the shared
3
+ * {@link ApiPage} shape via declaration merging. Only logged-in contributors
4
+ * (registered and temporary accounts) are listed; anonymous (IP) editors are
5
+ * not, and only their distinct count is reported as `anoncontributors`.
6
+ *
7
+ * @see https://www.mediawiki.org/wiki/API:Contributors
8
+ */
9
+ /** One contributor entry: a logged-in (registered or temporary) editor. */
10
+ export interface ApiContributor {
11
+ /** User id of the contributor. */
12
+ userid: number;
13
+ /** Contributor name (IPs never appear as contributors). */
14
+ name: string;
15
+ }
16
+ declare module "./index" {
17
+ interface ApiPage {
18
+ /** Distinct logged-in contributors to the page (`prop=contributors`). */
19
+ contributors?: ApiContributor[];
20
+ /** Number of anonymous (IP) contributors to the page (`prop=contributors`). */
21
+ anoncontributors?: number;
22
+ }
23
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `prop=deletedrevisions` — revisions of a page that have been deleted
3
+ * (revision-deleted), merged into the shared {@link ApiPage}. Viewing revision
4
+ * comment fields requires the `deletedhistory` right, and viewing slot content
5
+ * requires `deletedtext` (or `undelete`).
6
+ *
7
+ * Rows share {@link ApiRevision} with `prop=revisions`: MediaWiki formats both
8
+ * with the same revision formatter, so the suppressed-field flags
9
+ * (`userhidden`/`commenthidden`/`texthidden`) apply here as well.
10
+ *
11
+ * Fully deleted pages come back with `missing` plus their archived revisions.
12
+ *
13
+ * @see https://www.mediawiki.org/wiki/API:Deletedrevisions
14
+ */
15
+ import type { ApiRevision } from "./revisions";
16
+ declare module "./index" {
17
+ interface ApiPage {
18
+ /** Deleted revisions of the page (`prop=deletedrevisions`). */
19
+ deletedrevisions?: ApiRevision[];
20
+ }
21
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `list=deletedrevs` — deleted revisions across the wiki, grouped per page.
3
+ *
4
+ * @deprecated since MediaWiki 1.25. Core answers the request with a deprecation
5
+ * notice in `warnings`; use `prop=deletedrevisions` for a known title or
6
+ * `list=alldeletedrevisions` to enumerate. Modeled anyway because clients still call it.
7
+ *
8
+ * Its `drprop` names predate the modern modules: `revid`/`parentid`/`minor`/`len`
9
+ * rather than `ids`/`flags`/`size`, and {@link ApiDeletedRev.len} is a **string**.
10
+ * Pages are grouped under a synthetic counter, which `formatversion=2` emits as a
11
+ * list — unlike `list=alldeletedrevisions`, which carries the real `pageid`.
12
+ *
13
+ * On 1.41+ `drprop=content` fails with an internal error; the other `drprop`
14
+ * values (including the deprecated `token`) still answer.
15
+ *
16
+ * @see https://www.mediawiki.org/wiki/API:Deletedrevs
17
+ */
18
+ import type { Flag, NamespaceIndex, Timestamp } from "../../common";
19
+ /** One archived revision, as `list=deletedrevs` formats it. */
20
+ export interface ApiDeletedRev {
21
+ /** Revision timestamp — returned unconditionally, not a `drprop` value. */
22
+ timestamp: Timestamp;
23
+ /** Revision id. `drprop=revid`. */
24
+ revid?: number;
25
+ /** Parent revision id; `0` for a page's first revision. `drprop=parentid`. */
26
+ parentid?: number;
27
+ /** Editor name. `drprop=user`. */
28
+ user?: string;
29
+ /** Editor user id. `drprop=userid`. */
30
+ userid?: number;
31
+ /** Raw edit summary. `drprop=comment`. */
32
+ comment?: string;
33
+ /** HTML-rendered edit summary. `drprop=parsedcomment`. */
34
+ parsedcomment?: string;
35
+ /** Whether the edit was marked minor. `drprop=minor`; a real `boolean`. */
36
+ minor?: boolean;
37
+ /**
38
+ * Revision size in bytes, **as a string** (`"19"`) — this module passes the raw
39
+ * archive column through. `drprop=len`.
40
+ */
41
+ len?: string;
42
+ /** Content checksum (hex), or `''` when unavailable. `drprop=sha1`. */
43
+ sha1?: string;
44
+ /** Change tags. `drprop=tags`; `[]` when none. */
45
+ tags?: string[];
46
+ /** The author is hidden. Revision-delete; a {@link Flag}. */
47
+ userhidden?: Flag;
48
+ /** The edit summary is hidden. Revision-delete; a {@link Flag}. */
49
+ commenthidden?: Flag;
50
+ /** The content is hidden, which also hides `sha1`. Revision-delete; a {@link Flag}. */
51
+ texthidden?: Flag;
52
+ /** The checksum is withheld. A {@link Flag}. */
53
+ sha1hidden?: Flag;
54
+ /** The revision is oversighted (in addition to being deleted). A {@link Flag}. */
55
+ suppressed?: Flag;
56
+ }
57
+ /** One page group. `drprop=content` also yields the revision text, which is not modeled. */
58
+ export interface ApiDeletedRevs {
59
+ /** Namespace index. */
60
+ ns: NamespaceIndex;
61
+ /** Full page title. */
62
+ title: string;
63
+ /** The page's archived revisions. */
64
+ revisions: ApiDeletedRev[];
65
+ /**
66
+ * Token for restoring the revisions; a CSRF token (the same value for every
67
+ * page), issued only to callers with the `undelete` right on same-origin
68
+ * requests. `drprop=token`.
69
+ *
70
+ * @deprecated since MediaWiki 1.24; request a CSRF token from `meta=tokens`
71
+ * instead.
72
+ */
73
+ token?: string;
74
+ }
75
+ declare module "./index" {
76
+ interface ApiQueryResult {
77
+ /**
78
+ * Deleted revisions grouped per page (`list=deletedrevs`).
79
+ *
80
+ * @deprecated since MediaWiki 1.25; prefer {@link ApiQueryResult.alldeletedrevisions}.
81
+ */
82
+ deletedrevs?: ApiDeletedRevs[];
83
+ }
84
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * `prop=duplicatefiles` — other files that share a file's checksum, merged into
3
+ * the shared {@link ApiPage}. How a client discovers a “this file already exists”
4
+ * answer after the fact; `list=allimages` and `prop=imageinfo` reach the same
5
+ * rows by `sha1`.
6
+ *
7
+ * The module takes no `prop` parameter: `name`, `timestamp` and `shared` are
8
+ * always present, while `user` needs a visible uploader.
9
+ * `dflocalonly` limits it to the local repo, `dfdir`/`dfcontinue` page it.
10
+ *
11
+ * @see https://www.mediawiki.org/wiki/API:Duplicatefiles
12
+ */
13
+ import type { Timestamp } from "../../common";
14
+ /** One other file with the same content. */
15
+ export interface ApiDuplicateFile {
16
+ /** File name with underscores, without the `File:` prefix. */
17
+ name: string;
18
+ /** When that file's current version was uploaded. */
19
+ timestamp: Timestamp;
20
+ /** Whether the file lives on a shared repo rather than this wiki. A real `boolean`. */
21
+ shared: boolean;
22
+ /** Uploader of that file's current version. Absent when the uploader is hidden. */
23
+ user?: string;
24
+ }
25
+ declare module "./index" {
26
+ interface ApiPage {
27
+ /** Files whose content matches this one (`prop=duplicatefiles`). */
28
+ duplicatefiles?: ApiDuplicateFile[];
29
+ }
30
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `list=embeddedin` — pages that transclude (embed) a given title, merged into
3
+ * {@link ApiQueryResult}. The title-based sibling of `prop=transcludedin`.
4
+ *
5
+ * The module has no `eiprop` parameter: every entry always carries `pageid`,
6
+ * `ns` and `title`. Unlike `list=backlinks`, there is no redirect parameter, so
7
+ * results are never nested.
8
+ *
9
+ * @see https://www.mediawiki.org/wiki/API:Embeddedin
10
+ */
11
+ import type { Flag, NamespaceIndex } from "../../common";
12
+ /** One page that embeds the target title. */
13
+ export interface ApiEmbeddedIn {
14
+ /** Page id. */
15
+ pageid: number;
16
+ /** Namespace index. */
17
+ ns: NamespaceIndex;
18
+ /** Full page title. */
19
+ title: string;
20
+ /** The embedding page is itself a redirect. A {@link Flag}. */
21
+ redirect?: Flag;
22
+ }
23
+ declare module "./index" {
24
+ interface ApiQueryResult {
25
+ /** Pages embedding `eititle` (`list=embeddedin`). */
26
+ embeddedin?: ApiEmbeddedIn[];
27
+ }
28
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `prop=extlinks` — external (non-wiki) URLs linked by a page, merged into
3
+ * {@link ApiPage}.
4
+ *
5
+ * @see https://www.mediawiki.org/wiki/API:Extlinks
6
+ */
7
+ /** One external link used by a page. */
8
+ export interface ApiExternalLink {
9
+ /** Full external URL. */
10
+ url: string;
11
+ }
12
+ declare module "./index" {
13
+ interface ApiPage {
14
+ /** External links on this page (`prop=extlinks`). */
15
+ extlinks?: ApiExternalLink[];
16
+ }
17
+ }