Skip to content

Commit

Permalink
fix(ts): correct declaration upon uploaded img api
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 5, 2020
1 parent c6312ab commit f711b07
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
16 changes: 8 additions & 8 deletions main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
ArtistSubListRequestConfig,
ArtistTopSongRequestConfig,
ArtistsRequestConfig,
// AvatarUploadRequestConfig,
AvatarUploadRequestConfig,
BannerRequestConfig,
BatchRequestConfig,
CaptchaSentRequestConfig,
Expand Down Expand Up @@ -105,7 +105,7 @@ import {
PersonalizedPrivatecontentRequestConfig,
PersonalizedPrivatecontentListRequestConfig,
PlaylistCatlistRequestConfig,
// PlaylistCoverUpdateRequestConfig,
PlaylistCoverUpdateRequestConfig,
PlaylistCreateRequestConfig,
PlaylistDeleteRequestConfig,
PlaylistDescUpdateRequestConfig,
Expand Down Expand Up @@ -245,9 +245,9 @@ interface SDKInstance {
params: ArtistTopSongRequestConfig,
) => Promise<Response<APIBaseResponse>>
artists: (params: ArtistsRequestConfig) => Promise<Response<APIBaseResponse>>
// avatar_upload: (
// params: AvatarUploadRequestConfig,
//) => Promise<Response<APIBaseResponse>>
avatar_upload: (
params: AvatarUploadRequestConfig,
) => Promise<Response<APIBaseResponse>>
banner: (params: BannerRequestConfig) => Promise<Response<APIBaseResponse>>
batch: (params: BatchRequestConfig) => Promise<Response<APIBaseResponse>>
captcha_sent: (
Expand Down Expand Up @@ -468,9 +468,9 @@ interface SDKInstance {
playlist_catlist: (
params: PlaylistCatlistRequestConfig,
) => Promise<Response<APIBaseResponse>>
// playlist_cover_update: (
// params: PlaylistCoverUpdateRequestConfig,
// ) => Promise<Response<APIBaseResponse>>
playlist_cover_update: (
params: PlaylistCoverUpdateRequestConfig,
) => Promise<Response<APIBaseResponse>>
playlist_create: (
params: PlaylistCreateRequestConfig,
) => Promise<Response<APIBaseResponse>>
Expand Down
12 changes: 9 additions & 3 deletions module_types/avatar_upload.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { RequestBaseConfig } from './base'

// export interface AvatarUploadRequestConfig extends RequestBaseConfig {
// }
export interface AvatarUploadRequestConfig extends RequestBaseConfig {
imgFile: {
name: string
data: string | Buffer
}
imgSize?: number
imgX?: number
imgY?: number
}
11 changes: 9 additions & 2 deletions module_types/playlist_cover_update.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { RequestBaseConfig } from './base'

export interface PlaylistCoverUpdateRequestConfig extends RequestBaseConfig {
export interface PlaylistCoverUpdateRequestConfig extends RequestBaseConfig {
id: string
imgFile: {
name: string
data: string | Buffer
}

imgSize?: number
imgX?: number
imgY?: number
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"request": "^2.88.0"
},
"devDependencies": {
"@types/node": "^14.6.4",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"eslint": "^7.8.1",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
resolved "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
integrity sha1-9MfsQ+gbMZqYFRFQMXCfJph4kfA=

"@types/node@^14.6.4":
version "14.6.4"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.6.4.tgz?cache=0&sync_timestamp=1599169585298&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.6.4.tgz#a145cc0bb14ef9c4777361b7bbafa5cf8e3acb5a"
integrity sha1-oUXMC7FO+cR3c2G3u6+lz446y1o=

"@types/parse-json@^4.0.0":
version "4.0.0"
resolved "https://registry.npm.taobao.org/@types/parse-json/download/@types/parse-json-4.0.0.tgz?cache=0&sync_timestamp=1596840707693&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fparse-json%2Fdownload%2F%40types%2Fparse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
Expand Down

0 comments on commit f711b07

Please sign in to comment.