From c7ab3ca2da52904bcaa4b14b45ef473d1b46e3ef Mon Sep 17 00:00:00 2001 From: TobyG74 Date: Wed, 28 Feb 2024 12:16:23 +0700 Subject: [PATCH] fix: change the interface to type --- src/types/musicaldown.ts | 6 +++--- src/types/ssstik.ts | 8 ++++---- src/types/stalker.ts | 25 ++++++------------------- src/types/tiktokApi.ts | 8 ++++---- 4 files changed, 17 insertions(+), 30 deletions(-) diff --git a/src/types/musicaldown.ts b/src/types/musicaldown.ts index 6cd972e..7e6109c 100644 --- a/src/types/musicaldown.ts +++ b/src/types/musicaldown.ts @@ -1,4 +1,4 @@ -export interface getRequest { +export type getRequest = { status: "success" | "error" request?: { [key: string]: string @@ -7,7 +7,7 @@ export interface getRequest { cookie?: string } -export interface MusicalDownResponse { +export type MusicalDownResponse = { status: "success" | "error" message?: string result?: { @@ -26,7 +26,7 @@ export interface MusicalDownResponse { } } -export interface getMusic { +export type getMusic = { status: "success" | "error" result?: string } diff --git a/src/types/ssstik.ts b/src/types/ssstik.ts index b3bc25d..b2689f6 100644 --- a/src/types/ssstik.ts +++ b/src/types/ssstik.ts @@ -1,10 +1,10 @@ -export interface SSSTikFetchTT { +export type SSSTikFetchTT = { status: "success" | "error" message?: string result?: string } -export interface SSSTikResponse { +export type SSSTikResponse = { status: "success" | "error" message?: string result?: { @@ -18,12 +18,12 @@ export interface SSSTikResponse { } } -export interface Author { +export type Author = { avatar: string nickname: string } -export interface Statistics { +export type Statistics = { likeCount: string commentCount: string shareCount: string diff --git a/src/types/stalker.ts b/src/types/stalker.ts index 778b846..ef15eea 100644 --- a/src/types/stalker.ts +++ b/src/types/stalker.ts @@ -1,4 +1,4 @@ -export interface StalkResult { +export type StalkResult = { status: "success" | "error" message?: string result?: { @@ -8,7 +8,7 @@ export interface StalkResult { } } -export interface Users { +export type Users = { username: string nickname: string avatarLarger: string @@ -23,29 +23,16 @@ export interface Users { nicknameModifyTime: number } -export interface Stats { +export type Stats = { followerCount: number followingCount: number heartCount: number videoCount: number likeCount: number friendCount: number - // postCount: number } -// export interface Posts { -// id: string -// desc: string -// createTime: number -// author: string -// locationCreated: string -// hashtags: string[] -// statistics: Statistics -// video: Video -// music: Music -// } - -export interface Statistics { +export type Statistics = { likeCount: number shareCount: number commentCount: number @@ -53,7 +40,7 @@ export interface Statistics { favoriteCount: number } -export interface Video { +export type Video = { id: string duration: string ratio: string @@ -66,7 +53,7 @@ export interface Video { bitrate: number } -export interface Music { +export type Music = { id: string title: string album: string diff --git a/src/types/tiktokApi.ts b/src/types/tiktokApi.ts index 58c8420..859eba0 100644 --- a/src/types/tiktokApi.ts +++ b/src/types/tiktokApi.ts @@ -1,4 +1,4 @@ -export interface TiktokAPIResponse { +export type TiktokAPIResponse = { status: "success" | "error" message?: string result?: { @@ -19,7 +19,7 @@ export interface TiktokAPIResponse { } } -export interface Author { +export type Author = { uid: number username: string nickname: string @@ -30,7 +30,7 @@ export interface Author { url: string } -export interface Statistics { +export type Statistics = { playCount: number downloadCount: number shareCount: number @@ -43,7 +43,7 @@ export interface Statistics { loseCommentCount: number } -export interface Music { +export type Music = { id: number title: string author: string