browser-nativefs
Advanced tools
Comparing version 0.10.1 to 0.10.2
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
export{fileOpen}from"./file-open.mjs";export{directoryOpen}from"./directory-open.mjs";export{fileSave}from"./file-save.mjs";export{imageToBlob}from"./util/image-to-blob.mjs"; | ||
export{fileOpen}from"./file-open.mjs";export{directoryOpen}from"./directory-open.mjs";export{fileSave}from"./file-save.mjs"; |
@@ -1,38 +0,42 @@ | ||
export function fileOpen(options?: { | ||
/** | ||
* Opens file(s) from disk. | ||
*/ | ||
export function fileOpen<M extends boolean>(options?: { | ||
/** Acceptable MIME types. [] */ | ||
mimeTypes?: string[]; | ||
/** Acceptable file extensions. Defaults to "". */ | ||
extensions?: string[]; | ||
/** Suggested file description. Defaults to "". */ | ||
description?: string; | ||
multiple: true; | ||
}): Promise<File[]>; | ||
/** Allow multiple files to be selected. Defaults to false. */ | ||
multiple?: M; | ||
}): M extends true ? Promise<File[]> : Promise<File>; | ||
export function fileOpen(options?: { | ||
mimeTypes?: string[]; | ||
extensions?: string[]; | ||
/** defaults to "" */ | ||
description?: string; | ||
multiple?: false; | ||
}): Promise<File>; | ||
export interface FileSaveOptions { | ||
mimeTypes: string[]; | ||
extensions: string[]; | ||
multiple: boolean; | ||
/** defaults to "Untitled" */ | ||
fileName?: string; | ||
/** defaults to "" */ | ||
description?: string; | ||
} | ||
/** | ||
* Saves a file to disk. | ||
* @returns Optional file handle to save in place. | ||
*/ | ||
export function fileSave( | ||
/** To-be-saved blob */ | ||
blob: Blob, | ||
options?: FileSaveOptions, | ||
options?: { | ||
/** Suggested file name. Defaults to "Untitled". */ | ||
fileName?: string; | ||
/** Suggested file extensions. Defaults to [""]. */ | ||
extensions?: string[]; | ||
/** Suggested file description. Defaults to "". */ | ||
description?: string; | ||
}, | ||
handle?: FileSystemHandle | null | ||
): Promise<FileSystemHandle>; | ||
export interface DirectoryOpenOptions { | ||
/** | ||
* Opens a directory from disk using the Native File System API. | ||
* @returns Contained files. | ||
*/ | ||
export function directoryOpen(options?: { | ||
/** Whether to recursively get subdirectories. */ | ||
recursive: boolean; | ||
} | ||
}): Promise<File[]>; | ||
export function directoryOpen(options?: DirectoryOpenOptions): Promise<File[]>; | ||
export function imageToBlob(img: HTMLImageElement): Promise<Blob>; | ||
@@ -45,8 +49,8 @@ | ||
export interface FileSystemHandlePermissionDescriptor { | ||
writable: boolean; | ||
fileSystemHandle: FileSystemHandle; | ||
mode: 'read' | 'readWrite'; | ||
} | ||
export interface FileSystemHandle { | ||
readonly isFile: boolean; | ||
readonly isDirectory: boolean; | ||
readonly kind: 'file' | 'directory'; | ||
readonly name: string; | ||
@@ -53,0 +57,0 @@ |
{ | ||
"name": "browser-nativefs", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Native File System API with legacy fallback in the browser.", | ||
@@ -12,3 +12,3 @@ "browser": "dist/index.js", | ||
"clean": "shx rm -rf ./dist", | ||
"build": "npm run clean && shx mkdir ./dist && shx mkdir ./dist/util && shx mkdir ./dist/legacy && shx mkdir ./dist/nativefs && shx mkdir ./dist/nativefs-legacy && bash ./build.sh", | ||
"build": "npm run clean && shx mkdir ./dist && shx mkdir ./dist/legacy && shx mkdir ./dist/nativefs && shx mkdir ./dist/nativefs-legacy && bash ./build.sh", | ||
"prepare": "npm run lint && npm run fix && npm run build", | ||
@@ -56,4 +56,7 @@ "lint": "npx eslint . --ext .js,.mjs --fix --ignore-pattern dist/", | ||
"prettier" | ||
] | ||
], | ||
"rules": { | ||
"valid-jsdoc": "off" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71
24473
18