Skip to content

Commit

Permalink
jquery.client: Update JSdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien LESÉNÉCHAL committed Oct 23, 2024
1 parent 1d1f251 commit 01e10f9
Showing 1 changed file with 61 additions and 36 deletions.
97 changes: 61 additions & 36 deletions jquery/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,6 @@ interface Client {
* }
* ```
*
* Recognised browser names:
*
* - `android` (legacy Android browser, prior to Chrome Mobile)
* - `chrome` (includes Chrome Mobile, Microsoft Edge, Opera, and others)
* - `crios` (Chrome on iOS, which uses Mobile Safari)
* - `edge` (legacy Microsoft Edge, which uses EdgeHTML)
* - `firefox` (includes Firefox Mobile, Iceweasel, and others)
* - `fxios` (Firefox on iOS, which uses Mobile Safari)
* - `konqueror`
* - `msie`
* - `opera` (legacy Opera, which uses Presto)
* - `rekonq`
* - `safari` (including Mobile Safari)
* - `silk`
*
* Recognised layout engines:
*
* - `edge` (EdgeHTML 12-18, as used by legacy Microsoft Edge)
* - `gecko`
* - `khtml`
* - `presto`
* - `trident`
* - `webkit`
*
* Note that Chrome and Chromium-based browsers like Opera have their layout
* engine identified as `webkit`.
*
* Recognised platforms:
*
* - `ipad`
* - `iphone`
* - `linux`
* - `mac`
* - `solaris` (untested)
* - `win`
*
* @example
* ```js
* if ( $.client.profile().layout == 'gecko' ) {
Expand Down Expand Up @@ -156,10 +120,71 @@ type ClientSupportMap =
| UndirectedClientSupportMap
| Record<"ltr" | "rtl", UndirectedClientSupportMap>;

/**
* An object containing information about the client.
*
* @example
* ```js
* {
* 'name': 'firefox',
* 'layout': 'gecko',
* 'layoutVersion': 20101026,
* 'platform': 'linux'
* 'version': '3.5.1',
* 'versionBase': '3',
* 'versionNumber': 3.5,
* }
* ```
* @see https://doc.wikimedia.org/jquery-client/master/jQuery.client.html#.Profile
*/
interface ClientProfile {
/**
* Name of the layout engine. Recognised layout engines:
*
* - `edge` (EdgeHTML 12-18, as used by legacy Microsoft Edge)
* - `gecko`
* - `khtml`
* - `presto`
* - `trident`
* - `webkit`
*
* Note that Chrome and Chromium-based browsers like Opera have their layout
* engine identified as `webkit`.
*/
layout: "edge" | "gecko" | "khtml" | "presto" | "trident" | "webkit";
/**
* Version of the layout engine,
* e.g. `6` or `20101026`.
*/
layoutVersion: number;
/**
* Name of the browser. Recognized browser names:
*
* - `android` (legacy Android browser, prior to Chrome Mobile)
* - `chrome` (includes Chrome Mobile, Microsoft Edge, Opera, and others)
* - `crios` (Chrome on iOS, which uses Mobile Safari)
* - `edge` (legacy Microsoft Edge, which uses EdgeHTML)
* - `firefox` (includes Firefox Mobile, Iceweasel, and others)
* - `fxios` (Firefox on iOS, which uses Mobile Safari)
* - `konqueror`
* - `msie`
* - `opera` (legacy Opera, which uses Presto)
* - `rekonq`
* - `safari` (including Mobile Safari)
* - `silk`
*/
name: ClientProfileName;
/**
* Operating system the browser is running on.
* Recognised platforms:
*
* - `ipad`
* - `iphone`
* - `linux`
* - `mac`
* - `solaris` (untested)
* - `win`
*/
platform: "ipad" | "iphone" | "linux" | "mac" | "solaris" | "win";
version: string;
versionBase: string;
Expand Down

0 comments on commit 01e10f9

Please sign in to comment.