mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🏷️ 根据 JSON 增改类型
This commit is contained in:
89
src/types/Calendar.d.ts
vendored
89
src/types/Calendar.d.ts
vendored
@@ -2,68 +2,55 @@
|
||||
* @file core types TGCalendar.d.ts
|
||||
* @description 本应用的素材日历类型定义
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.3
|
||||
* @since Alpha v0.1.5
|
||||
*/
|
||||
|
||||
declare namespace BTMuli.Genshin.Calendar {
|
||||
/**
|
||||
* @description 素材日历接口
|
||||
* @interface Data
|
||||
* @since Alpha v0.1.3
|
||||
* @property {Record<number, CharaacterItem>} characters - 该天的角色相关数据
|
||||
* @property {Record<number, WeaponItem>} weapons - 该天的武器相关数据
|
||||
* @since Alpha v0.1.5
|
||||
* @property {number} id - 日历项 id
|
||||
* @property {number} content_id - 观测枢的 content_id
|
||||
* @property {Array<number>} drop_day - 掉落日
|
||||
* @property {string} name - 日历项名称
|
||||
* @property {string} item_type - 日历项类型
|
||||
* @property {number} star - 日历项星级
|
||||
* @property {string} bg - 日历项背景
|
||||
* @property {string} icon - 日历项图标
|
||||
* @property {string} weapon_type - 武器类型
|
||||
* @property {string} element - 角色元素
|
||||
* @property {BTMuli.Genshin.Material.BriefInfo[]} materials - 素材简要信息
|
||||
* @property {CalendarSource} source - 日历项来源
|
||||
* @returns {Data}
|
||||
*/
|
||||
export interface Data {
|
||||
characters: Record<number, CharaacterItem>
|
||||
weapons: Record<number, WeaponItem>
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 单日单秘境的素材日历接口
|
||||
* @interface CharaacterItem
|
||||
* @since Alpha v0.1.3
|
||||
* @property {string} title - 地区 秘境名称
|
||||
* @property {Material[]} materials - 素材 url
|
||||
* @property {BTMuli.Genshin.Wiki.Character.BriefInfo[]} contents - 角色/武器的简要信息
|
||||
* @returns {CharaacterItem}
|
||||
*/
|
||||
export interface CharaacterItem {
|
||||
title: string
|
||||
materials: Material[]
|
||||
contents: BTMuli.Genshin.Wiki.Character.BriefInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 单日单秘境的素材日历接口
|
||||
* @interface WeaponItem
|
||||
* @since Alpha v0.1.3
|
||||
* @property {string} title - 地区 秘境名称
|
||||
* @property {Material[]} materials - 素材 url
|
||||
* @property {BTMuli.Genshin.Wiki.Weapon.BriefInfo[]} contents - 角色/武器的简要信息
|
||||
* @returns {WeaponItem}
|
||||
*/
|
||||
export interface WeaponItem {
|
||||
title: string
|
||||
materials: Material[]
|
||||
contents: BTMuli.Genshin.Wiki.Weapon.BriefInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 材料类型
|
||||
* @interface Material
|
||||
* @since Alpha v0.1.3
|
||||
* @property {number} id - 角色/武器的 id
|
||||
* @property {number} star - 角色/武器的星级
|
||||
* @property {number} content_id - 观测枢的 content_id
|
||||
* @property {string} name - 名称
|
||||
* @property {string} icon - 图标 url
|
||||
*/
|
||||
export interface Material {
|
||||
id?: number
|
||||
star: number
|
||||
id: number
|
||||
content_id: number
|
||||
drop_day: number[]
|
||||
name: string
|
||||
item_type: string
|
||||
star: number
|
||||
bg: string
|
||||
icon: string
|
||||
weapon_type: string
|
||||
element?: string
|
||||
materials: BTMuli.Genshin.Material.BriefInfo[]
|
||||
source: CalendarSource
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 素材日历来源
|
||||
* @interface CalendarSource
|
||||
* @since Alpha v0.1.5
|
||||
* @property {string} type - 来源类型
|
||||
* @property {string} area - 来源区域
|
||||
* @property {string} name - 来源名称
|
||||
* @return {CalendarSource}
|
||||
*/
|
||||
export interface CalendarSource {
|
||||
type: string
|
||||
area: string
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
31
src/types/Material.d.ts
vendored
Normal file
31
src/types/Material.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @file types Material.d.ts
|
||||
* @description 素材相关类型定义
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1。5
|
||||
*/
|
||||
|
||||
declare namespace BTMuli.Genshin.Material {
|
||||
/**
|
||||
* @description 简要信息
|
||||
* @interface BriefInfo
|
||||
* @since Alpha v0.1.5
|
||||
* @property {number} id - 素材 id
|
||||
* @property {number} content_id - 观测枢的 content_id
|
||||
* @property {string} name - 素材名称
|
||||
* @property {string} type - 素材类型
|
||||
* @property {number} star - 素材星级
|
||||
* @property {string} bg - 素材背景
|
||||
* @property {string} icon - 素材图标
|
||||
* @returns {BriefInfo}
|
||||
*/
|
||||
export interface BriefInfo {
|
||||
id: number
|
||||
content_id?: number
|
||||
name: string
|
||||
type: string
|
||||
star: number
|
||||
bg: string
|
||||
icon: string
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user