11import axios , { AxiosInstance , AxiosError , AxiosResponse , InternalAxiosRequestConfig } from 'axios'
2- import { CreateNoteOptions , GetMe , GetUserHistory , GetUserNotes , GetUserNote , CreateUserNote , GetUserTeams , GetTeamNotes , CreateTeamNote , SingleNote } from './type'
2+ import { CreateNoteOptions , GetMe , GetUserHistory , GetUserNotes , GetUserNote , CreateUserNote , GetUserTeams , GetTeamNotes , CreateTeamNote , SingleNote , UpdateNoteOptions } from './type'
33import * as HackMDErrors from './error'
44
55export type RequestOptions = {
@@ -165,7 +165,7 @@ export class API {
165165 return this . unwrapData ( this . axios . patch < SingleNote > ( `notes/${ noteId } ` , { content } ) , options . unwrapData , true ) as unknown as OptionReturnType < Opt , SingleNote >
166166 }
167167
168- async updateNote < Opt extends RequestOptions > ( noteId : string , payload : Partial < Pick < SingleNote , 'content' | 'readPermission' | 'writePermission' | 'permalink' > > , options = defaultOption as Opt ) : Promise < OptionReturnType < Opt , SingleNote > > {
168+ async updateNote < Opt extends RequestOptions > ( noteId : string , payload : UpdateNoteOptions , options = defaultOption as Opt ) : Promise < OptionReturnType < Opt , SingleNote > > {
169169 return this . unwrapData ( this . axios . patch < SingleNote > ( `notes/${ noteId } ` , payload ) , options . unwrapData , true ) as unknown as OptionReturnType < Opt , SingleNote >
170170 }
171171
@@ -189,7 +189,7 @@ export class API {
189189 return this . axios . patch < AxiosResponse > ( `teams/${ teamPath } /notes/${ noteId } ` , { content } )
190190 }
191191
192- async updateTeamNote ( teamPath : string , noteId : string , options : Partial < Pick < SingleNote , 'content' | 'readPermission' | 'writePermission' | 'permalink' > > ) : Promise < AxiosResponse > {
192+ async updateTeamNote ( teamPath : string , noteId : string , options : UpdateNoteOptions ) : Promise < AxiosResponse > {
193193 return this . axios . patch < AxiosResponse > ( `teams/${ teamPath } /notes/${ noteId } ` , options )
194194 }
195195
0 commit comments