Define stable and internal APIs

Bug: T348081
Change-Id: I2ca9f27802e5ff1e0738300e2595ea419d49a431
This commit is contained in:
Jon Robson 2023-10-03 17:32:27 -07:00 committed by Jdlrobson
parent 111201d910
commit 922475be6b
3 changed files with 16 additions and 0 deletions

View file

@ -184,6 +184,12 @@ module.exports = function webABTest( props, token, forceInit ) {
// Send data to WikimediaEvents to log A/B test initialization if the subject
// has been sampled into the experiment.
if ( isInSample() ) {
/**
* @event mediawiki.web_AB_test_enrollment
* @internal for use by WikimediaEvents only.
* @property {string} context
* @property {string} action
*/
mw.hook( WEB_AB_TEST_ENROLLMENT_HOOK ).fire( {
group: getBucket(),
experimentName: props.name

View file

@ -10,6 +10,12 @@ const
* @param {string} direction the scroll direction
*/
function firePageTitleScrollHook( direction ) {
/**
* @event vector.page_title_scroll
* @internal for use by WikimediaEvents only.
* @property {string} context
* @property {string} action
*/
if ( direction === 'down' ) {
mw.hook( SCROLL_TITLE_HOOK ).fire( {
context: SCROLL_TITLE_CONTEXT_BELOW

View file

@ -223,6 +223,10 @@ const setupTableOfContents = ( tocElement, bodyContent, initSectionObserverFn )
} );
mw.hook( 'wikipage.tableOfContents' ).add( function ( sections ) {
tableOfContents.reloadTableOfContents( sections ).then( function () {
/**
* @stable for use in gadgets and extensions
* @since 1.40
*/
mw.hook( 'wikipage.tableOfContents.vector' ).fire( sections );
updateElements();
} );