From 46fd4d758e9f79a71e316ce37c3bf53a0e30d063 Mon Sep 17 00:00:00 2001 From: Quinn Daley Date: Wed, 26 Jun 2024 11:10:07 +0100 Subject: [PATCH] @uppy/xhr-upload: add `'PATCH'` as valid method (#5279) --- packages/@uppy/xhr-upload/src/index.ts | 16 +++++++++++++++- packages/@uppy/xhr-upload/types/index.d.ts | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/xhr-upload/src/index.ts b/packages/@uppy/xhr-upload/src/index.ts index cd5cafbc45..94b301dfd5 100644 --- a/packages/@uppy/xhr-upload/src/index.ts +++ b/packages/@uppy/xhr-upload/src/index.ts @@ -43,7 +43,21 @@ declare module '@uppy/core' { export interface XhrUploadOpts extends PluginOpts { endpoint: string - method?: 'post' | 'put' + method?: + | 'GET' + | 'HEAD' + | 'POST' + | 'PUT' + | 'DELETE' + | 'OPTIONS' + | 'PATCH' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'post' + | 'put' + | string formData?: boolean fieldName?: string headers?: diff --git a/packages/@uppy/xhr-upload/types/index.d.ts b/packages/@uppy/xhr-upload/types/index.d.ts index 27ecbfd9ce..74852b9d4d 100644 --- a/packages/@uppy/xhr-upload/types/index.d.ts +++ b/packages/@uppy/xhr-upload/types/index.d.ts @@ -15,7 +15,21 @@ export interface XHRUploadOptions extends PluginOptions { timeout?: number responseUrlFieldName?: string endpoint: string - method?: 'GET' | 'POST' | 'PUT' | 'HEAD' | 'get' | 'post' | 'put' | 'head' + method?: + | 'GET' + | 'HEAD' + | 'POST' + | 'PUT' + | 'DELETE' + | 'OPTIONS' + | 'PATCH' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'post' + | 'put' + | string locale?: XHRUploadLocale responseType?: string withCredentials?: boolean