0.10.0 • Published 5 days ago

@gradio/upload v0.10.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 days ago

@gradio/upload

<script>
    import { Upload, ModifyUpload, normalise_file, get_fetchable_url_or_file, upload, prepare_files } from "@gradio/upload";
</script>

Upload

	export let filetype: string | null = null;
	export let dragging = false;
	export let boundedheight = true;
	export let center = true;
	export let flex = true;
	export let file_count = "single";
	export let disable_click = false;
	export let root: string;
	export let hidden = false;

ModifyUpload

    export let editable = false;
	export let undoable = false;
	export let absolute = true;
	export let i18n: I18nFormatter;
export function normalise_file(
	file: FileData | null,
	server_url: string,
	proxy_url: string | null
): FileData | null;

export function normalise_file(
	file: FileData[] | null,
	server_url: string,
	proxy_url: string | null
): FileData[] | null;

export function normalise_file(
	file: FileData[] | FileData | null,
	server_url: string, // root: string,
	proxy_url: string | null // root_url: string | null
): FileData[] | FileData | null;

export function normalise_file(
	file: FileData[] | FileData | null,
	server_url: string, // root: string,
	proxy_url: string | null // root_url: string | null
): FileData[] | FileData | null;

export function get_fetchable_url_or_file(
	path: string | null,
	server_url: string,
	proxy_url: string | null
): string

export async function upload(
	file_data: FileData[],
	root: string,
	upload_fn: typeof upload_files = upload_files
): Promise<(FileData | null)[] | null>

export async function prepare_files(
	files: File[],
	is_stream?: boolean
): Promise<FileData[]> {
	return files.map(
		(f, i) =>
			new FileData({
				path: f.name,
				orig_name: f.name,
				blob: f,
				size: f.size,
				mime_type: f.type,
				is_stream
			})
	);
}
0.10.0

5 days ago

0.9.0

13 days ago

0.8.5

20 days ago

0.8.4

1 month ago

0.8.3

1 month ago

0.8.2

1 month ago

0.8.1

1 month ago

0.8.0

2 months ago

0.7.7

2 months ago

0.7.6

2 months ago

0.7.5

2 months ago

0.7.4

3 months ago

0.7.3

3 months ago

0.7.2

3 months ago

0.7.1

3 months ago

0.7.0

3 months ago

0.6.1

4 months ago

0.6.0

4 months ago

0.5.8

4 months ago

0.5.7

5 months ago

0.5.6

5 months ago

0.5.5

5 months ago

0.5.4

5 months ago

0.5.3

5 months ago

0.5.2

5 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.4.2

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.3

6 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.3.0-beta.6

6 months ago

0.3.0-beta.4

7 months ago

0.3.0-beta.3

8 months ago

0.3.0-beta.2

8 months ago

0.3.0-beta.1

8 months ago

0.3.0-beta.0

8 months ago