mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-05 00:18:54 +08:00
feat: ts support, album part
This commit is contained in:
parent
0dacfa0a50
commit
f89bd19899
5
main.d.ts
vendored
Normal file
5
main.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export interface Response<T> {
|
||||
status: number // The Http Response Code
|
||||
body: T // API Response body
|
||||
cookie: string[]
|
||||
}
|
@ -14,6 +14,6 @@ module.exports = (query, request) => {
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
url: '/api/activate/initProfile',
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
5
module_types/activate_init_profile.d.ts
vendored
Normal file
5
module_types/activate_init_profile.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface ActivateInitProfileRequestConfig extends RequestBaseConfig {
|
||||
nickname: string
|
||||
}
|
5
module_types/album.d.ts
vendored
Normal file
5
module_types/album.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumRequestConfig extends RequestBaseConfig {
|
||||
id: string
|
||||
}
|
5
module_types/album_detail.d.ts
vendored
Normal file
5
module_types/album_detail.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumDetailRequestConfig extends RequestBaseConfig {
|
||||
id: string
|
||||
}
|
5
module_types/album_detail_dynamic.d.ts
vendored
Normal file
5
module_types/album_detail_dynamic.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumDetailDynamicRequestConfig extends RequestBaseConfig {
|
||||
id: string
|
||||
}
|
8
module_types/album_list.d.ts
vendored
Normal file
8
module_types/album_list.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumListRequestConfig extends RequestBaseConfig {
|
||||
limit?: number // 默认 30
|
||||
offset?: number // 默认 0
|
||||
area?: 'ALL' | 'ZH' | 'EA' | 'KR' | 'JP' // 默认 ALL
|
||||
type: string
|
||||
}
|
7
module_types/album_list_style.d.ts
vendored
Normal file
7
module_types/album_list_style.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumListStyleRequestConfig extends RequestBaseConfig {
|
||||
limit?: number // 默认 10
|
||||
offset?: number // 默认 0
|
||||
area?: 'Z_H' | 'E_A' | 'KR' | 'JP' // 默认 ALL
|
||||
}
|
7
module_types/album_new.d.ts
vendored
Normal file
7
module_types/album_new.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumNewRequestConfig extends RequestBaseConfig {
|
||||
limit?: number // 默认 30
|
||||
offset?: number // 默认 0
|
||||
area?: 'ALL' | 'ZH' | 'EA' | 'KR' | 'JP' // 默认 ALL
|
||||
}
|
3
module_types/album_newest.d.ts
vendored
Normal file
3
module_types/album_newest.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export type AlbumNewestRequestConfig = RequestBaseConfig
|
7
module_types/album_songsaleboard.d.ts
vendored
Normal file
7
module_types/album_songsaleboard.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumSongSaleBoardRequestConfig extends RequestBaseConfig {
|
||||
albumType: 0 | 1 // 0 为数字专辑,1 为数字单曲
|
||||
type: 'daily' | 'week' | 'year' | 'total'
|
||||
year?: string // 年份,默认本年。 type 为 year 时有效
|
||||
}
|
6
module_types/album_sub.d.ts
vendored
Normal file
6
module_types/album_sub.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumSubRequestConfig extends RequestBaseConfig {
|
||||
id: string
|
||||
t: 'sub' | 'unsub'
|
||||
}
|
6
module_types/album_sublist.d.ts
vendored
Normal file
6
module_types/album_sublist.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface AlbumSubListRequestConfig extends RequestBaseConfig {
|
||||
limit: number // 默认: 25
|
||||
offset: number // 默认: 0
|
||||
}
|
7
module_types/artist_album.d.ts
vendored
Normal file
7
module_types/artist_album.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { RequestBaseConfig } from './base'
|
||||
|
||||
export interface ArtistAlbumRequestConfig extends RequestBaseConfig {
|
||||
id: string
|
||||
limit?: number // 默认 30
|
||||
offset?: number // 默认 0
|
||||
}
|
10
module_types/base.d.ts
vendored
Normal file
10
module_types/base.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
export interface APIBaseResponse {
|
||||
code: number
|
||||
cookie: string
|
||||
}
|
||||
|
||||
export interface RequestBaseConfig {
|
||||
cookie?: string
|
||||
realIP?: string // IPv4/IPv6 filled in X-Real-IP
|
||||
proxy?: string // HTTP proxy
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user