This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(events): adds file acceptance hooks & typescript integration (#2)
* feat(typescript): set up TS toolchain and migrate core to typescript * feat(events): added acceptance events `accepted-file`: accept callback returns without error `rejected-file`: accept callback returns error `accept-complete`: accept callback completed * feat(ts-declarations): export TS declarations
- Loading branch information
1 parent
da97d4c
commit 3dad7ec
Showing
24 changed files
with
768 additions
and
716 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export interface IUploadStats { | ||
bytesSent: number; | ||
progress: number; | ||
total: number; | ||
speed: ISpeedStats; | ||
start: number; | ||
end: number; | ||
time: number; | ||
} | ||
export interface ISpeedStats { | ||
kbps: number; | ||
mbps: number; | ||
} | ||
export default class VTransmitFile { | ||
private _nativeFile; | ||
id: string; | ||
accepted: boolean; | ||
lastModified: number; | ||
lastModifiedDate: Date; | ||
name: string; | ||
processing: boolean; | ||
size: number; | ||
status: string; | ||
type: string; | ||
upload: IUploadStats; | ||
webkitRelativePath: USVString; | ||
width: number; | ||
height: number; | ||
xhr: XMLHttpRequest; | ||
dataUrl: string; | ||
errorMessage: string; | ||
constructor(...data: object[]); | ||
set(...data: object[]): VTransmitFile; | ||
copyNativeFile(file: File): VTransmitFile; | ||
copyOwnAndInheritedProps(...data: object[]): VTransmitFile; | ||
handleProgress(e: ProgressEvent): void; | ||
startProgress(): VTransmitFile; | ||
endProgress(): VTransmitFile; | ||
nativeFile: File; | ||
static fromNativeFile(file: File, ...data: any[]): VTransmitFile; | ||
static idFactory(): string; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export declare const assign: { | ||
<T, U>(target: T, source: U): T & U; | ||
<T, U, V>(target: T, source1: U, source2: V): T & U & V; | ||
<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; | ||
(target: object, ...sources: any[]): any; | ||
}; | ||
export declare function uniqueId(prefix: string): string; | ||
export declare function copyOwnAndInheritedProps(obj: object): object; | ||
export declare type Rounding = "round" | "ceil" | "floor" | "trunc"; | ||
export declare function round(number: number, decimals?: number, roundStyle?: Rounding): number; | ||
export declare function fromBytesToKbit(bytes: number): number; | ||
export declare function fromBytesToMbit(bytes: number): number; | ||
export declare function toKbps(bytes: number, seconds: number): number; | ||
export declare function toMbps(bytes: number, seconds: number): number; | ||
export declare const hbsRegex: RegExp; | ||
export declare function hbsReplacer(context?: object): (match: string, capture: string) => any; | ||
export declare enum READY_STATES { | ||
UNSENT = 0, | ||
OPENED = 1, | ||
HEADERS_RECEIVED = 2, | ||
LOADING = 3, | ||
DONE = 4, | ||
} |
Oops, something went wrong.