5.2.7 • Published 6 months ago
@types/activestorage v5.2.7
Installation
npm install --save @types/activestorage
Summary
This package contains type definitions for ActiveStorage (https://github.com/rails/rails/tree/master/activestorage/app/javascript).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/activestorage.
index.d.ts
// Type definitions for ActiveStorage 5.2
// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascript, http://rubyonrails.org
// Definitions by: Cameron Bothner <https://github.com/cbothner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
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;
}
Additional Details
- Last updated: Fri, 09 Jul 2021 02:32:20 GMT
- Dependencies: none
- Global values:
ActiveStorage
Credits
These definitions were written by Cameron Bothner.