Skip to content

Commit

Permalink
update: the use of a type in some interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dependentmadani committed Jul 10, 2024
1 parent 3abdc1e commit 10336e0
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export interface UploadOptions {
/**
* Represents the format of a file object data with the additional data.
*/
export type FileObjectData<AdditionalData = {}> = {
export type FileObjectData<AdditionalFileData = {}> = {
/**
* The URL of the file.
*/
url: string;
} & AdditionalData;
} & AdditionalFileData;

/**
* User configuration of Image block tunes. Allows to add custom tunes through the config
Expand Down Expand Up @@ -59,12 +59,7 @@ export interface UploadResponseFormat<AdditionalFileData = {}> {
* 'url' is required,
* also can contain any additional data that will be saved and passed back
*/
file: {
/**
* The URL of the uploaded image.
*/
url: string;
} & AdditionalFileData;
file: FileObjectData<AdditionalFileData>;
}

/**
Expand Down Expand Up @@ -95,12 +90,7 @@ export type ImageToolData<Actions = {}, AdditionalFileData = {}> = {
* Object containing the URL of the image file.
* Also can contain any additional data.
*/
file: {
/**
* The URL of the image.
*/
url: string;
} & AdditionalFileData;
file: FileObjectData<AdditionalFileData>;
} & (Actions extends Record<string, boolean> ? Actions : {});

/**
Expand Down

0 comments on commit 10336e0

Please sign in to comment.