From 181ea6dfe85eae565ad8154490cc8fff467d80f6 Mon Sep 17 00:00:00 2001 From: Merlijn Vos Date: Tue, 11 Jun 2024 15:41:01 +0200 Subject: [PATCH] @uppy/core: set default for Body generic (#5244) * @uppy/core: set default for Body generic * Update angular example --- examples/angular-example/src/app/app.component.ts | 3 +-- packages/@uppy/core/src/Uppy.ts | 2 +- packages/@uppy/core/src/types.test.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/angular-example/src/app/app.component.ts b/examples/angular-example/src/app/app.component.ts index e43cf97e9..5daa5ffb4 100644 --- a/examples/angular-example/src/app/app.component.ts +++ b/examples/angular-example/src/app/app.component.ts @@ -65,8 +65,7 @@ export class AppComponent implements OnInit { }, } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - uppy: Uppy = new Uppy({ debug: true, autoProceed: true }) + uppy = new Uppy({ debug: true, autoProceed: true }) ngOnInit(): void { this.uppy diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 66996e46a..744554296 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -308,7 +308,7 @@ const defaultUploadState = { * Manages plugins, state updates, acts as an event bus, * adds/removes files and metadata. */ -export class Uppy { +export class Uppy> { static VERSION = packageJson.version #plugins: Record[]> = Object.create(null) diff --git a/packages/@uppy/core/src/types.test.ts b/packages/@uppy/core/src/types.test.ts index e73cea2f4..6d7a834f7 100644 --- a/packages/@uppy/core/src/types.test.ts +++ b/packages/@uppy/core/src/types.test.ts @@ -17,12 +17,12 @@ class TestPlugin extends UIPlugin { test('can use Uppy class without generics', async () => { const core = new Uppy() - expectTypeOf(core).toEqualTypeOf>() + expectTypeOf(core).toEqualTypeOf>>() }) test('can .use() a plugin', async () => { const core = new Uppy().use(TestPlugin) - expectTypeOf(core).toEqualTypeOf>() + expectTypeOf(core).toEqualTypeOf>>() }) test('Meta and Body generic move through the Uppy class', async () => {