@jst_htet/file-picker
Advanced tools
Comparing version 1.0.6 to 1.0.7
export declare const pickFile: (options?: { | ||
multiple: boolean; | ||
}) => Promise<any>; | ||
accept: string; | ||
}) => any; |
@@ -23,3 +23,3 @@ "use strict"; | ||
}; | ||
const pickFile = (options = { multiple: false }) => { | ||
const pickFile = (options = { multiple: false, accept: "" }) => { | ||
return new Promise((resolve, reject) => { | ||
@@ -30,2 +30,5 @@ try { | ||
input.multiple = options.multiple; | ||
if (options.accept) { | ||
input.accept = options.accept; | ||
} | ||
input.click(); | ||
@@ -32,0 +35,0 @@ input.addEventListener("change", (e) => { |
{ | ||
"name": "@jst_htet/file-picker", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,5 +19,6 @@ const readFileAsDataUrl: (f: File) => Promise<string> = (f) => { | ||
export const pickFile: (options?: { multiple: boolean }) => Promise<any> = ( | ||
options = { multiple: false } | ||
) => { | ||
export const pickFile: (options?: { | ||
multiple: boolean; | ||
accept: string; | ||
}) => any = (options = { multiple: false, accept: "" }) => { | ||
return new Promise((resolve, reject) => { | ||
@@ -28,2 +29,5 @@ try { | ||
input.multiple = options.multiple; | ||
if (options.accept) { | ||
input.accept = options.accept; | ||
} | ||
input.click(); | ||
@@ -30,0 +34,0 @@ input.addEventListener("change", (e) => { |
5106
154