@gradio/file 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,49 @@
1
1
  # @gradio/file
2
+
3
+ ## 0.14.1
4
+
5
+ ### Fixes
6
+
7
+ - [#12800](https://github.com/gradio-app/gradio/pull/12800) [`7a1c321`](https://github.com/gradio-app/gradio/commit/7a1c321b6546ba05a353488f5133e8262c4a8a39) - Bump svelte/kit for security reasons. Thanks @freddyaboulton!
8
+ - [#12698](https://github.com/gradio-app/gradio/pull/12698) [`db86165`](https://github.com/gradio-app/gradio/commit/db86165535386991701ea89b2083ef5e60cd23e8) - Migrates gr.File. Thanks @aliabid94!
9
+ - [#12779](https://github.com/gradio-app/gradio/pull/12779) [`ea2d3e9`](https://github.com/gradio-app/gradio/commit/ea2d3e985a8b42d188e551f517c5825c00790628) - Migrate Audio + Upload + Atoms to Svelte 5. Thanks @dawoodkhan82!
10
+
11
+ ### Dependency updates
12
+
13
+ - @gradio/statustracker@0.12.2
14
+ - @gradio/atoms@0.20.1
15
+ - @gradio/utils@0.11.2
16
+ - @gradio/icons@0.15.1
17
+ - @gradio/upload@0.17.4
18
+ - @gradio/client@2.0.3
19
+
20
+ ## 0.14.0
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/utils@0.11.1
25
+ - @gradio/client@2.0.2
26
+
27
+ ## 0.14.0
28
+
29
+ ### Features
30
+
31
+ - [#12539](https://github.com/gradio-app/gradio/pull/12539) [`f1d83fa`](https://github.com/gradio-app/gradio/commit/f1d83fac3d6e4bad60cf896a026fa2d572f26073) - Add ability to add custom buttons to components. Thanks @abidlabs!
32
+
33
+ ### Dependency updates
34
+
35
+ - @gradio/atoms@0.20.0
36
+ - @gradio/utils@0.11.0
37
+ - @gradio/client@2.0.1
38
+ - @gradio/statustracker@0.12.1
39
+ - @gradio/upload@0.17.3
40
+
41
+ ## 0.13.1
42
+
43
+ ### Dependency updates
44
+
45
+ - @gradio/utils@0.10.4
46
+
2
47
  ## 0.13.1
3
48
 
4
49
  ### Features
package/Example.svelte CHANGED
@@ -1,9 +1,15 @@
1
1
  <script lang="ts">
2
2
  import type { FileData } from "@gradio/client";
3
3
 
4
- export let value: FileData | null;
5
- export let type: "gallery" | "table";
6
- export let selected = false;
4
+ let {
5
+ value,
6
+ type,
7
+ selected = false
8
+ }: {
9
+ value: FileData | null;
10
+ type: "gallery" | "table";
11
+ selected: boolean;
12
+ } = $props();
7
13
  </script>
8
14
 
9
15
  <div
@@ -1,64 +1,67 @@
1
- <script>
2
- import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import File from "./Index.svelte";
4
- </script>
4
+ import { wrapProps } from "../storybook/wrapProps";
5
+
6
+ const cheetah = "/cheetah.jpg";
7
+ const bus = "/bus.png";
5
8
 
6
- <Meta
7
- title="Components/File"
8
- component={File}
9
- argTypes={{
10
- value: {
11
- control: "text",
12
- description: "The URL or filepath (or list of URLs or filepaths)",
13
- name: "value",
14
- value: []
9
+ const { Story } = defineMeta({
10
+ title: "Components/File",
11
+ component: File,
12
+ argTypes: {
13
+ value: {
14
+ control: "text",
15
+ description: "The URL or filepath (or list of URLs or filepaths)",
16
+ name: "value",
17
+ value: []
18
+ }
15
19
  }
16
- }}
17
- />
20
+ });
21
+ </script>
18
22
 
19
- <Template let:args>
20
- <File {...args} />
21
- </Template>
23
+ {#snippet template(args)}
24
+ <File {...wrapProps(args)} />
25
+ {/snippet}
22
26
 
23
27
  <Story
24
28
  name="Single File"
25
29
  args={{
26
30
  value: [
27
31
  {
28
- path: "cheetah.jpg",
32
+ path: cheetah,
29
33
  orig_name: "cheetah.jpg",
30
- url: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
34
+ url: cheetah,
31
35
  size: 10000
32
36
  }
33
37
  ]
34
38
  }}
39
+ {template}
35
40
  />
36
41
  <Story
37
42
  name="Multiple files, with height set to 150px and reordering enabled"
38
43
  args={{
39
44
  value: [
40
45
  {
41
- path: "cheetah.jpg",
42
- orig_name: "cheetah.jpgz",
43
- url: "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png",
46
+ path: bus,
47
+ orig_name: "bus.png",
48
+ url: bus,
44
49
  size: 10000
45
50
  },
46
51
  {
47
- path: "cheetah.jpgs",
52
+ path: cheetah,
48
53
  orig_name: "cheetah.jpg",
49
- url: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
54
+ url: cheetah,
50
55
  size: 10000
51
56
  }
52
57
  ],
53
58
  height: 150,
54
59
  allow_reordering: true
55
60
  }}
61
+ {template}
56
62
  />
57
63
  <Story
58
64
  name="File upload with height set to 400px"
59
- args={{
60
- interactive: true,
61
- value: null,
62
- height: 400
63
- }}
65
+ args={{ interactive: true, value: null, height: 400 }}
66
+ {template}
64
67
  />
@@ -1,12 +1,14 @@
1
- <script context="module">
2
- import { Template, Story } from "@storybook/addon-svelte-csf";
3
- import { format } from "svelte-i18n";
4
- import FileUpload from "./shared/FileUpload.svelte";
5
- import { get } from "svelte/store";
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import File from "./Index.svelte";
4
+ import { wrapProps } from "../storybook/wrapProps";
6
5
 
7
- export const meta = {
6
+ const cheetah = "/cheetah.jpg";
7
+ const lion = "/lion.jpg";
8
+
9
+ const { Story } = defineMeta({
8
10
  title: "Components/FileUpload",
9
- component: FileUpload,
11
+ component: File,
10
12
  argTypes: {
11
13
  value: {
12
14
  control: "text",
@@ -22,43 +24,53 @@
22
24
  value: "single"
23
25
  }
24
26
  }
25
- };
27
+ });
26
28
  </script>
27
29
 
28
- <Template let:args>
29
- <FileUpload {...args} i18n={get(format)} />
30
- </Template>
30
+ {#snippet template(args)}
31
+ <File {...wrapProps(args)} />
32
+ {/snippet}
31
33
 
32
34
  <Story
33
35
  name="Single File"
34
36
  args={{
35
37
  value: [
36
38
  {
37
- path: "cheetah.jpg",
39
+ path: cheetah,
38
40
  orig_name: "cheetah.jpg",
39
- url: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
41
+ url: cheetah,
40
42
  size: 10000
41
43
  }
42
44
  ],
43
- file_count: "single"
45
+ file_count: "single",
46
+ interactive: true
44
47
  }}
48
+ {template}
45
49
  />
46
50
  <Story
47
51
  name="Multiple files"
48
52
  args={{
49
- value: Array(2).fill({
50
- path: "cheetah.jpg",
51
- orig_name: "cheetah.jpg",
52
- url: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
53
- size: 10000
54
- }),
55
- file_count: "multiple"
53
+ value: [
54
+ {
55
+ path: cheetah,
56
+ orig_name: "cheetah.jpg",
57
+ url: cheetah,
58
+ size: 10000
59
+ },
60
+ {
61
+ path: lion,
62
+ orig_name: "lion.jpg",
63
+ url: lion,
64
+ size: 10000
65
+ }
66
+ ],
67
+ file_count: "multiple",
68
+ interactive: true
56
69
  }}
70
+ {template}
57
71
  />
58
72
  <Story
59
73
  name="No value"
60
- args={{
61
- value: null,
62
- file_count: "multiple"
63
- }}
74
+ args={{ value: null, file_count: "multiple", interactive: true }}
75
+ {template}
64
76
  />
package/Index.svelte CHANGED
@@ -13,11 +13,12 @@
13
13
  import FileUpload from "./shared/FileUpload.svelte";
14
14
  import { Block, UploadText } from "@gradio/atoms";
15
15
  import type { FileEvents, FileProps } from "./types";
16
+ import type { SelectData } from "@gradio/utils";
16
17
  import { StatusTracker } from "@gradio/statustracker";
17
18
  import { tick } from "svelte";
18
19
 
19
20
  const props = $props();
20
- let upload_promise = $state<Promise<any>>();
21
+ let upload_promise = $state<Promise<any> | null>(null);
21
22
 
22
23
  let dragging = $state(false);
23
24
  let pending_upload = $state(false);
@@ -78,6 +79,10 @@
78
79
  show_label={gradio.shared.show_label}
79
80
  height={gradio.props.height}
80
81
  i18n={gradio.i18n}
82
+ buttons={gradio.props.buttons}
83
+ on_custom_button_click={(id) => {
84
+ gradio.dispatch("custom_button_click", { id });
85
+ }}
81
86
  />
82
87
  {:else}
83
88
  <FileUpload
@@ -90,23 +95,27 @@
90
95
  file_count={gradio.props.file_count}
91
96
  file_types={gradio.props.file_types}
92
97
  selectable={gradio.props._selectable}
93
- height={gradio.props.height}
98
+ height={gradio.props.height ?? undefined}
94
99
  root={gradio.shared.root}
95
100
  allow_reordering={gradio.props.allow_reordering}
96
101
  max_file_size={gradio.shared.max_file_size}
97
- on:change={({ detail }) => {
102
+ buttons={gradio.props.buttons}
103
+ on_custom_button_click={(id) => {
104
+ gradio.dispatch("custom_button_click", { id });
105
+ }}
106
+ onchange={(detail) => {
98
107
  gradio.props.value = detail;
99
108
  }}
100
- on:drag={({ detail }) => (dragging = detail)}
101
- on:clear={() => gradio.dispatch("clear")}
102
- on:select={({ detail }) => gradio.dispatch("select", detail)}
103
- on:upload={() => gradio.dispatch("upload")}
104
- on:error={({ detail }) => {
109
+ ondrag={(detail) => (dragging = detail)}
110
+ onclear={() => gradio.dispatch("clear")}
111
+ onselect={(detail: SelectData) => gradio.dispatch("select", detail)}
112
+ onupload={() => gradio.dispatch("upload")}
113
+ onerror={(error) => {
105
114
  gradio.shared.loading_status = gradio.shared.loading_status || {};
106
115
  gradio.shared.loading_status.status = "error";
107
- gradio.dispatch("error", detail);
116
+ gradio.dispatch("error", error);
108
117
  }}
109
- on:delete={({ detail }) => {
118
+ ondelete={(detail) => {
110
119
  gradio.dispatch("delete", detail);
111
120
  }}
112
121
  i18n={gradio.i18n}
@@ -1,9 +1,15 @@
1
1
  <script lang="ts">
2
2
  import type { FileData } from "@gradio/client";
3
3
 
4
- export let value: FileData | null;
5
- export let type: "gallery" | "table";
6
- export let selected = false;
4
+ let {
5
+ value,
6
+ type,
7
+ selected = false
8
+ }: {
9
+ value: FileData | null;
10
+ type: "gallery" | "table";
11
+ selected: boolean;
12
+ } = $props();
7
13
  </script>
8
14
 
9
15
  <div
@@ -1,23 +1,9 @@
1
1
  import type { FileData } from "@gradio/client";
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const Example: $$__sveltets_2_IsomorphicComponent<{
2
+ type $$ComponentProps = {
16
3
  value: FileData | null;
17
4
  type: "gallery" | "table";
18
- selected?: boolean;
19
- }, {
20
- [evt: string]: CustomEvent<any>;
21
- }, {}, {}, string>;
22
- type Example = InstanceType<typeof Example>;
5
+ selected: boolean;
6
+ };
7
+ declare const Example: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type Example = ReturnType<typeof Example>;
23
9
  export default Example;
package/dist/Index.svelte CHANGED
@@ -13,11 +13,12 @@
13
13
  import FileUpload from "./shared/FileUpload.svelte";
14
14
  import { Block, UploadText } from "@gradio/atoms";
15
15
  import type { FileEvents, FileProps } from "./types";
16
+ import type { SelectData } from "@gradio/utils";
16
17
  import { StatusTracker } from "@gradio/statustracker";
17
18
  import { tick } from "svelte";
18
19
 
19
20
  const props = $props();
20
- let upload_promise = $state<Promise<any>>();
21
+ let upload_promise = $state<Promise<any> | null>(null);
21
22
 
22
23
  let dragging = $state(false);
23
24
  let pending_upload = $state(false);
@@ -78,6 +79,10 @@
78
79
  show_label={gradio.shared.show_label}
79
80
  height={gradio.props.height}
80
81
  i18n={gradio.i18n}
82
+ buttons={gradio.props.buttons}
83
+ on_custom_button_click={(id) => {
84
+ gradio.dispatch("custom_button_click", { id });
85
+ }}
81
86
  />
82
87
  {:else}
83
88
  <FileUpload
@@ -90,23 +95,27 @@
90
95
  file_count={gradio.props.file_count}
91
96
  file_types={gradio.props.file_types}
92
97
  selectable={gradio.props._selectable}
93
- height={gradio.props.height}
98
+ height={gradio.props.height ?? undefined}
94
99
  root={gradio.shared.root}
95
100
  allow_reordering={gradio.props.allow_reordering}
96
101
  max_file_size={gradio.shared.max_file_size}
97
- on:change={({ detail }) => {
102
+ buttons={gradio.props.buttons}
103
+ on_custom_button_click={(id) => {
104
+ gradio.dispatch("custom_button_click", { id });
105
+ }}
106
+ onchange={(detail) => {
98
107
  gradio.props.value = detail;
99
108
  }}
100
- on:drag={({ detail }) => (dragging = detail)}
101
- on:clear={() => gradio.dispatch("clear")}
102
- on:select={({ detail }) => gradio.dispatch("select", detail)}
103
- on:upload={() => gradio.dispatch("upload")}
104
- on:error={({ detail }) => {
109
+ ondrag={(detail) => (dragging = detail)}
110
+ onclear={() => gradio.dispatch("clear")}
111
+ onselect={(detail: SelectData) => gradio.dispatch("select", detail)}
112
+ onupload={() => gradio.dispatch("upload")}
113
+ onerror={(error) => {
105
114
  gradio.shared.loading_status = gradio.shared.loading_status || {};
106
115
  gradio.shared.loading_status.status = "error";
107
- gradio.dispatch("error", detail);
116
+ gradio.dispatch("error", error);
108
117
  }}
109
- on:delete={({ detail }) => {
118
+ ondelete={(detail) => {
110
119
  gradio.dispatch("delete", detail);
111
120
  }}
112
121
  i18n={gradio.i18n}
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
- import { BlockLabel, Empty } from "@gradio/atoms";
2
+ import { BlockLabel, Empty, IconButtonWrapper } from "@gradio/atoms";
3
3
  import { File } from "@gradio/icons";
4
4
  import FilePreview from "./FilePreview.svelte";
5
+ import type { CustomButton as CustomButtonType } from "@gradio/utils";
5
6
 
6
7
  let {
7
8
  value,
@@ -10,11 +11,16 @@
10
11
  selectable,
11
12
  i18n,
12
13
  height,
14
+ buttons = null,
15
+ on_custom_button_click = null,
13
16
  on_select,
14
17
  on_download
15
18
  } = $props();
16
19
  </script>
17
20
 
21
+ {#if show_label && buttons && buttons.length > 0}
22
+ <IconButtonWrapper {buttons} {on_custom_button_click} />
23
+ {/if}
18
24
  <BlockLabel
19
25
  {show_label}
20
26
  float={value === null}
@@ -6,6 +6,8 @@ declare const File: import("svelte").Component<{
6
6
  selectable: any;
7
7
  i18n: any;
8
8
  height: any;
9
+ buttons?: any;
10
+ on_custom_button_click?: any;
9
11
  on_select: any;
10
12
  on_download: any;
11
13
  }, {}, "">;
@@ -1,24 +1,33 @@
1
1
  <script lang="ts">
2
2
  import type { FileData } from "@gradio/client";
3
3
  import { prettyBytes } from "./utils";
4
- import { createEventDispatcher } from "svelte";
5
4
  import type { I18nFormatter, SelectData } from "@gradio/utils";
6
5
  import { DownloadLink } from "@gradio/atoms";
7
6
 
8
- const dispatch = createEventDispatcher<{
9
- select: SelectData;
10
- change: FileData[] | FileData;
11
- delete: FileData;
12
- download: FileData;
13
- }>();
14
- export let value: FileData | FileData[];
15
- export let selectable = false;
16
- export let height: number | string | undefined = undefined;
17
- export let i18n: I18nFormatter;
18
- export let allow_reordering = false;
19
-
20
- let dragging_index: number | null = null;
21
- let drop_target_index: number | null = null;
7
+ let {
8
+ value,
9
+ selectable = false,
10
+ height = undefined,
11
+ i18n,
12
+ allow_reordering = false,
13
+ onselect,
14
+ onchange,
15
+ ondelete,
16
+ ondownload
17
+ }: {
18
+ value: FileData | FileData[];
19
+ selectable?: boolean;
20
+ height?: number | string | undefined;
21
+ i18n: I18nFormatter;
22
+ allow_reordering?: boolean;
23
+ onselect?: (event_data: SelectData) => void;
24
+ onchange?: (event_data: FileData[] | FileData) => void;
25
+ ondelete?: (event_data: FileData) => void;
26
+ ondownload?: (event_data: FileData) => void;
27
+ } = $props();
28
+
29
+ let dragging_index: number | null = $state(null);
30
+ let drop_target_index: number | null = $state(null);
22
31
 
23
32
  function handle_drag_start(event: DragEvent, index: number): void {
24
33
  dragging_index = index;
@@ -68,7 +77,7 @@
68
77
  );
69
78
 
70
79
  const new_value = Array.isArray(value) ? files : files[0];
71
- dispatch("change", new_value);
80
+ onchange?.(new_value);
72
81
 
73
82
  dragging_index = null;
74
83
  drop_target_index = null;
@@ -82,14 +91,18 @@
82
91
  return [filename.slice(0, last_dot), filename.slice(last_dot)];
83
92
  }
84
93
 
85
- $: normalized_files = (Array.isArray(value) ? value : [value]).map((file) => {
86
- const [filename_stem, filename_ext] = split_filename(file.orig_name ?? "");
87
- return {
88
- ...file,
89
- filename_stem,
90
- filename_ext
91
- };
92
- });
94
+ let normalized_files = $derived(
95
+ (Array.isArray(value) ? value : [value]).map((file) => {
96
+ const [filename_stem, filename_ext] = split_filename(
97
+ file.orig_name ?? ""
98
+ );
99
+ return {
100
+ ...file,
101
+ filename_stem,
102
+ filename_ext
103
+ };
104
+ })
105
+ );
93
106
 
94
107
  function handle_row_click(
95
108
  event: MouseEvent & { currentTarget: HTMLTableRowElement },
@@ -103,20 +116,21 @@
103
116
  event.composedPath().includes(tr.firstElementChild)); // Or if the click is on the name column
104
117
 
105
118
  if (should_select) {
106
- dispatch("select", { value: normalized_files[index].orig_name, index });
119
+ onselect?.({ value: normalized_files[index].orig_name, index });
107
120
  }
108
121
  }
109
122
 
110
123
  function remove_file(index: number): void {
111
- const removed = normalized_files.splice(index, 1);
112
- normalized_files = [...normalized_files];
113
- value = normalized_files;
114
- dispatch("delete", removed[0]);
115
- dispatch("change", normalized_files);
124
+ const files = Array.isArray(value) ? [...value] : [value];
125
+ const removed = files.splice(index, 1);
126
+ const new_value = Array.isArray(value) ? files : files[0];
127
+ value = new_value;
128
+ ondelete?.(removed[0]);
129
+ onchange?.(new_value);
116
130
  }
117
131
 
118
132
  function handle_download(file: FileData): void {
119
- dispatch("download", file);
133
+ ondownload?.(file);
120
134
  }
121
135
 
122
136
  const is_browser = typeof window !== "undefined";
@@ -147,14 +161,14 @@
147
161
  ? "after"
148
162
  : "before"}
149
163
  draggable={allow_reordering && normalized_files.length > 1}
150
- on:click={(event) => {
164
+ onclick={(event) => {
151
165
  handle_row_click(event, i);
152
166
  }}
153
- on:dragstart={(event) => handle_drag_start(event, i)}
154
- on:dragenter|preventDefault
155
- on:dragover={(event) => handle_drag_over(event, i)}
156
- on:drop={(event) => handle_drop(event, i)}
157
- on:dragend={handle_drag_end}
167
+ ondragstart={(event) => handle_drag_start(event, i)}
168
+ ondragenter={(event) => event.preventDefault()}
169
+ ondragover={(event) => handle_drag_over(event, i)}
170
+ ondrop={(event) => handle_drop(event, i)}
171
+ ondragend={handle_drag_end}
158
172
  >
159
173
  <td class="filename" aria-label={file.orig_name}>
160
174
  {#if allow_reordering && normalized_files.length > 1}
@@ -187,10 +201,10 @@
187
201
  <button
188
202
  class="label-clear-button"
189
203
  aria-label="Remove this file"
190
- on:click={() => {
204
+ onclick={() => {
191
205
  remove_file(i);
192
206
  }}
193
- on:keydown={(event) => {
207
+ onkeydown={(event) => {
194
208
  if (event.key === "Enter") {
195
209
  remove_file(i);
196
210
  }
@@ -1,32 +1,16 @@
1
1
  import type { FileData } from "@gradio/client";
2
2
  import type { I18nFormatter, SelectData } from "@gradio/utils";
3
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
4
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
5
- $$bindings?: Bindings;
6
- } & Exports;
7
- (internal: unknown, props: Props & {
8
- $$events?: Events;
9
- $$slots?: Slots;
10
- }): Exports & {
11
- $set?: any;
12
- $on?: any;
13
- };
14
- z_$$bindings?: Bindings;
15
- }
16
- declare const FilePreview: $$__sveltets_2_IsomorphicComponent<{
3
+ type $$ComponentProps = {
17
4
  value: FileData | FileData[];
18
5
  selectable?: boolean;
19
6
  height?: number | string | undefined;
20
7
  i18n: I18nFormatter;
21
8
  allow_reordering?: boolean;
22
- }, {
23
- dragenter: DragEvent;
24
- select: CustomEvent<SelectData>;
25
- change: CustomEvent<FileData | FileData[]>;
26
- delete: CustomEvent<FileData>;
27
- download: CustomEvent<FileData>;
28
- } & {
29
- [evt: string]: CustomEvent<any>;
30
- }, {}, {}, string>;
31
- type FilePreview = InstanceType<typeof FilePreview>;
9
+ onselect?: (event_data: SelectData) => void;
10
+ onchange?: (event_data: FileData[] | FileData) => void;
11
+ ondelete?: (event_data: FileData) => void;
12
+ ondownload?: (event_data: FileData) => void;
13
+ };
14
+ declare const FilePreview: import("svelte").Component<$$ComponentProps, {}, "">;
15
+ type FilePreview = ReturnType<typeof FilePreview>;
32
16
  export default FilePreview;