@tempots/beatui 0.60.10 → 0.61.0
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/dist/index.cjs.js +4 -4
- package/dist/index.es.js +1896 -1840
- package/dist/types/utils/download.d.ts +24 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Signal } from '@tempots/dom';
|
|
2
|
+
export interface Progress {
|
|
3
|
+
type: 'progress';
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Undetermined {
|
|
7
|
+
type: 'undetermined';
|
|
8
|
+
}
|
|
9
|
+
export interface Done {
|
|
10
|
+
type: 'done';
|
|
11
|
+
file: File;
|
|
12
|
+
}
|
|
13
|
+
export interface DownloadError {
|
|
14
|
+
type: 'error';
|
|
15
|
+
error: Error;
|
|
16
|
+
}
|
|
17
|
+
export type DownloadResult = Progress | Undetermined | Done | DownloadError;
|
|
18
|
+
export declare const downloadUrl: (url: string, filename?: string) => void;
|
|
19
|
+
export declare const downloadContent: (content: string | Uint8Array<ArrayBuffer>, filename: string, type?: string) => void;
|
|
20
|
+
export declare const downloadToFile: (url: string) => {
|
|
21
|
+
signal: Signal<DownloadResult>;
|
|
22
|
+
cancel: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const downloadFile: (file: File) => void;
|