Skip to content

Commit

Permalink
mw.language: remove inaccessible functions
Browse files Browse the repository at this point in the history
These function are included in the JSdoc and marked as `@private`, but actually they are just in the scope of the module and not even properties of the `mw.language` object.
  • Loading branch information
Adrien LESÉNÉCHAL committed Feb 1, 2024
1 parent 28c812f commit 4554a3c
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions mw/language.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ declare global {
explicitPluralForms?: Record<number, string>
): string;

/**
* Helper function to flip transformation tables.
*
* @param {...Object.<number|string, string>} tables Transformation tables
* @returns {Object.<string, number|string>}
* @see https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.language-method-flipTransform
*/
function flipTransform<T extends Record<PropertyKey, PropertyKey>>(
...tables: T[]
): FlipObject<T>;

/**
* Provides an alternative text depending on specified gender.
*
Expand Down Expand Up @@ -225,48 +214,6 @@ declare global {
function setData(langCode: string, dataKey: string, value: any): void;
function setData(langCode: string, dataKey: Record<string, any>): void;

/**
* Apply numeric pattern to absolute value using options. Gives no
* consideration to local customs.
*
* Adapted from dojo/number library with thanks
* <http://dojotoolkit.org/reference-guide/1.8/dojo/number.html>
*
* @private
* @param {number} value the number to be formatted, ignores sign
* @param {string} pattern the number portion of a pattern (e.g. `#,##0.00`)
* @param {Object} [options] If provided, all option keys must be present:
* @param {string} options.decimal The decimal separator. Defaults to: `'.'`.
* @param {string} options.group The group separator. Defaults to: `','`.
* @param {number|null} options.minimumGroupingDigits
* @returns {string}
*/
function commafyNumber(
value: number,
pattern: string,
options?: { decimal: string; group: string; minimumGroupingDigits: number | null }
): string;

/**
* Pad a string to guarantee that it is at least `size` length by
* filling with the character `ch` at either the start or end of the
* string. Pads at the start, by default.
*
* Example: Fill the string to length 10 with '+' characters on the right.
*
* ```js
* pad( 'blah', 10, '+', true ); // => 'blah++++++'
* ```
*
* @private
* @param {string} text The string to pad
* @param {number} size The length to pad to
* @param {string} [ch='0'] Character to pad with
* @param {boolean} [end=false] Adds padding at the end if true, otherwise pads at start
* @returns {string}
*/
function pad(text: string, size: number, ch?: string, end?: boolean): string;

/**
* Pads an array to a specific length by copying the last one element.
*
Expand All @@ -277,16 +224,6 @@ declare global {
* @see https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.language-method-preConvertPlural
*/
function preConvertPlural(forms: string[], count: number): string[];

/**
* Replicate a string 'n' times.
*
* @private
* @param {string} str The string to replicate
* @param {number} num Number of times to replicate the string
* @returns {string}
*/
function replicate(str: string, num: number): string;
}
}
}
Expand Down

0 comments on commit 4554a3c

Please sign in to comment.