types-mediawiki
types-mediawiki copied to clipboard
MediaWiki 1.42, online doc. URLs, and fixes
MediaWiki 1.42 is expected to be released in a few weeks, so this PR contains (supposedly) all type and JSdoc changes related to it. This release also comes with a JS documentation overall, with a lot of small description, type, and url changes, which makes this PR way bigger (and harder to review, I'm sorry, I recommend looking at changes commit by commit) than it should be.
This PR also contains some other changes (unrelated to 1.42), from oversights of previous PRs.
MediaWiki 1.42 update
Added:
-
mw.tempUserCreated
module -
mw.user.getFirstRegistration
-
mw.util.isInfinity
Modified:
-
new mw.Api().loadMessagesIfMissing
now accepts a singlestring
message key as argument -
default
argument ofmw.cookie.get
is now explicitely typed (in JSdoc) withstring|null
, instead ofany
(breaking change) -
mw.loader.impl
/implement
/register
/state
are now annotated private -
mw.Map
is no longer annotated private (and described as internal) -
body
argument ofnew mw.Rest().post
is now optional
Miscellaneous changes
- Add
jquery.cookie
module (which contains$.cookie
,$.removeCookie
)- oversight from #34
- Add missing
mw.loader.addSource
andmw.templates
declarations- oversights from #36
- Make
mw.libs
andmw.widgets
namespaces instead of records (breaking change)- so library and widget types can be specified in this package (or other ones)
- Add
pluralRuleParser
library- related to the modification above
- Add missing JSdoc to
mw.experiments
andmw.Rest.Options.ajax
- oversight from #34
- Move namespace
mw.errorLogger
to its own file- was added in #36 and put with
mw.log
- on top of consistency reasons, these are two distinct set of functions with different purpose
- was added in #36 and put with
- Fix
mw.notify
taking a JS globalNotificationOptions
as argument (not targetting the MediaWiki implementation) (breaking change) - Sort members lexicographically
- where it was not the case, namely in
ColorUtil
/mw.Api
/mw.Rest
interfaces andmw.template
namespace
- where it was not the case, namely in
JSdoc update
- Some
@typedef
have been added to the original JSdoc in 1.42, either as file-local declarations or global declarations in themw
namespace, so update some interfaces to share similar names (and declaration location) with online types.- rename
ApiOptions
/ForeignApiOptions
/ForeignRestOptions
/RestOptions
tomw.Api.Options
/mw.ForeignApi.Options
/mw.ForeignRest.Options
/mw.Rest.Options
and make all properties optional (breaking change)-
ApiOptions
/ForeignApiOptions
/RestOptions
were exported, so to prevent breaking things, exports are just deprecated for now
-
- rename
UserInfo
tomw.Api.UserInfo
(breaking change)- was exported from
user.d.ts
, so to prevent breaking things, the export is just deprecated for now
- was exported from
- rename
WatchStatus
tomw.Api.WatchedPage
- rename
NotificationOptions
tomw.notification.NotificationOptions
- rename
ResultInfo
toResponseMetaData
(insearchSuggest.d.ts
) - rename
CompiledTemplate
/Compiler
toTemplateRenderer
/TemplateCompiler
(intemplate.d.ts
)- also require that any template has a
render
method.
- also require that any template has a
- rename
UriOptions
tomw.Uri.UriOptions
and make all properties optional - rename
ImageUrlData
toResizeableThumbnailUrl
(inutil.d.ts
) - add
mw.Api.EditTransform
- add
mw.cookie.CookieOptions
- add
ResponseFunction
(insearchSuggest.d.ts
) - add
TitleExistenceStore
(inTitle.d.ts
)
- rename
- Fix various small inconsistencies with punctuation, links, indent, and code blocks, either from 1.42 updates to original JSdoc, or oversights from previous PRs.
URLs update
- Update
doc.wikimedia.org
URLs to new format- most of the URLs used in JSdoc are currently broken
- URLs to undocumented (usually private) members are removed, since these did not link to anything
- Add missing
doc.wikimedia.org
URLs- documentation for
mw.hook
events is now generated, so also add URLs to their associated section
- documentation for
- Use
Special:MyLanguage
in URLs of wikis that use subpages for translations- mostly URLs to
www.mediawiki.org
- mostly URLs to
- Use
{@link some-url …}
syntax consistently in JSdoc- replace uses of
[…](some-url)
,<some-url>
, or plainsome-url
- replace uses of