forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
32 lines (24 loc) · 981 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Type definitions for @rails/activestorage 7.0
// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascript, http://rubyonrails.org/
// Definitions by: Ilgiz Mustafin <https://github.com/imustafin>, Cameron Bothner <https://github.com/cbothner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace ActiveStorage;
export function start(): void;
export class DirectUpload {
id: number;
file: File;
url: string;
constructor(file: File, url: string, delegate?: DirectUploadDelegate)
create(callback: (error: Error, blob: Blob) => void): void;
}
export interface DirectUploadDelegate {
directUploadWillCreateBlobWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined;
directUploadWillStoreFileWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined;
}
export interface Blob {
byte_size: number;
checksum: string;
content_type: string;
filename: string;
signed_id: string;
}