File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ declare module "replicate" {
183183 headers ?: object | Headers ;
184184 params ?: object ;
185185 data ?: object ;
186+ signal ?: AbortSignal ;
186187 }
187188 ) : Promise < Response > ;
188189
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ class Replicate {
225225 * @param {object } [options.params] - Query parameters
226226 * @param {object|Headers } [options.headers] - HTTP headers
227227 * @param {object } [options.data] - Body parameters
228+ * @param {AbortSignal } [options.signal] - AbortSignal to cancel the request
228229 * @returns {Promise<Response> } - Resolves with the response object
229230 * @throws {ApiError } If the request failed
230231 */
@@ -241,7 +242,7 @@ class Replicate {
241242 ) ;
242243 }
243244
244- const { method = "GET" , params = { } , data } = options ;
245+ const { method = "GET" , params = { } , data, signal } = options ;
245246
246247 for ( const [ key , value ] of Object . entries ( params ) ) {
247248 url . searchParams . append ( key , value ) ;
@@ -273,6 +274,7 @@ class Replicate {
273274 method,
274275 headers,
275276 body,
277+ signal,
276278 } ;
277279
278280 const shouldRetry =
You can’t perform that action at this time.
0 commit comments