Skip to content

Commit

Permalink
uppy/image-editor: Fix TypeScript error in image-editor types (#4334)
Browse files Browse the repository at this point in the history
Fix TypeScript error in image-editor types

Caused by TypeScript >= 4.8.
  • Loading branch information
MatthiasKunnen authored Feb 27, 2023
1 parent 96b8440 commit 7bb3050
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/@uppy/image-editor/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PluginOptions, UIPlugin, PluginTarget, UppyFile } from '@uppy/core'
import type { PluginOptions, UIPlugin, PluginTarget, UppyFile, IndexedObject } from '@uppy/core'
import type Cropper from 'cropperjs'
import ImageEditorLocale from './generatedLocale'

Expand Down Expand Up @@ -32,12 +32,12 @@ export default ImageEditor

// Events

export type FileEditorStartCallback<TMeta> = (file: UppyFile<TMeta>) => void;
export type FileEditorCompleteCallback<TMeta> = (updatedFile: UppyFile<TMeta>) => void;
export type FileEditorCancelCallback<TMeta> = (file: UppyFile<TMeta>) => void;
export type FileEditorStartCallback<TMeta extends IndexedObject<any>> = (file: UppyFile<TMeta>) => void;
export type FileEditorCompleteCallback<TMeta extends IndexedObject<any>> = (updatedFile: UppyFile<TMeta>) => void;
export type FileEditorCancelCallback<TMeta extends IndexedObject<any>> = (file: UppyFile<TMeta>) => void;

declare module '@uppy/core' {
export interface UppyEventMap<TMeta> {
export interface UppyEventMap<TMeta extends IndexedObject<any>> {
'file-editor:start' : FileEditorStartCallback<TMeta>
'file-editor:complete': FileEditorCompleteCallback<TMeta>
'file-editor:cancel': FileEditorCancelCallback<TMeta>
Expand Down

0 comments on commit 7bb3050

Please sign in to comment.