diff --git a/.changeset/smooth-camels-prove.md b/.changeset/smooth-camels-prove.md new file mode 100644 index 0000000000000..ef43d722ab8ee --- /dev/null +++ b/.changeset/smooth-camels-prove.md @@ -0,0 +1,5 @@ +--- +"@gradio/client": patch +--- + +Refacor types. diff --git a/client/js/src/client.ts b/client/js/src/client.ts index 8ca9c7bbf3f88..ef848ed3f4de6 100644 --- a/client/js/src/client.ts +++ b/client/js/src/client.ts @@ -708,10 +708,25 @@ function transform_output( return transformed_data; } -export function normalise_file( - file: Array | FileData | string | null, +function normalise_file( + file: Array, root: string, root_url: string | null +): Array; +function normalise_file( + file: FileData | string, + root: string, + root_url: string | null +): FileData; +function normalise_file( + file: null, + root: string, + root_url: string | null +): null; +function normalise_file( + file, + root, + root_url ): Array | FileData | null { if (file == null) return null; if (typeof file === "string") { @@ -726,7 +741,6 @@ export function normalise_file( if (x === null) { normalized_file.push(null); } else { - //@ts-ignore normalized_file.push(normalise_file(x, root, root_url)); } }