File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { type TypedEventEmitter } from "../models/typed-event-emitter.ts";
23
23
import { Method } from "./method.ts" ;
24
24
import { ConnectionError , MatrixError , TokenRefreshError } from "./errors.ts" ;
25
25
import {
26
+ type BaseRequestOpts ,
26
27
HttpApiEvent ,
27
28
type HttpApiEventHandlerMap ,
28
29
type IHttpOpts ,
@@ -263,7 +264,7 @@ export class FetchHttpApi<O extends IHttpOpts> {
263
264
method : Method ,
264
265
url : URL | string ,
265
266
body ?: Body ,
266
- opts : Pick < IRequestOpts , "headers" | "json" | "localTimeoutMs" | "keepAlive" | "abortSignal" | "priority" > = { } ,
267
+ opts : BaseRequestOpts = { } ,
267
268
) : Promise < ResponseType < T , O > > {
268
269
const urlForLogs = this . sanitizeUrlForLogs ( url ) ;
269
270
this . opts . logger ?. debug ( `FetchHttpApi: --> ${ method } ${ urlForLogs } ` ) ;
Original file line number Diff line number Diff line change @@ -74,17 +74,8 @@ export interface IHttpOpts {
74
74
logger ?: Logger ;
75
75
}
76
76
77
- export interface IRequestOpts extends Pick < RequestInit , "priority" > {
78
- /**
79
- * The alternative base url to use.
80
- * If not specified, uses this.opts.baseUrl
81
- */
82
- baseUrl ?: string ;
83
- /**
84
- * The full prefix to use e.g.
85
- * "/_matrix/client/v2_alpha". If not specified, uses this.opts.prefix.
86
- */
87
- prefix ?: string ;
77
+ /** Options object for {@link FetchHttpApi.requestOtherUrl} */
78
+ export interface BaseRequestOpts extends Pick < RequestInit , "priority" > {
88
79
/**
89
80
* map of additional request headers
90
81
*/
@@ -97,6 +88,19 @@ export interface IRequestOpts extends Pick<RequestInit, "priority"> {
97
88
localTimeoutMs ?: number ;
98
89
keepAlive ?: boolean ; // defaults to false
99
90
json ?: boolean ; // defaults to true
91
+ }
92
+
93
+ export interface IRequestOpts extends BaseRequestOpts {
94
+ /**
95
+ * The alternative base url to use.
96
+ * If not specified, uses this.opts.baseUrl
97
+ */
98
+ baseUrl ?: string ;
99
+ /**
100
+ * The full prefix to use e.g.
101
+ * "/_matrix/client/v2_alpha". If not specified, uses this.opts.prefix.
102
+ */
103
+ prefix ?: string ;
100
104
101
105
// Set to true to prevent the request function from emitting a Session.logged_out event.
102
106
// This is intended for use on endpoints where M_UNKNOWN_TOKEN is a valid/notable error response,
You can’t perform that action at this time.
0 commit comments