👽️ 完善类型,改用常量枚举,适配typescript 6

This commit is contained in:
BTMuli
2026-03-25 17:43:20 +08:00
parent 31f13caa1e
commit fe6d0b423d
12 changed files with 292 additions and 169 deletions

View File

@@ -1,6 +1,6 @@
/**
* 帖子类型定义文件
* @since Beta v0.9.8
* @since Beta v0.9.9
*/
declare namespace TGApp.BBS.Post {
@@ -63,6 +63,61 @@ declare namespace TGApp.BBS.Post {
*/
type NewsTypeEnum = (typeof NewsType)[keyof typeof NewsType];
/**
* 话题排序类型
* @since Beta v0.9.9
*/
const PostTopicSortType = <const>{
/** 最新 */
LATEST: 0,
/** 精选 */
FEATURED: 1,
/** 热门 */
HOT: 2,
};
/**
* 话题排序类型枚举
* @since Beta v0.9.9
*/
type PostTopicSortTypeEnum = (typeof PostTopicSortType)[keyof typeof PostTopicSortType];
/**
* 论坛排序类型
* @since Beta v0.9.9
*/
const ForumSortType = <const>{
/** 最新回复 */
LATEST_REPLY: 1,
/** 最新发布 */
LATEST_POST: 2,
/** 热门 */
HOT: 3,
};
/**
* 论坛排序类型枚举
* @since Beta v0.9.9
*/
type ForumSortTypeEnum = (typeof ForumSortType)[keyof typeof ForumSortType];
/**
* 搜索排序类型
* @since Beta v0.9.9
*/
const SearchSortType = <const>{
/** 最热 */
HOT: 1,
/** 最新 */
LATEST: 2,
};
/**
* 搜索排序类型枚举
* @since Beta v0.9.9
*/
type SearchSortTypeEnum = (typeof SearchSortType)[keyof typeof SearchSortType];
/**
* 资讯返回响应
* @since Beta v0.7.2

View File

@@ -1,8 +1,28 @@
/**
* 回复数据类型定义文件
* @since Beta v0.7.2
* @since Beta v0.9.9
*/
declare namespace TGApp.BBS.Reply {
/**
* 回复排序类型
* @since Beta v0.9.9
*/
const ReplyOrderType = <const>{
/* 热门 */
HOT: 0,
/* 最早 */
OLDEST: 1,
/* 最新 */
LATEST: 2,
};
/**
* 回复排序类型枚举
* @since Beta v0.9.9
*/
type ReplyOrderTypeEnum = (typeof ReplyOrderType)[keyof typeof ReplyOrderType];
/**
* 帖子回复数据类型
* @since Beta v0.7.1