Skip to content

Commit

Permalink
jquery.client: Fix Profile not allowing unknown values
Browse files Browse the repository at this point in the history
If the platform, name, layout, or version is unknown, then it is set to the string `"unknown"`.
  • Loading branch information
Adrien LESÉNÉCHAL committed Oct 23, 2024
1 parent 01e10f9 commit 71917e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions jquery/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export interface ClientNavigator {
userAgent: string;
}

type ClientProfileLayout = "edge" | "gecko" | "khtml" | "presto" | "trident" | "webkit";
type ClientProfileName =
| "android"
| "chrome"
Expand All @@ -109,6 +110,7 @@ type ClientProfileName =
| "rekong"
| "safari"
| "silk";
type ClientProfilePlatform = "ipad" | "iphone" | "linux" | "mac" | "solaris" | "win";

type ComparisonOperator = "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">=";
type ClientSupportCondition = [ComparisonOperator, string | number];
Expand Down Expand Up @@ -151,12 +153,12 @@ interface ClientProfile {
* Note that Chrome and Chromium-based browsers like Opera have their layout
* engine identified as `webkit`.
*/
layout: "edge" | "gecko" | "khtml" | "presto" | "trident" | "webkit";
layout: ClientProfileLayout | "unknown";
/**
* Version of the layout engine,
* e.g. `6` or `20101026`.
*/
layoutVersion: number;
layoutVersion: number | "unknown";
/**
* Name of the browser. Recognized browser names:
*
Expand All @@ -173,7 +175,7 @@ interface ClientProfile {
* - `safari` (including Mobile Safari)
* - `silk`
*/
name: ClientProfileName;
name: ClientProfileName | "unknown";
/**
* Operating system the browser is running on.
* Recognised platforms:
Expand All @@ -185,7 +187,7 @@ interface ClientProfile {
* - `solaris` (untested)
* - `win`
*/
platform: "ipad" | "iphone" | "linux" | "mac" | "solaris" | "win";
platform: ClientProfilePlatform | "unknown";
version: string;
versionBase: string;
versionNumber: number;
Expand Down

0 comments on commit 71917e7

Please sign in to comment.