Created
June 22, 2022 11:59
-
-
Save rummelonp/4bc8f5e055dbf1a9f4e1cdb00d84554d to your computer and use it in GitHub Desktop.
@types/activestorage が最新に追従出来てないので雑対応
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '@rails/activestorage' { | |
export function start(): void | |
export class DirectUpload { | |
id: number | |
file: File | |
url: string | |
constructor(file: File, url: string, serviceName: string, attachmentName: string, delegate?: DirectUploadDelegate) | |
create(callback: (error: Error | null, blob: Blob | null) => void): void | |
} | |
export interface DirectUploadDelegate { | |
directUploadWillCreateBlobWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined | |
directUploadWillStoreFileWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined | |
} | |
export interface Blob { | |
filename: string | |
content_type: string | |
byte_size: number | |
checksum: string | |
id: number | |
signed_id: string | |
key: string | |
service_name: string | |
created_at: string | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment