Skip to content

Commit

Permalink
Merge branch 'main' into transloadit-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Mar 18, 2024
2 parents 4cdd092 + 644fe50 commit a56f380
Show file tree
Hide file tree
Showing 20 changed files with 457 additions and 230 deletions.
19 changes: 19 additions & 0 deletions .yarn/patches/resize-observer-polyfill-npm-1.5.1-603120e8a0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/src/index.d.ts b/src/index.d.ts
index 74aacc0526ff554e9248c3f6fb44c353b5465efc..1b236d215a9db4cbc1c83f4d8bce24add202483e 100644
--- a/src/index.d.ts
+++ b/src/index.d.ts
@@ -1,14 +1,3 @@
-interface DOMRectReadOnly {
- readonly x: number;
- readonly y: number;
- readonly width: number;
- readonly height: number;
- readonly top: number;
- readonly right: number;
- readonly bottom: number;
- readonly left: number;
-}
-
declare global {
interface ResizeObserverCallback {
(entries: ResizeObserverEntry[], observer: ResizeObserver): void
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
"start-server-and-test": "patch:start-server-and-test@npm:1.14.0#.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch",
"stylelint-config-rational-order": "patch:stylelint-config-rational-order@npm%3A0.1.2#./.yarn/patches/stylelint-config-rational-order-npm-0.1.2-d8336e84ed.patch",
"uuid@^8.3.2": "patch:uuid@npm:8.3.2#.yarn/patches/uuid-npm-8.3.2-eca0baba53.patch",
"tus-js-client": "patch:tus-js-client@npm%3A3.1.3#./.yarn/patches/tus-js-client-npm-3.1.3-dc57874d23.patch"
"tus-js-client": "patch:tus-js-client@npm%3A3.1.3#./.yarn/patches/tus-js-client-npm-3.1.3-dc57874d23.patch",
"resize-observer-polyfill": "patch:resize-observer-polyfill@npm%3A1.5.1#./.yarn/patches/resize-observer-polyfill-npm-1.5.1-603120e8a0.patch"
}
}
4 changes: 2 additions & 2 deletions packages/@uppy/core/src/BasePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
OptionalPluralizeLocale,
} from '@uppy/utils/lib/Translator'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { State, Uppy } from './Uppy'
import type { State, UnknownPlugin, Uppy } from './Uppy'

export type PluginOpts = {
locale?: Locale
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class BasePlugin<
*/

// eslint-disable-next-line @typescript-eslint/no-unused-vars
addTarget(plugin: unknown): HTMLElement {
addTarget(plugin: UnknownPlugin<M, B>): HTMLElement | null {
throw new Error(
"Extend the addTarget method to add your plugin to another plugin's target",
)
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/core/src/UIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class UIPlugin<

this.onMount()

return this.el
return this.el!
}

const targetPlugin = this.getTargetPlugin(target)
Expand All @@ -148,7 +148,7 @@ class UIPlugin<
this.el = targetPlugin.addTarget(plugin)

this.onMount()
return this.el
return this.el!
}

this.uppy.log(`Not installing ${callerPluginName}`)
Expand Down
11 changes: 7 additions & 4 deletions packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export type UnknownSearchProviderPlugin<
provider: CompanionClientSearchProvider
}

interface UploadResult<M extends Meta, B extends Body> {
export interface UploadResult<M extends Meta, B extends Body> {
successful?: UppyFile<M, B>[]
failed?: UppyFile<M, B>[]
uploadID?: string
Expand All @@ -156,10 +156,12 @@ export interface State<M extends Meta, B extends Body>
uploadProgress: boolean
individualCancellation: boolean
resumableUploads: boolean
isMobileDevice?: boolean
darkMode?: boolean
}
currentUploads: Record<string, CurrentUpload<M, B>>
allowNewUpload: boolean
recoveredState: null | State<M, B>
recoveredState: null | Required<Pick<State<M, B>, 'files' | 'currentUploads'>>
error: string | null
files: {
[key: string]: UppyFile<M, B>
Expand Down Expand Up @@ -319,6 +321,7 @@ export interface _UppyEventMap<M extends Meta, B extends Body> {
'reset-progress': GenericEventCallback
restored: (pluginData: any) => void
'restore-confirmed': GenericEventCallback
'restore-canceled': GenericEventCallback
'restriction-failed': RestrictionFailedCallback<M, B>
'resume-all': GenericEventCallback
'retry-all': RetryAllCallback
Expand Down Expand Up @@ -635,7 +638,7 @@ export class Uppy<M extends Meta, B extends Body> {

// @todo next major: rename to `clear()`, make it also cancel ongoing uploads
// or throw and say you need to cancel manually
protected clearUploadedFiles(): void {
clearUploadedFiles(): void {
this.setState({ ...defaultUploadState, files: {} })
}

Expand Down Expand Up @@ -1714,7 +1717,7 @@ export class Uppy<M extends Meta, B extends Body> {

#updateOnlineStatus = this.updateOnlineStatus.bind(this)

getID(): UppyOptions<M, B>['id'] {
getID(): string {
return this.opts.id
}

Expand Down
3 changes: 2 additions & 1 deletion packages/@uppy/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export { default } from './Uppy.ts'
export {
default as Uppy,
type UppyEventMap,
type State,
type UnknownPlugin,
type UnknownProviderPlugin,
type UnknownSearchProviderPlugin,
type UploadResult,
type UppyEventMap,
} from './Uppy.ts'
export { default as UIPlugin } from './UIPlugin.ts'
export { default as BasePlugin } from './BasePlugin.ts'
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/golden-retriever/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tsconfig.*
Loading

0 comments on commit a56f380

Please sign in to comment.