diff --git a/packages/@uppy/url/src/Url.jsx b/packages/@uppy/url/src/Url.jsx index c5551123f6..821fe769e3 100644 --- a/packages/@uppy/url/src/Url.jsx +++ b/packages/@uppy/url/src/Url.jsx @@ -104,7 +104,7 @@ export default class Url extends UIPlugin { }) } - async addFile (protocollessUrl) { + async addFile (protocollessUrl, optionalMeta = undefined) { const url = this.addProtocolToURL(protocollessUrl) if (!this.checkIfCorrectURL(url)) { this.uppy.log(`[URL] Incorrect URL entered: ${url}`) @@ -116,6 +116,7 @@ export default class Url extends UIPlugin { const meta = await this.getMeta(url) const tagFile = { + meta: optionalMeta, source: this.id, name: this.getFileNameFromUrl(url), type: meta.type, diff --git a/packages/@uppy/url/types/index.d.ts b/packages/@uppy/url/types/index.d.ts index 5494abe291..c923bf0f8f 100644 --- a/packages/@uppy/url/types/index.d.ts +++ b/packages/@uppy/url/types/index.d.ts @@ -1,4 +1,4 @@ -import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core' +import type { PluginOptions, UIPlugin, PluginTarget, IndexedObject } from '@uppy/core' import type { RequestClientOptions } from '@uppy/companion-client' import UrlLocale from './generatedLocale' @@ -9,7 +9,7 @@ export interface UrlOptions extends PluginOptions, RequestClientOptions { } declare class Url extends UIPlugin { - public addFile(url: string): undefined | string | never + public addFile(url: string, meta?: IndexedObject): undefined | string | never } export default Url