import { RawAttachment , RestRequestOptions , RestFinishedResponse , RestRequestMethods } from '@discordoo/providers' ; import { RestManager } from '@src/rest/RestManager' ; /** Constructor used to build and perform requests to discord rest api */ export interface RestRequest { /** RestManager to perform requests */ rest : RestManager ; /** Url parts */ requestStack : string [ ] ; /** Query to be built */ requestQuery : Record < string , string > ; /** Headers that will be attached to the request */ requestHeaders : Record < string , any > ; /** Request body data */ requestBody : any ; /** Request payload data (attachments) */ requestPayload : RawAttachment [ ] ; /** Major parameter of this request, used for rate limits processing */ majorParameter ? : string ; /** Request path */ path : string ; param parts url ( ... parts ) : RestRequest ; param data query ( data ) : RestRequest ; param headers headers ( headers ) : RestRequest ; param body body ( body ) : RestRequest ; param attachments attach ( ... attachments ) : RestRequest ; param method param options request < T = any > ( method , options ? ) : RestFinishedResponse < T > ; param options get < T = any > ( options ? ) : RestFinishedResponse < T > ; param options post < T = any > ( options ? ) : RestFinishedResponse < T > ; param options patch < T = any > ( options ? ) : RestFinishedResponse < T > ; param options put < T = any > ( options ? ) : RestFinishedResponse < T > ; param options delete < T = any > ( options ? ) : RestFinishedResponse < T > ; }