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.
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/README.zh.md +57 -0
- package/dist/common/index.d.ts +87 -0
- package/dist/core/acquiretempusername.d.ts +17 -0
- package/dist/core/block.d.ts +98 -0
- package/dist/core/changeauthenticationdata.d.ts +18 -0
- package/dist/core/changecontentmodel.d.ts +27 -0
- package/dist/core/checktoken.d.ts +28 -0
- package/dist/core/clearhasmsg.d.ts +15 -0
- package/dist/core/clientlogin.d.ts +48 -0
- package/dist/core/compare.d.ts +92 -0
- package/dist/core/createaccount.d.ts +41 -0
- package/dist/core/delete.d.ts +45 -0
- package/dist/core/edit.d.ts +66 -0
- package/dist/core/emailuser.d.ts +27 -0
- package/dist/core/expandtemplates.d.ts +66 -0
- package/dist/core/filerevert.d.ts +20 -0
- package/dist/core/imagerotate.d.ts +51 -0
- package/dist/core/import.d.ts +29 -0
- package/dist/core/index.d.ts +40 -0
- package/dist/core/languagesearch.d.ts +24 -0
- package/dist/core/login.d.ts +30 -0
- package/dist/core/logout.d.ts +16 -0
- package/dist/core/managetags.d.ts +28 -0
- package/dist/core/mergehistory.d.ts +26 -0
- package/dist/core/move.d.ts +62 -0
- package/dist/core/options.d.ts +16 -0
- package/dist/core/parse.d.ts +324 -0
- package/dist/core/patrol.d.ts +21 -0
- package/dist/core/protect.d.ts +43 -0
- package/dist/core/purge.d.ts +61 -0
- package/dist/core/query/allcategories.d.ts +30 -0
- package/dist/core/query/alldeletedrevisions.d.ts +29 -0
- package/dist/core/query/allfileusages.d.ts +15 -0
- package/dist/core/query/allimages.d.ts +25 -0
- package/dist/core/query/alllinks.d.ts +34 -0
- package/dist/core/query/allmessages.d.ts +43 -0
- package/dist/core/query/allpages.d.ts +23 -0
- package/dist/core/query/allredirects.d.ts +23 -0
- package/dist/core/query/allrevisions.d.ts +30 -0
- package/dist/core/query/alltransclusions.d.ts +14 -0
- package/dist/core/query/allusers.d.ts +37 -0
- package/dist/core/query/authmanagerinfo.d.ts +96 -0
- package/dist/core/query/backlinks.d.ts +34 -0
- package/dist/core/query/blocks.d.ts +104 -0
- package/dist/core/query/categories.d.ts +28 -0
- package/dist/core/query/categoryinfo.d.ts +25 -0
- package/dist/core/query/categorymembers.d.ts +38 -0
- package/dist/core/query/codexicons.d.ts +40 -0
- package/dist/core/query/contributors.d.ts +23 -0
- package/dist/core/query/deletedrevisions.d.ts +21 -0
- package/dist/core/query/deletedrevs.d.ts +84 -0
- package/dist/core/query/duplicatefiles.d.ts +30 -0
- package/dist/core/query/embeddedin.d.ts +28 -0
- package/dist/core/query/extlinks.d.ts +17 -0
- package/dist/core/query/exturlusage.d.ts +30 -0
- package/dist/core/query/filearchive.d.ts +91 -0
- package/dist/core/query/filerepoinfo.d.ts +51 -0
- package/dist/core/query/fileusage.d.ts +26 -0
- package/dist/core/query/imageinfo.d.ts +214 -0
- package/dist/core/query/images.d.ts +20 -0
- package/dist/core/query/imageusage.d.ts +36 -0
- package/dist/core/query/index.d.ts +489 -0
- package/dist/core/query/info.d.ts +208 -0
- package/dist/core/query/iwbacklinks.d.ts +28 -0
- package/dist/core/query/iwlinks.d.ts +21 -0
- package/dist/core/query/langbacklinks.d.ts +28 -0
- package/dist/core/query/langlinks.d.ts +32 -0
- package/dist/core/query/languageinfo.d.ts +70 -0
- package/dist/core/query/links.d.ts +22 -0
- package/dist/core/query/linkshere.d.ts +25 -0
- package/dist/core/query/logevents.d.ts +77 -0
- package/dist/core/query/mystashedfiles.d.ts +39 -0
- package/dist/core/query/pagepropnames.d.ts +18 -0
- package/dist/core/query/pageprops.d.ts +19 -0
- package/dist/core/query/pageswithprop.d.ts +28 -0
- package/dist/core/query/prefixsearch.d.ts +27 -0
- package/dist/core/query/protectedtitles.d.ts +43 -0
- package/dist/core/query/querypage.d.ts +59 -0
- package/dist/core/query/random.d.ts +30 -0
- package/dist/core/query/recentchanges.d.ts +103 -0
- package/dist/core/query/redirects.d.ts +27 -0
- package/dist/core/query/revisions.d.ts +176 -0
- package/dist/core/query/search.d.ts +141 -0
- package/dist/core/query/siteinfo.d.ts +731 -0
- package/dist/core/query/stashimageinfo.d.ts +101 -0
- package/dist/core/query/tags.d.ts +34 -0
- package/dist/core/query/templates.d.ts +20 -0
- package/dist/core/query/tokens.d.ts +34 -0
- package/dist/core/query/trackingcategories.d.ts +25 -0
- package/dist/core/query/transcludedin.d.ts +25 -0
- package/dist/core/query/usercontribs.d.ts +72 -0
- package/dist/core/query/userinfo.d.ts +141 -0
- package/dist/core/query/users.d.ts +164 -0
- package/dist/core/query/watchlist.d.ts +109 -0
- package/dist/core/query/watchlistraw.d.ts +42 -0
- package/dist/core/removeauthenticationdata.d.ts +18 -0
- package/dist/core/resetpassword.d.ts +16 -0
- package/dist/core/revisiondelete.d.ts +83 -0
- package/dist/core/rollback.d.ts +27 -0
- package/dist/core/setnotificationtimestamp.d.ts +47 -0
- package/dist/core/setpagelanguage.d.ts +24 -0
- package/dist/core/stashedit.d.ts +25 -0
- package/dist/core/tag.d.ts +49 -0
- package/dist/core/upload.d.ts +106 -0
- package/dist/core/userrights.d.ts +41 -0
- package/dist/core/validatepassword.d.ts +28 -0
- package/dist/core/watch.d.ts +45 -0
- package/dist/envelope/index.d.ts +122 -0
- package/dist/extensions/abusefilters.d.ts +207 -0
- package/dist/extensions/babel.d.ts +32 -0
- package/dist/extensions/categorytree.d.ts +78 -0
- package/dist/extensions/checkuser.d.ts +148 -0
- package/dist/extensions/description.d.ts +22 -0
- package/dist/extensions/discussiontools.d.ts +273 -0
- package/dist/extensions/echo.d.ts +306 -0
- package/dist/extensions/extracts.d.ts +24 -0
- package/dist/extensions/flaggedrevs.d.ts +192 -0
- package/dist/extensions/gadgets.d.ts +148 -0
- package/dist/extensions/globalblocks.d.ts +115 -0
- package/dist/extensions/globalpreferences.d.ts +62 -0
- package/dist/extensions/globalusage.d.ts +41 -0
- package/dist/extensions/globaluserinfo.d.ts +95 -0
- package/dist/extensions/linter.d.ts +83 -0
- package/dist/extensions/massmessage.d.ts +108 -0
- package/dist/extensions/oathauth.d.ts +86 -0
- package/dist/extensions/pageimages.d.ts +33 -0
- package/dist/extensions/pageviews.d.ts +63 -0
- package/dist/extensions/scribunto.d.ts +61 -0
- package/dist/extensions/sitematrix.d.ts +109 -0
- package/dist/extensions/spamblacklist.d.ts +25 -0
- package/dist/extensions/templatedata.d.ts +130 -0
- package/dist/extensions/thanks.d.ts +29 -0
- package/dist/extensions/timedmediahandler.d.ts +121 -0
- package/dist/extensions/titleblacklist.d.ts +29 -0
- package/dist/extensions/urlshortener.d.ts +42 -0
- package/dist/extensions/visualeditor.d.ts +204 -0
- package/dist/extensions/wikibase.d.ts +100 -0
- package/dist/extensions/wikilove.d.ts +38 -0
- package/dist/index.d.ts +3 -0
- package/package.json +76 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **TemplateData** (`action=templatedata`).
|
|
3
|
+
*
|
|
4
|
+
* Not in the default export. Standalone action response — import it directly:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { ApiTemplateDataResponse } from 'types-mediawiki-response/ext/templatedata';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* `pages` is a **map keyed by page id** (a negative id for each missing title),
|
|
11
|
+
* not an array. Only pages carrying the `templatedata` page prop are listed;
|
|
12
|
+
* `includeMissingTitles=1` additionally returns titles that do not exist
|
|
13
|
+
* (`missing: true`) and existing pages without a `<templatedata>` block
|
|
14
|
+
* (`notemplatedata: true`), whose `params` hold just the parameter names
|
|
15
|
+
* extracted from the raw wikitext. Because `maps` is a PHP map, an empty one
|
|
16
|
+
* arrives as `[]` under `formatversion=2`.
|
|
17
|
+
*
|
|
18
|
+
* The InterfaceText fields (`label`, `description`, `default`, `example`, set
|
|
19
|
+
* labels) arrive as objects keyed by language code; passing `lang` resolves
|
|
20
|
+
* each one to a single string (requested language, then its fallbacks, then
|
|
21
|
+
* the site content language). `inherits` links between parameters are
|
|
22
|
+
* resolved when the blob is saved and never appear in a response. A corrupted
|
|
23
|
+
* block surfaces as the `templatedata-corrupt` error rather than as a page
|
|
24
|
+
* entry.
|
|
25
|
+
*
|
|
26
|
+
* @see https://www.mediawiki.org/wiki/Extension:TemplateData
|
|
27
|
+
*/
|
|
28
|
+
import type { ApiQueryContinue, ApiQueryNormalized } from "../core/query";
|
|
29
|
+
import type { ApiRedirect } from "../core/query/redirects";
|
|
30
|
+
import type { ApiEnvelope } from "../envelope";
|
|
31
|
+
/**
|
|
32
|
+
* Parameter type a template expects, as accepted by the validator (`content`,
|
|
33
|
+
* `line`, `number`, `boolean`, `string`, `date`, `unbalanced-wikitext`,
|
|
34
|
+
* `unknown`, `url`, `wiki-page-name`, `wiki-user-name`, `wiki-file-name`,
|
|
35
|
+
* `wiki-template-name`). Hook handlers may register additional names, so
|
|
36
|
+
* consumers must tolerate values outside this list.
|
|
37
|
+
*/
|
|
38
|
+
export type TemplateDataType = "boolean" | "content" | "date" | "line" | "number" | "string" | "unbalanced-wikitext" | "unknown" | "url" | "wiki-file-name" | "wiki-page-name" | "wiki-template-name" | "wiki-user-name" | (string & {});
|
|
39
|
+
/**
|
|
40
|
+
* InterfaceText as served: a map keyed by language code (`{"en": "Nowrap?"}`).
|
|
41
|
+
* A plain string only when the request passes `lang`, which resolves each text
|
|
42
|
+
* to a single language (requested language, then its fallbacks, then the site
|
|
43
|
+
* content language).
|
|
44
|
+
*/
|
|
45
|
+
export type ApiTemplateDataText = string | Record<string, string>;
|
|
46
|
+
/** One parameter description (`params.<name>`). */
|
|
47
|
+
export interface ApiTemplateDataParam {
|
|
48
|
+
/** Display label. */
|
|
49
|
+
label?: ApiTemplateDataText | null;
|
|
50
|
+
/** Longer explanation shown to editors. */
|
|
51
|
+
description?: ApiTemplateDataText | null;
|
|
52
|
+
/** The template does not work without it. Defaults to `false`. */
|
|
53
|
+
required?: boolean;
|
|
54
|
+
/** Worth filling in but not mandatory. Defaults to `false`. */
|
|
55
|
+
suggested?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Discouraged. Either a boolean or, better, the text explaining what to use
|
|
58
|
+
* instead.
|
|
59
|
+
*/
|
|
60
|
+
deprecated?: boolean | string;
|
|
61
|
+
/** Other names this parameter answers to. */
|
|
62
|
+
aliases?: string[];
|
|
63
|
+
/** Expected kind of the value. */
|
|
64
|
+
type?: TemplateDataType;
|
|
65
|
+
/** Value auto-inserted when the parameter is used, e.g. `{{subst:CURRENTYEAR}}`. */
|
|
66
|
+
autovalue?: string | null;
|
|
67
|
+
/** Assumed value when the parameter is absent from a transclusion. */
|
|
68
|
+
default?: ApiTemplateDataText | null;
|
|
69
|
+
/** Commonly used values offered as completion; free text stays allowed. */
|
|
70
|
+
suggestedvalues?: string[];
|
|
71
|
+
/** Example value shown to help editors. */
|
|
72
|
+
example?: ApiTemplateDataText | null;
|
|
73
|
+
}
|
|
74
|
+
/** A group of parameters presented together (`sets[]`). */
|
|
75
|
+
export interface ApiTemplateDataSet {
|
|
76
|
+
/** Set label. Required by the validator, so always present. */
|
|
77
|
+
label: ApiTemplateDataText;
|
|
78
|
+
/** Names of the parameters this set groups. Required and non-empty. */
|
|
79
|
+
params: string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A consumer-specific mapping (`maps.<consumer>`). Keys are consumer-defined
|
|
83
|
+
* and not validated; each value references parameters of the template — a
|
|
84
|
+
* parameter name, a list of names, or a list of lists of names.
|
|
85
|
+
*/
|
|
86
|
+
export type ApiTemplateDataMap = Record<string, string | string[] | string[][]>;
|
|
87
|
+
/** The stored TemplateData block of one template. */
|
|
88
|
+
export interface ApiTemplateDataRoot {
|
|
89
|
+
/** One-line description of the template. */
|
|
90
|
+
description?: ApiTemplateDataText | null;
|
|
91
|
+
/**
|
|
92
|
+
* Parameter descriptions, keyed by parameter name. Full objects for pages
|
|
93
|
+
* with TemplateData; for `notemplatedata` pages only the names extracted
|
|
94
|
+
* from raw wikitext, each mapping to an empty entry.
|
|
95
|
+
*/
|
|
96
|
+
params?: Record<string, ApiTemplateDataParam | unknown[]> | unknown[];
|
|
97
|
+
/**
|
|
98
|
+
* Parameter order for display — a complete permutation of the keys of
|
|
99
|
+
* `params`; the validator rejects a partial or duplicated list.
|
|
100
|
+
*/
|
|
101
|
+
paramOrder?: string[];
|
|
102
|
+
/**
|
|
103
|
+
* Parameter groups. An **array** of {@link ApiTemplateDataSet} (the stored
|
|
104
|
+
* shape; a map there is rejected with `templatedata-invalid-type`).
|
|
105
|
+
*/
|
|
106
|
+
sets?: ApiTemplateDataSet[];
|
|
107
|
+
/** Consumer-specific maps, keyed by consumer identifier. */
|
|
108
|
+
maps?: Record<string, ApiTemplateDataMap> | unknown[];
|
|
109
|
+
/** Preferred transclusion layout, or a FormatString. */
|
|
110
|
+
format?: "inline" | "block" | (string & {}) | null;
|
|
111
|
+
}
|
|
112
|
+
/** One entry of `pages`, keyed by page id. */
|
|
113
|
+
export interface ApiTemplateDataPage extends ApiTemplateDataRoot {
|
|
114
|
+
/** Page title. */
|
|
115
|
+
title?: string;
|
|
116
|
+
/** `true` for a requested title that does not exist. */
|
|
117
|
+
missing?: true;
|
|
118
|
+
/** `true` when the page exists but carries no `<templatedata>` block. */
|
|
119
|
+
notemplatedata?: true;
|
|
120
|
+
}
|
|
121
|
+
/** Response of `action=templatedata`. */
|
|
122
|
+
export interface ApiTemplateDataResponse extends ApiEnvelope {
|
|
123
|
+
continue?: ApiQueryContinue;
|
|
124
|
+
/** Title normalizations applied to the request. */
|
|
125
|
+
normalized?: ApiQueryNormalized[];
|
|
126
|
+
/** Redirects followed to reach the requested titles. */
|
|
127
|
+
redirects?: ApiRedirect[];
|
|
128
|
+
/** Entries keyed by page id (negative for missing titles). */
|
|
129
|
+
pages: Record<string, ApiTemplateDataPage>;
|
|
130
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **Thanks** (`action=thank`).
|
|
3
|
+
*
|
|
4
|
+
* Not in the default export. This is a standalone action response — import and use
|
|
5
|
+
* it directly (no declaration merging needed):
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { ApiThankResponse } from 'types-mediawiki-response/ext/thanks';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* `ApiCoreThank::markResultSuccess` writes a top-level `result` object (not a
|
|
12
|
+
* `thank` key); every failure (invalid revision, self-thanks, rate limit …) is a
|
|
13
|
+
* top-level {@link ApiErrorResponse} via `dieWithError`, so the success shape is
|
|
14
|
+
* the only body. `success` is the number `1`.
|
|
15
|
+
*
|
|
16
|
+
* @see https://www.mediawiki.org/wiki/Extension:Thanks
|
|
17
|
+
*/
|
|
18
|
+
import type { ApiEnvelope } from "../envelope";
|
|
19
|
+
/** The `result` object of a successful `action=thank`. */
|
|
20
|
+
export interface ApiThankResult {
|
|
21
|
+
/** `1` when the thanks was recorded (also for a duplicate thanks, which pretends success). */
|
|
22
|
+
success: number;
|
|
23
|
+
/** Canonical name of the thanked user. */
|
|
24
|
+
recipient: string;
|
|
25
|
+
}
|
|
26
|
+
/** Response of `action=thank`. */
|
|
27
|
+
export interface ApiThankResponse extends ApiEnvelope {
|
|
28
|
+
result: ApiThankResult;
|
|
29
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **TimedMediaHandler** (audio/video;
|
|
3
|
+
* `prop=videoinfo`, `prop=transcodestatus`, `action=transcodereset`).
|
|
4
|
+
*
|
|
5
|
+
* Not in the default export: importing anything from this file — even just the
|
|
6
|
+
* field-group type you are about to use — activates the augmentation shipped at
|
|
7
|
+
* the bottom, which merges the field groups into the root package automatically
|
|
8
|
+
* (no manual `declare module`):
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import type {} from 'types-mediawiki-response/ext/timedmediahandler';
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* `action=timedtext` is deliberately not modeled: it serves the raw subtitle
|
|
15
|
+
* text through `ApiFormatRaw` (an srt/vtt body, not a JSON object).
|
|
16
|
+
*
|
|
17
|
+
* fv2 notes: `transcodestatus` maps each transcode key to the raw `transcode`
|
|
18
|
+
* table row (minus `id`/`image_name`/`key`); its `time_*` keys are nullable
|
|
19
|
+
* 14-digit MediaWiki timestamps (`null` — not omission — when the step has not
|
|
20
|
+
* run) and `final_bitrate` passes the DB column through uncast, so it may be a
|
|
21
|
+
* number or a string depending on the database driver. A file without
|
|
22
|
+
* transcodes reports `[]`, since PHP's empty map serializes as an array.
|
|
23
|
+
*
|
|
24
|
+
* @see https://www.mediawiki.org/wiki/Extension:TimedMediaHandler
|
|
25
|
+
*/
|
|
26
|
+
import type { ApiEnvelope } from "../envelope";
|
|
27
|
+
import type { ApiImageInfo } from "../core/query/imageinfo";
|
|
28
|
+
/**
|
|
29
|
+
* One source of a video's `derivatives` list (the original file first, then
|
|
30
|
+
* each ready transcode). Audio files report `width`/`height` as `0`.
|
|
31
|
+
*/
|
|
32
|
+
export interface ApiVideoSource {
|
|
33
|
+
/** Direct URL to the file / transcode. */
|
|
34
|
+
src?: string;
|
|
35
|
+
/** MIME type, e.g. `video/webm; codecs="vp9, opus"`. */
|
|
36
|
+
type?: string;
|
|
37
|
+
/** Transcode key of a derivative (absent for the original file source). */
|
|
38
|
+
transcodekey?: string;
|
|
39
|
+
/** Video width in pixels (`0` for audio). */
|
|
40
|
+
width?: number;
|
|
41
|
+
/** Video height in pixels (`0` for audio). */
|
|
42
|
+
height?: number;
|
|
43
|
+
/** Average bandwidth in bit/s, when the handler reports one. */
|
|
44
|
+
bandwidth?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Human-readable label, carried only by the HLS playlist source
|
|
47
|
+
* (`transcodekey` `m3u8`).
|
|
48
|
+
*/
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Short form of {@link title}. */
|
|
51
|
+
shorttitle?: string;
|
|
52
|
+
}
|
|
53
|
+
/** One subtitle track of `viprop=timedtext` (one entry per track format). */
|
|
54
|
+
export interface ApiVideoTimedTextTrack {
|
|
55
|
+
/**
|
|
56
|
+
* URL of the subtitle stream (an `action=timedtext` API URL, already carrying
|
|
57
|
+
* `origin=*` for cross-origin playback).
|
|
58
|
+
*/
|
|
59
|
+
src?: string;
|
|
60
|
+
/** Track kind; `subtitles` for text tracks TMH generates. */
|
|
61
|
+
kind?: "subtitles" | (string & {});
|
|
62
|
+
/** MIME type of the track, e.g. `text/x-srt` or `text/vtt`. */
|
|
63
|
+
type?: string;
|
|
64
|
+
/** Track language (BCP 47). */
|
|
65
|
+
srclang?: string;
|
|
66
|
+
/** Text direction of the track language, `ltr` or `rtl`. */
|
|
67
|
+
dir?: "ltr" | "rtl" | (string & {});
|
|
68
|
+
/** Human-readable track label including the language name. */
|
|
69
|
+
label?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* One video-info entry for a file page: the imageinfo fields (`viprop` mirrors
|
|
73
|
+
* the `iiprop` names) plus TMH's `derivatives` and `timedtext` lists.
|
|
74
|
+
*/
|
|
75
|
+
export interface ApiVideoInfo extends ApiImageInfo {
|
|
76
|
+
/** Original file source followed by every ready transcode. `viprop=derivatives`. */
|
|
77
|
+
derivatives?: ApiVideoSource[];
|
|
78
|
+
/**
|
|
79
|
+
* Available subtitle tracks (one per language and format); `[]` when the file
|
|
80
|
+
* has none. `viprop=timedtext`.
|
|
81
|
+
*/
|
|
82
|
+
timedtext?: ApiVideoTimedTextTrack[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* One transcode state of `prop=transcodestatus`, keyed by transcode key (e.g.
|
|
86
|
+
* `240p.vp9.webm`) on the file page. The keys mirror the `transcode` table
|
|
87
|
+
* columns with the `transcode_` prefix stripped.
|
|
88
|
+
*/
|
|
89
|
+
export interface ApiTranscodeState {
|
|
90
|
+
/** Error output of the transcode run; `""` unless the transcode failed. */
|
|
91
|
+
error?: string;
|
|
92
|
+
/** When the job was queued; a 14-digit MediaWiki timestamp or `null`. */
|
|
93
|
+
time_addjob?: string | null;
|
|
94
|
+
/** When the job started working; a 14-digit MediaWiki timestamp or `null`. */
|
|
95
|
+
time_startwork?: string | null;
|
|
96
|
+
/** When the transcode finished; a 14-digit MediaWiki timestamp or `null`. */
|
|
97
|
+
time_success?: string | null;
|
|
98
|
+
/** When the transcode failed; a 14-digit MediaWiki timestamp or `null`. */
|
|
99
|
+
time_error?: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Achieved bitrate in bit/s of the finished transcode, passed through from
|
|
102
|
+
* the database uncast — may be a number or a numeric string.
|
|
103
|
+
*/
|
|
104
|
+
final_bitrate?: number | string;
|
|
105
|
+
}
|
|
106
|
+
/** Response of `action=transcodereset` (requires the `transcode-reset` right). */
|
|
107
|
+
export interface ApiTranscodeResetResponse extends ApiEnvelope {
|
|
108
|
+
/** `removed transcode` on success; failures are top-level error responses. */
|
|
109
|
+
success?: string;
|
|
110
|
+
}
|
|
111
|
+
declare module "types-mediawiki-response" {
|
|
112
|
+
interface ApiPage {
|
|
113
|
+
/** File info extended with video sources and subtitle tracks. */
|
|
114
|
+
videoinfo?: ApiVideoInfo[];
|
|
115
|
+
/**
|
|
116
|
+
* Per-transcode job states, keyed by transcode key; `[]` — an empty array,
|
|
117
|
+
* not an empty object — when the file has no transcodes at all.
|
|
118
|
+
*/
|
|
119
|
+
transcodestatus?: Record<string, ApiTranscodeState> | unknown[];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **TitleBlacklist** (`action=titleblacklist`).
|
|
3
|
+
*
|
|
4
|
+
* Not in the default export. Standalone action response — import it directly:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { ApiTitleBlacklistResponse } from 'types-mediawiki-response/ext/titleblacklist';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* `ApiTitleBlacklist` reports the check under `titleblacklist`: `result` is `ok`
|
|
11
|
+
* (no match) or `blacklisted`; on a match it returns the offending `line` plus a
|
|
12
|
+
* human `reason` and the `message` key.
|
|
13
|
+
*
|
|
14
|
+
* @see https://www.mediawiki.org/wiki/Extension:TitleBlacklist
|
|
15
|
+
*/
|
|
16
|
+
import type { ApiEnvelope } from "../envelope";
|
|
17
|
+
/** Response of `action=titleblacklist`. */
|
|
18
|
+
export interface ApiTitleBlacklistResponse extends ApiEnvelope {
|
|
19
|
+
titleblacklist: {
|
|
20
|
+
/** Whether the title matched the blacklist. Open union for forward compat. */
|
|
21
|
+
result: "ok" | "blacklisted" | (string & {});
|
|
22
|
+
/** Reason shown to the user (parsed HTML or plain text); only on a match. */
|
|
23
|
+
reason?: string;
|
|
24
|
+
/** Message key of the match: the entry's custom message when set, else `titleblacklist-forbidden-{action}` (`create` uses the `edit` variant). Only on a match. */
|
|
25
|
+
message?: string;
|
|
26
|
+
/** The matching blacklist line, HTML-escaped. Only on a match. */
|
|
27
|
+
line?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **UrlShortener** (`action=shortenurl`).
|
|
3
|
+
*
|
|
4
|
+
* A standalone action response — import and use it directly (no declaration
|
|
5
|
+
* merging needed):
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { ApiShortenUrlResponse } from 'types-mediawiki-response/ext/urlshortener';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Requires the `urlshortener-create-url` right (granted to all users by
|
|
12
|
+
* default) and that the target URL matches `$wgUrlShortenerAllowedDomains`;
|
|
13
|
+
* disallowed domains are top-level `ApiErrorResponse`s. The short URL template
|
|
14
|
+
* follows `$wgUrlShortenerTemplate` / `$wgUrlShortenerServer`. On wikis with
|
|
15
|
+
* QR codes enabled, `qrcode=1` returns the code as SVG markup in `qrcode`, and
|
|
16
|
+
* the short URL keys are then omitted unless the URL was long enough to need
|
|
17
|
+
* shortening.
|
|
18
|
+
*
|
|
19
|
+
* @see https://www.mediawiki.org/wiki/Extension:UrlShortener
|
|
20
|
+
*/
|
|
21
|
+
import type { ApiEnvelope } from "../envelope";
|
|
22
|
+
/** The `shortenurl` object of an `action=shortenurl` response. */
|
|
23
|
+
export interface ApiShortenUrlResult {
|
|
24
|
+
/** Full short URL carrying the base-32 short code. */
|
|
25
|
+
shorturl?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Alternative short URL using the alternate code mapping (a string whose
|
|
28
|
+
* characters are individually base-32-shifted), kept valid in parallel.
|
|
29
|
+
*/
|
|
30
|
+
shorturlalt?: string;
|
|
31
|
+
/**
|
|
32
|
+
* SVG markup of a QR code encoding the target URL, when `qrcode=1` was passed
|
|
33
|
+
* and the wiki has QR codes enabled.
|
|
34
|
+
*
|
|
35
|
+
* @since MediaWiki 1.41
|
|
36
|
+
*/
|
|
37
|
+
qrcode?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Response of `action=shortenurl`. */
|
|
40
|
+
export interface ApiShortenUrlResponse extends ApiEnvelope {
|
|
41
|
+
shortenurl: ApiShortenUrlResult;
|
|
42
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **VisualEditor** (`action=visualeditor`,
|
|
3
|
+
* `action=visualeditoredit`, `action=editcheckreferenceurl`).
|
|
4
|
+
*
|
|
5
|
+
* Not in the default export. Standalone action responses — import what you need:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { ApiVisualEditorResponse } from 'types-mediawiki-response/ext/visualeditor';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* `paction` selects which fields appear, and both modules write at the **root**
|
|
12
|
+
* of the envelope (next to `query`, not inside it):
|
|
13
|
+
* * `metadata` → the edit-form frame only (`canEdit`, `blockinfo`, timestamps…);
|
|
14
|
+
* * `wikitext` / `parse` → add `content` (+ `preloaded`); `parsefragment`
|
|
15
|
+
* returns only `{ result, content }`;
|
|
16
|
+
* * `templatesused` → `visualeditor` is a bare HTML **string** (a
|
|
17
|
+
* `<div class="templatesUsed">` block), not the usual object.
|
|
18
|
+
*
|
|
19
|
+
* `notices` and `blockinfo` show the two classic PHP-to-JSON traps: `notices` is
|
|
20
|
+
* a message-keyed map once populated but an empty **array** when there are none,
|
|
21
|
+
* and `blockinfo` is `null` rather than absent for an unblocked user.
|
|
22
|
+
*
|
|
23
|
+
* `action=visualeditoredit` requires a `paction` parameter selecting the
|
|
24
|
+
* operation (`save`, `diff`, `serialize`, `serializeforcache`). `save` returns
|
|
25
|
+
* the same page-frame shape as an `action=edit`-style response; `serialize*` need
|
|
26
|
+
* `html` rather than a page; `page` is required throughout — a title that does
|
|
27
|
+
* not exist yet is fine, but omitting `page` is a `missingparam` error.
|
|
28
|
+
*
|
|
29
|
+
* These are internal modules (`isInternal`), not part of the published API
|
|
30
|
+
* surface. Permission failures from the Parsoid render step surface as the
|
|
31
|
+
* REST-layer `rest-permission-error` error, not as a `blockinfo` field.
|
|
32
|
+
*
|
|
33
|
+
* @see https://www.mediawiki.org/wiki/Extension:VisualEditor
|
|
34
|
+
*/
|
|
35
|
+
import type { Flag, Timestamp } from "../common";
|
|
36
|
+
import type { ApiEditResult } from "../core/edit";
|
|
37
|
+
import type { ApiEnvelope } from "../envelope";
|
|
38
|
+
/** One field of the edit form (`checkboxesDef.wpMinoredit`, `wpWatchthis`, `wpWatchlistExpiry`). */
|
|
39
|
+
export interface ApiVisualEditorCheckboxDef {
|
|
40
|
+
/** Element id, e.g. `wpMinoredit`. */
|
|
41
|
+
id?: string;
|
|
42
|
+
/** Message key holding the label. */
|
|
43
|
+
"label-message"?: string;
|
|
44
|
+
/** Message key for the label's `title` attribute; hook-provided checkboxes only. */
|
|
45
|
+
"title-message"?: string;
|
|
46
|
+
/** DOM id of the labelled element. */
|
|
47
|
+
"label-id"?: string;
|
|
48
|
+
/** Legacy form field name. */
|
|
49
|
+
"legacy-name"?: string;
|
|
50
|
+
/** Access-key/tooltip message slug, e.g. `minoredit`. */
|
|
51
|
+
tooltip?: string;
|
|
52
|
+
/** PHP class of the OOUI widget; set for the `wpWatchlistExpiry` dropdown. */
|
|
53
|
+
class?: string;
|
|
54
|
+
/** Dropdown options as label/value pairs (`wpWatchlistExpiry` only). */
|
|
55
|
+
options?: {
|
|
56
|
+
data?: string;
|
|
57
|
+
label?: string;
|
|
58
|
+
}[];
|
|
59
|
+
/** Widget config option carrying the current value (`wpWatchlistExpiry` only). */
|
|
60
|
+
"value-attr"?: string;
|
|
61
|
+
/** Label rendered invisibly (`wpWatchlistExpiry` only). */
|
|
62
|
+
invisibleLabel?: true;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the box starts checked — or the preselected expiry string for the
|
|
65
|
+
* `wpWatchlistExpiry` dropdown. A real `boolean` under fv2 for checkboxes.
|
|
66
|
+
*/
|
|
67
|
+
default?: boolean | string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* `lastModified` display parts of the edited page, as emitted by
|
|
71
|
+
* `action=visualeditor`/`visualeditoredit` and by DiscussionTools'
|
|
72
|
+
* `discussiontoolsedit` (both render the same last-modified widget data).
|
|
73
|
+
*/
|
|
74
|
+
export interface ApiLastModified {
|
|
75
|
+
/** Localized date, e.g. `15 January 2024`. */
|
|
76
|
+
date?: string;
|
|
77
|
+
/** Localized time, e.g. `18:34`. */
|
|
78
|
+
time?: string;
|
|
79
|
+
/** Full sentence combining both. */
|
|
80
|
+
message?: string;
|
|
81
|
+
}
|
|
82
|
+
/** The page frame both `visualeditor` and `visualeditoredit` return. */
|
|
83
|
+
export interface ApiVisualEditorPageFrame {
|
|
84
|
+
/** Outcome of the request; `error` on the save-failure branch. */
|
|
85
|
+
result?: "success" | "error" | (string & {});
|
|
86
|
+
/** Rendered page body (HTML for `parse`, wikitext for `wikitext`). */
|
|
87
|
+
content?: string;
|
|
88
|
+
/** Whether {@link content} came from a preload rather than the page. */
|
|
89
|
+
preloaded?: boolean;
|
|
90
|
+
/** Page subtitle ("Revision as of …") HTML. */
|
|
91
|
+
contentSub?: string;
|
|
92
|
+
/** Display title HTML. */
|
|
93
|
+
displayTitleHtml?: string;
|
|
94
|
+
/** Category bar HTML. */
|
|
95
|
+
categorieshtml?: string;
|
|
96
|
+
/** Section index of the edited/loaded page. */
|
|
97
|
+
sections?: unknown[];
|
|
98
|
+
/** ResourceLoader modules the response needs. */
|
|
99
|
+
modules?: string[];
|
|
100
|
+
/** ResourceLoader config variables (e.g. `wgEchoSeenTime`). */
|
|
101
|
+
jsconfigvars?: Record<string, unknown>;
|
|
102
|
+
/**
|
|
103
|
+
* Empty string for a normal page — this is the legacy empty-string flag
|
|
104
|
+
* pattern rather than a boolean.
|
|
105
|
+
*/
|
|
106
|
+
isRedirect?: string;
|
|
107
|
+
/** When the page last changed, in display parts. */
|
|
108
|
+
lastModified?: ApiLastModified;
|
|
109
|
+
/** New revision id, from `visualeditoredit` `paction=save`. */
|
|
110
|
+
newrevid?: number;
|
|
111
|
+
/** Whether the editor watches the page now. */
|
|
112
|
+
watched?: boolean;
|
|
113
|
+
/** When that watch expires; `null` when permanent. */
|
|
114
|
+
watchlistexpiry?: Timestamp | null;
|
|
115
|
+
/** HTML diff, from `visualeditoredit` `paction=diff`. */
|
|
116
|
+
diff?: string;
|
|
117
|
+
/** Key into the serialisation cache, from `visualeditoredit` `paction=serializeforcache`. */
|
|
118
|
+
cachekey?: string;
|
|
119
|
+
/** `true` when the save asked to skip the re-render (`nocontent` parameter), so no `content` follows. */
|
|
120
|
+
nocontent?: Flag;
|
|
121
|
+
/** The underlying `action=edit` result, on the save failure branch (`result: "error"`). */
|
|
122
|
+
edit?: ApiEditResult;
|
|
123
|
+
/** `true` when a temporary account was created by this edit. */
|
|
124
|
+
tempusercreated?: Flag;
|
|
125
|
+
/** Redirect URL for a just-created temporary account, when one applies. */
|
|
126
|
+
tempusercreatedredirect?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Response of `action=visualeditor` for `paction=parse`, `wikitext` and
|
|
130
|
+
* `metadata`, which share one payload. The other `paction` values return
|
|
131
|
+
* different shapes — see {@link ApiVisualEditorTemplatesUsedResponse} and
|
|
132
|
+
* {@link ApiVisualEditorParseFragmentResponse}.
|
|
133
|
+
*/
|
|
134
|
+
export interface ApiVisualEditorResponse extends ApiEnvelope {
|
|
135
|
+
visualeditor: ApiVisualEditorPageFrame & {
|
|
136
|
+
/**
|
|
137
|
+
* Notices the editor should show above the form, keyed by message name
|
|
138
|
+
* (e.g. `newarticletext` for a page that does not exist yet). An empty PHP
|
|
139
|
+
* map, so `[]` when there is nothing to show.
|
|
140
|
+
*/
|
|
141
|
+
notices: Record<string, string> | unknown[];
|
|
142
|
+
/** Copyright warning HTML; `""` when none applies. */
|
|
143
|
+
copyrightWarning: string;
|
|
144
|
+
/** Definitions of the save-form fields, keyed by element id. */
|
|
145
|
+
checkboxesDef: Record<string, ApiVisualEditorCheckboxDef>;
|
|
146
|
+
/** Plain text of the messages referenced by `checkboxesDef`. */
|
|
147
|
+
checkboxesMessages: Record<string, string>;
|
|
148
|
+
/** CSS classes for protection state, joined into one string (`""` when none). */
|
|
149
|
+
protectedClasses: string;
|
|
150
|
+
/** Base timestamp for edit-conflict detection. */
|
|
151
|
+
basetimestamp: Timestamp;
|
|
152
|
+
/** Server timestamp when the request started. */
|
|
153
|
+
starttimestamp: Timestamp;
|
|
154
|
+
/** Revision id the content was taken from. */
|
|
155
|
+
oldid: number;
|
|
156
|
+
/** Block state of the requesting user; `null` when not blocked. */
|
|
157
|
+
blockinfo: Record<string, unknown> | null;
|
|
158
|
+
/**
|
|
159
|
+
* Whether an auto-created temporary account would be used for the edit.
|
|
160
|
+
*
|
|
161
|
+
* @since MediaWiki 1.41
|
|
162
|
+
*/
|
|
163
|
+
wouldautocreate?: boolean;
|
|
164
|
+
/** Whether the user may edit this page at all. */
|
|
165
|
+
canEdit: boolean;
|
|
166
|
+
/** Restbase/Parsoid ETag for conditional requests. */
|
|
167
|
+
etag?: string;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Response of `action=visualeditor` with `paction=templatesused`, where the
|
|
172
|
+
* module writes an HTML string instead of the usual object.
|
|
173
|
+
*/
|
|
174
|
+
export interface ApiVisualEditorTemplatesUsedResponse extends ApiEnvelope {
|
|
175
|
+
visualeditor: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Response of `action=visualeditor` with `paction=parsefragment`: just the
|
|
179
|
+
* transformed fragment and the outcome flag.
|
|
180
|
+
*/
|
|
181
|
+
export interface ApiVisualEditorParseFragmentResponse extends ApiEnvelope {
|
|
182
|
+
visualeditor: {
|
|
183
|
+
/** Outcome of the transform. */
|
|
184
|
+
result: "success" | (string & {});
|
|
185
|
+
/** Transformed wikitext fragment. */
|
|
186
|
+
content: string;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Response of `action=visualeditoredit`.
|
|
191
|
+
*/
|
|
192
|
+
export interface ApiVisualEditorEditResponse extends ApiEnvelope {
|
|
193
|
+
visualeditoredit: ApiVisualEditorPageFrame;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Response of `action=editcheckreferenceurl`: the verdict for the checked URL —
|
|
197
|
+
* `"allowed"` or `"blocked"`. Always exactly one entry, keyed by the requested
|
|
198
|
+
* URL.
|
|
199
|
+
*
|
|
200
|
+
* @since MediaWiki 1.42
|
|
201
|
+
*/
|
|
202
|
+
export interface ApiEditCheckReferenceUrlResponse extends ApiEnvelope {
|
|
203
|
+
editcheckreferenceurl: Record<string, "allowed" | "blocked" | (string & {})>;
|
|
204
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in extension pack: **Wikibase** (`meta=wikibase`, `prop=pageterms`,
|
|
3
|
+
* `prop=wbentityusage`, `list=wblistentityusage`).
|
|
4
|
+
*
|
|
5
|
+
* Not in the default export: importing anything from this file — even just the
|
|
6
|
+
* field-group type you are about to use — activates the augmentation shipped at
|
|
7
|
+
* the bottom, which merges the field groups into the root package automatically
|
|
8
|
+
* (no manual `declare module`):
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import type {} from 'types-mediawiki-response/ext/wikibase';
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* These are the **client-side** Wikibase modules (a wiki linked to a repo wiki);
|
|
15
|
+
* the entity read/write actions (`wbgetentities`, …) live on the repo
|
|
16
|
+
* and are out of scope. fv2 notes:
|
|
17
|
+
*
|
|
18
|
+
* * `prop=pageterms` (`wbpt`) puts `terms` on each page, keyed by term type and
|
|
19
|
+
* holding a `string[]` (aliases always plural, label/description a one-element
|
|
20
|
+
* list). Only the three known types occur; a page without a linked entity gets
|
|
21
|
+
* no `terms`.
|
|
22
|
+
* * `prop=wbentityusage` (`wbeu`) and the per-row `wblistentityusage` both return
|
|
23
|
+
* a **map keyed by entity id** (`{ "Q84": { … } }`), not an array. An `aspects`
|
|
24
|
+
* entry is an opaque code, often compound — `"CQR"`, `"D.en"`, `"S"`, `"T"`,
|
|
25
|
+
* `"O"` — so it is modeled as an open `string[]`, not the `S|L|D|T|C|X|O` the
|
|
26
|
+
* `wbleuaspect`/`wbeuaspect` *filter* accepts. `url` appears only with `…prop=url`.
|
|
27
|
+
* * `list=wblistentityusage` (`wbleu`) lands under **`query.entityusage`** (not a
|
|
28
|
+
* `wblistentityusage` key); each row is a page carrying the usage map under the
|
|
29
|
+
* `wblistentityusage` key. Continuation uses `wbleucontinue` (covered by the
|
|
30
|
+
* core continuation index signature).
|
|
31
|
+
*
|
|
32
|
+
* @see https://www.mediawiki.org/wiki/Wikibase/API
|
|
33
|
+
*/
|
|
34
|
+
import type { NamespaceIndex } from "../common";
|
|
35
|
+
/** A single entity's usage record: which aspects were used, and an optional repo link. */
|
|
36
|
+
export interface ApiEntityUsage {
|
|
37
|
+
/**
|
|
38
|
+
* Usage aspects, as opaque codes — often compound (`"CQR"` = statements +
|
|
39
|
+
* qualifiers + references, `"D.en"` = English description). Open string list.
|
|
40
|
+
*/
|
|
41
|
+
aspects?: string[];
|
|
42
|
+
/** Link to the entity page on the repo. Only with `wbeuprop=url` / `wbleuprop=url`. */
|
|
43
|
+
url?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Entity id → usage. Each row always carries at least one entity; an empty map does not occur. */
|
|
46
|
+
export type ApiEntityUsageMap = Record<string, ApiEntityUsage>;
|
|
47
|
+
/** Terms of the entity linked to a page (`prop=pageterms`). */
|
|
48
|
+
export interface ApiPageTerms {
|
|
49
|
+
/** Label(s) in the requested language. */
|
|
50
|
+
label?: string[];
|
|
51
|
+
/** Description(s) in the requested language. */
|
|
52
|
+
description?: string[];
|
|
53
|
+
/** Alias(es) in the requested language. */
|
|
54
|
+
alias?: string[];
|
|
55
|
+
}
|
|
56
|
+
/** Repo location info (`meta=wikibase`, `wbprop=url`). */
|
|
57
|
+
export interface ApiWikibaseRepoUrl {
|
|
58
|
+
/** Repo base URL. */
|
|
59
|
+
base?: string;
|
|
60
|
+
/** Repo script path, e.g. `/w`. */
|
|
61
|
+
scriptpath?: string;
|
|
62
|
+
/** Repo article path with the `$1` placeholder. */
|
|
63
|
+
articlepath?: string;
|
|
64
|
+
}
|
|
65
|
+
/** The `repo` object of `meta=wikibase`. */
|
|
66
|
+
export interface ApiWikibaseRepo {
|
|
67
|
+
url?: ApiWikibaseRepoUrl;
|
|
68
|
+
}
|
|
69
|
+
/** The `wikibase` object of a `meta=wikibase` response. */
|
|
70
|
+
export interface ApiWikibaseInfo {
|
|
71
|
+
/** Repo URL info. `wbprop=url`. */
|
|
72
|
+
repo?: ApiWikibaseRepo;
|
|
73
|
+
/** This wiki's global site id, e.g. `mediawikiwiki`. `wbprop=siteid`. */
|
|
74
|
+
siteid?: string;
|
|
75
|
+
}
|
|
76
|
+
/** One row of `list=wblistentityusage` (a local page using the queried entity). */
|
|
77
|
+
export interface ApiEntityUsageRow {
|
|
78
|
+
/** Namespace index. */
|
|
79
|
+
ns?: NamespaceIndex;
|
|
80
|
+
/** Page title, prefixed for non-main namespaces. */
|
|
81
|
+
title?: string;
|
|
82
|
+
/** Local page id. */
|
|
83
|
+
pageid?: number;
|
|
84
|
+
/** Entities used by this page and their usage (the queried entities). */
|
|
85
|
+
wblistentityusage?: ApiEntityUsageMap;
|
|
86
|
+
}
|
|
87
|
+
declare module "types-mediawiki-response" {
|
|
88
|
+
interface ApiPage {
|
|
89
|
+
/** `prop=pageterms`: terms of the entity linked to this page. */
|
|
90
|
+
terms?: ApiPageTerms;
|
|
91
|
+
/** `prop=wbentityusage`: entities used by this page, keyed by entity id. */
|
|
92
|
+
wbentityusage?: ApiEntityUsageMap;
|
|
93
|
+
}
|
|
94
|
+
interface ApiQueryResult {
|
|
95
|
+
/** `meta=wikibase`: info about the associated repo. */
|
|
96
|
+
wikibase?: ApiWikibaseInfo;
|
|
97
|
+
/** `list=wblistentityusage`: pages using the requested entities. */
|
|
98
|
+
entityusage?: ApiEntityUsageRow[];
|
|
99
|
+
}
|
|
100
|
+
}
|