Skip to content

Commit

Permalink
add type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
ztplz authored and ry committed Aug 30, 2018
1 parent ceaf822 commit b2cd71d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions js/fetch_types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type ReferrerPolicy =
| "origin-when-cross-origin"
| "unsafe-url";
type BlobPart = BufferSource | Blob | string;
type FormDataEntryValue = File | string;
declare type EventListenerOrEventListenerObject =
| EventListener
| EventListenerObject;
Expand All @@ -42,10 +43,6 @@ interface HTMLFormElement {
// TODO
}

interface FormDataEntryValue {
// TODO
}

interface BlobPropertyBag {
type?: string;
}
Expand Down Expand Up @@ -141,6 +138,20 @@ interface Event {
readonly NONE: number;
}

interface File extends Blob {
readonly lastModified: number;
readonly name: string;
}

declare var File: {
prototype: File;
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
};

interface FilePropertyBag extends BlobPropertyBag {
lastModified?: number;
}

interface ProgressEvent extends Event {
readonly lengthComputable: boolean;
readonly loaded: number;
Expand Down

0 comments on commit b2cd71d

Please sign in to comment.