From 71917e72694fc84c113f18c32afc86e39912dc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20LES=C3=89N=C3=89CHAL?= Date: Wed, 23 Oct 2024 12:00:06 +0200 Subject: [PATCH] jquery.client: Fix Profile not allowing unknown values If the platform, name, layout, or version is unknown, then it is set to the string `"unknown"`. --- jquery/client.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery/client.d.ts b/jquery/client.d.ts index 3456d68..4fc12b4 100644 --- a/jquery/client.d.ts +++ b/jquery/client.d.ts @@ -96,6 +96,7 @@ export interface ClientNavigator { userAgent: string; } +type ClientProfileLayout = "edge" | "gecko" | "khtml" | "presto" | "trident" | "webkit"; type ClientProfileName = | "android" | "chrome" @@ -109,6 +110,7 @@ type ClientProfileName = | "rekong" | "safari" | "silk"; +type ClientProfilePlatform = "ipad" | "iphone" | "linux" | "mac" | "solaris" | "win"; type ComparisonOperator = "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">="; type ClientSupportCondition = [ComparisonOperator, string | number]; @@ -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: * @@ -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: @@ -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;