From b5562a0fce81b1239bea11f3eb291fcffd9ff5db Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 7 Feb 2026 19:08:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20=E6=9B=B4=E6=96=B0UIGF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E9=80=82=E9=85=8DUIGF4.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/Plugins/UIGF.d.ts | 56 ++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/src/types/Plugins/UIGF.d.ts b/src/types/Plugins/UIGF.d.ts index ca09a3c7..46fe58e8 100644 --- a/src/types/Plugins/UIGF.d.ts +++ b/src/types/Plugins/UIGF.d.ts @@ -1,7 +1,7 @@ /** * UIGF 标准类型定义文件 - * @since Beta v0.8.4 - * @remarks UIGF v3.0 | UIGF v4.1 + * @since Beta v0.9.5 + * @remarks UIGF v3.0 | UIGF v4.2 */ declare namespace TGApp.Plugins.UIGF { @@ -18,16 +18,34 @@ declare namespace TGApp.Plugins.UIGF { }; /** - * UIGF 数据, v4.0 - * @since Beta v0.8.4 + * Root键 + * @since Beta v0.9.5 + * @remarks hk4e - 祈愿数据 + * @remarks hk4e_ugc - 颂愿数据 */ - type Schema4 = { + type Schema4RootKey = "hk4e" | "hk4e_ugc"; + + /** + * Root键对应类型 + * @since Beta v0.9.5 + */ + type Schema4RootType = T extends "hk4e" + ? Array + : T extends "hk4e_ugc" + ? Array + : never; + + /** + * UIGF 数据, v4.2 + * @since Beta v0.9.5 + */ + type Schema4 = { /** 头部信息 */ info: Info4; - /** 祈愿列表,原神数据 */ - hk4e: Array; - /** 祈愿列表,千星奇域数据 */ - hk4e_ugc?: Array; + } & { + [P in K]: Schema4RootType

; + } & { + [P in Exclude]?: Schema4RootType

; }; /** @@ -83,13 +101,13 @@ declare namespace TGApp.Plugins.UIGF { timezone: number; /** 语言 */ lang?: string; + /** 祈愿数据 */ list: Array; }; /** * UIGF4 祈愿项,千星奇域 - * @since Beta v0.8.4 - * @remarks 该标准尚未最终确定 + * @since Beta v0.9.5 */ type GachaUgc = { /** UID */ @@ -98,9 +116,7 @@ declare namespace TGApp.Plugins.UIGF { timezone: number; /** 语言 */ lang?: string; - /** 服务器区域 */ - region: string; - /** 祈愿列表 */ + /** 颂愿数据 */ list: Array; }; @@ -132,8 +148,7 @@ declare namespace TGApp.Plugins.UIGF { /** * UIGF 祈愿项-千星奇域 - * @since Beta v0.8.4 - * @remarks 该标准尚未最终确定 + * @since Beta v0.9.5 */ type GachaItemB = { /** id */ @@ -148,17 +163,8 @@ declare namespace TGApp.Plugins.UIGF { item_name: string; /** 稀有度 */ rank_type: string; - /** 是否限定 */ - is_up: string; /** 时间 yyyy-MM-dd HH:mm:ss */ time: string; - /** - * 祈愿类型 - * @remarks - * 1000-常驻池 - * 2000-活动池 - */ - gacha_type: string; /** 祈愿类型,用于接口请求 */ op_gacha_type: string; };