use packaged type declarations
This commit is contained in:
parent
67dc8d30c0
commit
d10c42776a
@ -1,2 +0,0 @@
|
||||
This directory contains TypeScript declaration files that can't be installe via
|
||||
an npm package because they had to be modified.
|
7697
decl/chrome/chrome.d.ts
vendored
7697
decl/chrome/chrome.d.ts
vendored
File diff suppressed because it is too large
Load Diff
548
decl/filesystem/filesystem.d.ts
vendored
548
decl/filesystem/filesystem.d.ts
vendored
@ -1,548 +0,0 @@
|
||||
// Type definitions for File System API
|
||||
// Project: http://www.w3.org/TR/file-system-api/
|
||||
// Definitions by: Kon <http://phyzkit.net/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../filewriter/filewriter.d.ts" />
|
||||
|
||||
interface LocalFileSystem {
|
||||
|
||||
/**
|
||||
* Used for storage with no guarantee of persistence.
|
||||
*/
|
||||
TEMPORARY:number;
|
||||
|
||||
/**
|
||||
* Used for storage that should not be removed by the user agent without application or user permission.
|
||||
*/
|
||||
PERSISTENT:number;
|
||||
|
||||
/**
|
||||
* Requests a filesystem in which to store application data.
|
||||
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
|
||||
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
|
||||
* @param successCallback The callback that is called when the user agent provides a filesystem.
|
||||
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
|
||||
*/
|
||||
requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
|
||||
* @param url A URL referring to a local file in a filesystem accessable via this API.
|
||||
* @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
|
||||
* @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
|
||||
*/
|
||||
resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* see requestFileSystem.
|
||||
*/
|
||||
webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
|
||||
}
|
||||
|
||||
interface LocalFileSystemSync {
|
||||
/**
|
||||
* Used for storage with no guarantee of persistence.
|
||||
*/
|
||||
TEMPORARY:number;
|
||||
|
||||
/**
|
||||
* Used for storage that should not be removed by the user agent without application or user permission.
|
||||
*/
|
||||
PERSISTENT:number;
|
||||
|
||||
/**
|
||||
* Requests a filesystem in which to store application data.
|
||||
* @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
|
||||
* @param size This is an indicator of how much storage space, in bytes, the application expects to need.
|
||||
*/
|
||||
requestFileSystemSync(type:number, size:number):FileSystemSync;
|
||||
|
||||
/**
|
||||
* Allows the user to look up the Entry for a file or directory referred to by a local URL.
|
||||
* @param url A URL referring to a local file in a filesystem accessable via this API.
|
||||
*/
|
||||
resolveLocalFileSystemSyncURL(url:string):EntrySync;
|
||||
|
||||
/**
|
||||
* see requestFileSystemSync
|
||||
*/
|
||||
webkitRequestFileSystemSync(type:number, size:number):FileSystemSync;
|
||||
}
|
||||
|
||||
interface Metadata {
|
||||
/**
|
||||
* This is the time at which the file or directory was last modified.
|
||||
* @readonly
|
||||
*/
|
||||
modificationTime:Date;
|
||||
|
||||
/**
|
||||
* The size of the file, in bytes. This must return 0 for directories.
|
||||
* @readonly
|
||||
*/
|
||||
size:number;
|
||||
}
|
||||
|
||||
interface Flags {
|
||||
/**
|
||||
* Used to indicate that the user wants to create a file or directory if it was not previously there.
|
||||
*/
|
||||
create?:boolean;
|
||||
|
||||
/**
|
||||
* By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
|
||||
*/
|
||||
exclusive?:boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface represents a file system.
|
||||
*/
|
||||
interface FileSystem{
|
||||
/**
|
||||
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
|
||||
* @readonly
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The root directory of the file system.
|
||||
* @readonly
|
||||
*/
|
||||
root: DirectoryEntry;
|
||||
}
|
||||
|
||||
interface Entry {
|
||||
|
||||
/**
|
||||
* Entry is a file.
|
||||
*/
|
||||
isFile:boolean;
|
||||
|
||||
/**
|
||||
* Entry is a directory.
|
||||
*/
|
||||
isDirectory:boolean;
|
||||
|
||||
/**
|
||||
* Look up metadata about this entry.
|
||||
* @param successCallback A callback that is called with the time of the last modification.
|
||||
* @param errorCallback ErrorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* The name of the entry, excluding the path leading to it.
|
||||
*/
|
||||
name:string;
|
||||
|
||||
/**
|
||||
* The full absolute path from the root to the entry.
|
||||
*/
|
||||
fullPath:string;
|
||||
|
||||
/**
|
||||
* The file system on which the entry resides.
|
||||
*/
|
||||
filesystem:FileSystem;
|
||||
|
||||
/**
|
||||
* Move an entry to a different location on the file system. It is an error to try to:
|
||||
*
|
||||
* <ui>
|
||||
* <li>move a directory inside itself or to any child at any depth;</li>
|
||||
* <li>move an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
* <li>move a file to a path occupied by a directory;</li>
|
||||
* <li>move a directory to a path occupied by a file;</li>
|
||||
* <li>move any element to a path occupied by a directory which is not empty.</li>
|
||||
* <ul>
|
||||
*
|
||||
* A move of a file on top of an existing file must attempt to delete and replace that file.
|
||||
* A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
*/
|
||||
moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
|
||||
|
||||
/**
|
||||
* Copy an entry to a different location on the file system. It is an error to try to:
|
||||
*
|
||||
* <ul>
|
||||
* <li> copy a directory inside itself or to any child at any depth;</li>
|
||||
* <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
* <li> copy a file to a path occupied by a directory;</li>
|
||||
* <li> copy a directory to a path occupied by a file;</li>
|
||||
* <li> copy any element to a path occupied by a directory which is not empty.</li>
|
||||
* <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li>
|
||||
* <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li>
|
||||
* </ul>
|
||||
*
|
||||
* Directory copies are always recursive--that is, they copy all contents of the directory.
|
||||
*/
|
||||
copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
|
||||
|
||||
/**
|
||||
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
|
||||
*/
|
||||
toURL():string;
|
||||
|
||||
/**
|
||||
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
||||
* @param successCallback A callback that is called on success.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
|
||||
* @param successCallback A callback that is called to return the parent Entry.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface represents a directory on a file system.
|
||||
*/
|
||||
interface DirectoryEntry extends Entry {
|
||||
/**
|
||||
* Creates a new DirectoryReader to read Entries from this Directory.
|
||||
*/
|
||||
createReader():DirectoryReader;
|
||||
|
||||
/**
|
||||
* Creates or looks up a file.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
|
||||
* <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
|
||||
* <li>If create is not true and the path doesn't exist, getFile must fail.</li>
|
||||
* <li>If create is not true and the path exists, but is a directory, getFile must fail.</li>
|
||||
* <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>
|
||||
* </ul>
|
||||
* @param successCallback A callback that is called to return the File selected or created.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
|
||||
* <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
|
||||
* <li>If create is not true and the path doesn't exist, getDirectory must fail.</li>
|
||||
* <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li>
|
||||
* <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li>
|
||||
* </ul>
|
||||
* @param successCallback A callback that is called to return the DirectoryEntry selected or created.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*
|
||||
*/
|
||||
getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
|
||||
* @param successCallback A callback that is called on success.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
|
||||
* <ul>
|
||||
* <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
|
||||
* <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
|
||||
* <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
|
||||
* <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
|
||||
* </ul>
|
||||
*/
|
||||
interface DirectoryReader {
|
||||
/**
|
||||
* Read the next block of entries from this directory.
|
||||
* @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
|
||||
* @param errorCallback A callback indicating that there was an error reading from the Directory.
|
||||
*/
|
||||
readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface represents a file on a file system.
|
||||
*/
|
||||
interface FileEntry extends Entry {
|
||||
/**
|
||||
* Creates a new FileWriter associated with the file that this FileEntry represents.
|
||||
* @param successCallback A callback that is called with the new FileWriter.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void;
|
||||
|
||||
/**
|
||||
* Returns a File that represents the current state of the file that this FileEntry represents.
|
||||
* @param successCallback A callback that is called with the File.
|
||||
* @param errorCallback A callback that is called when errors happen.
|
||||
*/
|
||||
file(successCallback:FileCallback, errorCallback?:ErrorCallback):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* When requestFileSystem() succeeds, the following callback is made.
|
||||
*/
|
||||
interface FileSystemCallback {
|
||||
/**
|
||||
* @param filesystem The file systems to which the app is granted access.
|
||||
*/
|
||||
(filesystem:FileSystem):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to look up Entry objects.
|
||||
*/
|
||||
interface EntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:Entry):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to look up FileEntry objects.
|
||||
*/
|
||||
interface FileEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:FileEntry):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to look up DirectoryEntry objects.
|
||||
*/
|
||||
interface DirectoryEntryCallback {
|
||||
/**
|
||||
* @param entry
|
||||
*/
|
||||
(entry:DirectoryEntry):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* When readEntries() succeeds, the following callback is made.
|
||||
*/
|
||||
interface EntriesCallback {
|
||||
(entries:Entry[]):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to look up file and directory metadata.
|
||||
*/
|
||||
interface MetadataCallback {
|
||||
(metadata:Metadata):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to create a FileWriter.
|
||||
*/
|
||||
interface FileWriterCallback {
|
||||
(fileWriter:FileWriter):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the callback used to obtain a File.
|
||||
*/
|
||||
interface FileCallback {
|
||||
(file:File):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface is the generic callback used to indicate success of an asynchronous method.
|
||||
*/
|
||||
interface VoidCallback {
|
||||
():void;
|
||||
}
|
||||
|
||||
/**
|
||||
* When an error occurs, the following callback is made.
|
||||
*/
|
||||
interface ErrorCallback {
|
||||
(err:DOMError):void;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This interface represents a file system.
|
||||
*/
|
||||
interface FileSystemSync {
|
||||
/**
|
||||
* This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
|
||||
*/
|
||||
name:string;
|
||||
|
||||
/**
|
||||
* root The root directory of the file system.
|
||||
*/
|
||||
root:DirectoryEntrySync;
|
||||
}
|
||||
|
||||
/**
|
||||
* An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
|
||||
*/
|
||||
interface EntrySync{
|
||||
/**
|
||||
* EntrySync is a file.
|
||||
* @readonly
|
||||
*/
|
||||
isFile:boolean;
|
||||
|
||||
/**
|
||||
* EntrySync is a directory.
|
||||
* @readonly
|
||||
*/
|
||||
isDirectory:boolean;
|
||||
|
||||
/**
|
||||
* Look up metadata about this entry.
|
||||
*/
|
||||
getMetadata():Metadata;
|
||||
|
||||
/**
|
||||
* The name of the entry, excluding the path leading to it.
|
||||
*/
|
||||
name:string;
|
||||
|
||||
/**
|
||||
* The full absolute path from the root to the entry.
|
||||
*/
|
||||
fullPath:string;
|
||||
|
||||
/**
|
||||
* The file system on which the entry resides.
|
||||
*/
|
||||
filesystem:FileSystemSync;
|
||||
|
||||
/**
|
||||
* Move an entry to a different location on the file system. It is an error to try to:
|
||||
* <ul>
|
||||
* <li> move a directory inside itself or to any child at any depth;</li>
|
||||
* <li> move an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
* <li> move a file to a path occupied by a directory;</li>
|
||||
* <li> move a directory to a path occupied by a file;</li>
|
||||
* <li> move any element to a path occupied by a directory which is not empty.</li>
|
||||
* </ui>
|
||||
* A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
* @param parent The directory to which to move the entry.
|
||||
* @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
|
||||
*/
|
||||
moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
|
||||
|
||||
/**
|
||||
* Copy an entry to a different location on the file system. It is an error to try to:
|
||||
* <ul>
|
||||
* <li> copy a directory inside itself or to any child at any depth;</li>
|
||||
* <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
|
||||
* <li> copy a file to a path occupied by a directory;</li>
|
||||
* <li> copy a directory to a path occupied by a file;</li>
|
||||
* <li> copy any element to a path occupied by a directory which is not empty.</li>
|
||||
* </ui>
|
||||
* A copy of a file on top of an existing file must attempt to delete and replace that file.
|
||||
* A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
|
||||
* Directory copies are always recursive--that is, they copy all contents of the directory.
|
||||
*/
|
||||
copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
|
||||
|
||||
/**
|
||||
* Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
|
||||
*/
|
||||
toURL():string;
|
||||
|
||||
/**
|
||||
* Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
|
||||
*/
|
||||
remove ():void;
|
||||
|
||||
/**
|
||||
* Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
|
||||
*/
|
||||
getParent():DirectoryEntrySync;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface represents a directory on a file system.
|
||||
*/
|
||||
interface DirectoryEntrySync extends EntrySync {
|
||||
/**
|
||||
* Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
|
||||
*/
|
||||
createReader():DirectoryReaderSync;
|
||||
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
|
||||
* <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
|
||||
* <li> If create is not true and the path doesn't exist, getFile must fail.</li>
|
||||
* <li> If create is not true and the path exists, but is a directory, getFile must fail.</li>
|
||||
* <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
|
||||
* </ul>
|
||||
*/
|
||||
getFile(path:string, options?:Flags):FileEntrySync;
|
||||
|
||||
/**
|
||||
* Creates or looks up a directory.
|
||||
* @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
|
||||
* @param options
|
||||
* <ul>
|
||||
* <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
|
||||
* <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
|
||||
* <li> If create is not true and the path doesn't exist, getDirectory must fail.</li>
|
||||
* <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li>
|
||||
* <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
|
||||
* </ul>
|
||||
*/
|
||||
getDirectory(path:string, options?:Flags):DirectoryEntrySync;
|
||||
|
||||
/**
|
||||
* Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
|
||||
*/
|
||||
removeRecursively():void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
|
||||
* <ul>
|
||||
* <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
|
||||
* <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
|
||||
* <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
|
||||
* <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
|
||||
* </ul>
|
||||
*/
|
||||
interface DirectoryReaderSync {
|
||||
/**
|
||||
* Read the next block of entries from this directory.
|
||||
*/
|
||||
readEntries():EntrySync[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface represents a file on a file system.
|
||||
*/
|
||||
interface FileEntrySync extends EntrySync {
|
||||
/**
|
||||
* Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
|
||||
*/
|
||||
createWriter():FileWriterSync;
|
||||
|
||||
/**
|
||||
* Returns a File that represents the current state of the file that this FileEntrySync represents.
|
||||
*/
|
||||
file():File;
|
||||
}
|
||||
|
||||
interface Window extends LocalFileSystem, LocalFileSystemSync{
|
||||
}
|
||||
|
||||
interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{
|
||||
}
|
176
decl/filewriter/filewriter.d.ts
vendored
176
decl/filewriter/filewriter.d.ts
vendored
@ -1,176 +0,0 @@
|
||||
// Type definitions for File API: Writer
|
||||
// Project: http://www.w3.org/TR/file-writer-api/
|
||||
// Definitions by: Kon <http://phyzkit.net/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes.
|
||||
* This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]).
|
||||
*/
|
||||
interface FileSaver extends EventTarget {
|
||||
/**
|
||||
* When the abort method is called, user agents must run the steps below:
|
||||
* <ol>
|
||||
* <li> If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else. </li>
|
||||
* <li> Set readyState to DONE. </li>
|
||||
* <li> If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks. </li>
|
||||
* <li> Terminate the write algorithm being processed. </li>
|
||||
* <li> Set the error attribute to a DOMError object of type "AbortError". </li>
|
||||
* <li> Fire a progress event called abort </li>
|
||||
* <li> Fire a progress event called writeend </li>
|
||||
* <li> Terminate this algorithm. </li>
|
||||
* </ol>
|
||||
*/
|
||||
abort():void;
|
||||
|
||||
/**
|
||||
* The blob is being written.
|
||||
* @readonly
|
||||
*/
|
||||
INIT:number;
|
||||
|
||||
/**
|
||||
* The object has been constructed, but there is no pending write.
|
||||
* @readonly
|
||||
*/
|
||||
WRITING:number;
|
||||
|
||||
/**
|
||||
* The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob.
|
||||
* @readonly
|
||||
*/
|
||||
DONE:number;
|
||||
|
||||
/**
|
||||
* The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values:
|
||||
* <ul>
|
||||
* <li>INIT</li>
|
||||
* <li>WRITING</li>
|
||||
* <li>DONE</li>
|
||||
* <ul>
|
||||
* @readonly
|
||||
*/
|
||||
readyState:number;
|
||||
|
||||
/**
|
||||
* The last error that occurred on the FileSaver.
|
||||
* @readonly
|
||||
*/
|
||||
error:DOMError;
|
||||
|
||||
/**
|
||||
* Handler for writestart events
|
||||
*/
|
||||
onwritestart:Function;
|
||||
|
||||
/**
|
||||
* Handler for progress events.
|
||||
*/
|
||||
onprogress:Function;
|
||||
|
||||
/**
|
||||
* Handler for write events.
|
||||
*/
|
||||
onwrite:Function;
|
||||
|
||||
/**
|
||||
* Handler for abort events.
|
||||
*/
|
||||
onabort:Function;
|
||||
|
||||
/**
|
||||
* Handler for error events.
|
||||
*/
|
||||
onerror:Function;
|
||||
|
||||
/**
|
||||
* Handler for writeend events.
|
||||
*/
|
||||
onwriteend:Function;
|
||||
}
|
||||
|
||||
declare var FileSaver: {
|
||||
/**
|
||||
* When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
|
||||
* This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerUtils interface.
|
||||
*/
|
||||
new(data:Blob): FileSaver;
|
||||
};
|
||||
|
||||
/**
|
||||
* This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.
|
||||
*/
|
||||
interface FileWriter extends FileSaver {
|
||||
/**
|
||||
* The byte offset at which the next write to the file will occur. This must be no greater than length.
|
||||
* A newly-created FileWriter must have position set to 0.
|
||||
*/
|
||||
position:number;
|
||||
|
||||
/**
|
||||
* The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
|
||||
*/
|
||||
length:number;
|
||||
|
||||
/**
|
||||
* Write the supplied data to the file at position.
|
||||
* @param data The blob to write.
|
||||
*/
|
||||
write(data:Blob):void;
|
||||
|
||||
/**
|
||||
* Seek sets the file position at which the next write will occur.
|
||||
* @param offset If nonnegative, an absolute byte offset into the file. If negative, an offset back from the end of the file.
|
||||
*/
|
||||
seek(offset:number):void;
|
||||
|
||||
/**
|
||||
* Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
|
||||
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
|
||||
*/
|
||||
truncate(size:number):void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface lets users write, truncate, and append to files using simple synchronous calls.
|
||||
* This interface is specified to be used only within Web Workers (WorkerUtils [WEBWORKERS]).
|
||||
*/
|
||||
interface FileWriterSync {
|
||||
/**
|
||||
* The byte offset at which the next write to the file will occur. This must be no greater than length.
|
||||
*/
|
||||
position:number;
|
||||
|
||||
/**
|
||||
* The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
|
||||
*/
|
||||
length:number;
|
||||
|
||||
/**
|
||||
* Write the supplied data to the file at position. Upon completion, position will increase by data.size.
|
||||
* @param data The blob to write.
|
||||
*/
|
||||
write(data:Blob):void;
|
||||
|
||||
/**
|
||||
* Seek sets the file position at which the next write will occur.
|
||||
* @param offset An absolute byte offset into the file. If offset is greater than length, length is used instead. If offset is less than zero, length is added to it, so that it is treated as an offset back from the end of the file. If it is still less than zero, zero is used.
|
||||
*/
|
||||
seek(offset:number):void;
|
||||
|
||||
/**
|
||||
* Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
|
||||
* Upon successful completion:
|
||||
* <ul>
|
||||
* <li>length must be equal to size.</li>
|
||||
* <li>position must be the lesser of
|
||||
* <ul>
|
||||
* <li>its pre-truncate value,</li>
|
||||
* <li>size.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
* @param size The size to which the length of the file is to be adjusted, measured in bytes.
|
||||
*/
|
||||
truncate(size:number):void;
|
||||
}
|
18
decl/jed.d.ts
vendored
18
decl/jed.d.ts
vendored
@ -1,18 +0,0 @@
|
||||
|
||||
interface JedInstance {
|
||||
translate: any;
|
||||
ngettext: any;
|
||||
}
|
||||
|
||||
interface JedConstructor {
|
||||
new(s: any): JedInstance;
|
||||
}
|
||||
|
||||
declare namespace JedLib {
|
||||
const Jed: JedConstructor;
|
||||
}
|
||||
|
||||
declare module "jed" {
|
||||
export = JedLib;
|
||||
}
|
||||
|
227
decl/urijs.d.ts
vendored
227
decl/urijs.d.ts
vendored
@ -1,227 +0,0 @@
|
||||
// Type definitions for URI.js 1.15.1
|
||||
// Project: https://github.com/medialize/URI.js
|
||||
// Definitions by: RodneyJT <https://github.com/RodneyJT>, Brian Surowiec <https://github.com/xt0rted>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Modified by Florian Dold <dold@taler.net>
|
||||
|
||||
declare module "urijs" {
|
||||
interface URIOptions {
|
||||
protocol?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
path?: string;
|
||||
query?: string;
|
||||
fragment?: string;
|
||||
}
|
||||
|
||||
class URI {
|
||||
public constructor();
|
||||
public constructor (value: string | URIOptions | HTMLElement);
|
||||
|
||||
static addQuery(data: Object, prop: string, value: string): Object;
|
||||
static addQuery(data: Object, qryObj: Object): Object;
|
||||
|
||||
static build(parts: {
|
||||
protocol: string;
|
||||
username: string;
|
||||
password: string;
|
||||
hostname: string;
|
||||
port: string;
|
||||
path: string;
|
||||
query: string;
|
||||
fragment: string;
|
||||
}): string;
|
||||
static buildAuthority(parts: {
|
||||
username?: string;
|
||||
password?: string;
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
}): string;
|
||||
static buildHost(parts: {
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
}): string;
|
||||
static buildQuery(qry: Object): string;
|
||||
static buildQuery(qry: Object, duplicates: boolean): string;
|
||||
static buildUserinfo(parts: {
|
||||
username?: string;
|
||||
password?: string;
|
||||
}): string;
|
||||
|
||||
static commonPath(path1: string, path2: string): string;
|
||||
|
||||
static decode(str: string): string;
|
||||
static decodeQuery(qry: string): string;
|
||||
|
||||
static encode(str: string): string;
|
||||
static encodeQuery(qry: string): string;
|
||||
static encodeReserved(str: string): string;
|
||||
static expand(template: string, vals: Object): URI;
|
||||
|
||||
static iso8859(): void;
|
||||
|
||||
static joinPaths(...paths: (string | URI)[]): URI;
|
||||
|
||||
static parse(url: string): {
|
||||
protocol: string;
|
||||
username: string;
|
||||
password: string;
|
||||
hostname: string;
|
||||
port: string;
|
||||
path: string;
|
||||
query: string;
|
||||
fragment: string;
|
||||
};
|
||||
static parseAuthority(url: string, parts: {
|
||||
username?: string;
|
||||
password?: string;
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
}): string;
|
||||
static parseHost(url: string, parts: {
|
||||
hostname?: string;
|
||||
port?: string;
|
||||
}): string;
|
||||
static parseQuery(url: string): Object;
|
||||
static parseUserinfo(url: string, parts: {
|
||||
username?: string;
|
||||
password?: string;
|
||||
}): string;
|
||||
|
||||
static removeQuery(data: Object, prop: string, value: string): Object;
|
||||
static removeQuery(data: Object, props: string[]): Object;
|
||||
static removeQuery(data: Object, props: Object): Object;
|
||||
|
||||
static unicode(): void;
|
||||
|
||||
static withinString(source: string, func: (url: string) => string): string;
|
||||
|
||||
absoluteTo(path: string): URI;
|
||||
absoluteTo(path: URI): URI;
|
||||
addFragment(fragment: string): URI;
|
||||
addQuery(qry: string): URI;
|
||||
addQuery(qry: Object): URI;
|
||||
addSearch(qry: string): URI;
|
||||
addSearch(key: string, value:any): URI;
|
||||
addSearch(qry: Object): URI;
|
||||
authority(): string;
|
||||
authority(authority: string): URI;
|
||||
|
||||
clone(): URI;
|
||||
|
||||
directory(): string;
|
||||
directory(dir: boolean): string;
|
||||
directory(dir: string): URI;
|
||||
domain(): string;
|
||||
domain(domain: boolean): string;
|
||||
domain(domain: string): URI;
|
||||
|
||||
duplicateQueryParameters(val: boolean): URI;
|
||||
|
||||
equals(): boolean;
|
||||
equals(url: string | URI): boolean;
|
||||
|
||||
filename(): string;
|
||||
filename(file: boolean): string;
|
||||
filename(file: string): URI;
|
||||
fragment(): string;
|
||||
fragment(fragment: string): URI;
|
||||
fragmentPrefix(prefix: string): URI;
|
||||
|
||||
hash(): string;
|
||||
hash(hash: string): URI;
|
||||
host(): string;
|
||||
host(host: string): URI;
|
||||
hostname(): string;
|
||||
hostname(hostname: string): URI;
|
||||
href(): string;
|
||||
href(url: string): void;
|
||||
|
||||
is(qry: string): boolean;
|
||||
iso8859(): URI;
|
||||
|
||||
normalize(): URI;
|
||||
normalizeFragment(): URI;
|
||||
normalizeHash(): URI;
|
||||
normalizeHostname(): URI;
|
||||
normalizePath(): URI;
|
||||
normalizePathname(): URI;
|
||||
normalizePort(): URI;
|
||||
normalizeProtocol(): URI;
|
||||
normalizeQuery(): URI;
|
||||
normalizeSearch(): URI;
|
||||
|
||||
origin(): string;
|
||||
origin(uri: string | URI): URI;
|
||||
|
||||
password(): string;
|
||||
password(pw: string): URI;
|
||||
path(): string;
|
||||
path(path: boolean): string;
|
||||
path(path: string): URI;
|
||||
pathname(): string;
|
||||
pathname(path: boolean): string;
|
||||
pathname(path: string): URI;
|
||||
port(): string;
|
||||
port(port: string): URI;
|
||||
protocol(): string;
|
||||
protocol(protocol: string): URI;
|
||||
|
||||
query(): string;
|
||||
query(qry: string): URI;
|
||||
query(qry: boolean): Object;
|
||||
query(qry: Object): URI;
|
||||
|
||||
readable(): string;
|
||||
relativeTo(path: string): URI;
|
||||
removeQuery(qry: string): URI;
|
||||
removeQuery(qry: Object): URI;
|
||||
removeSearch(qry: string): URI;
|
||||
removeSearch(qry: Object): URI;
|
||||
resource(): string;
|
||||
resource(resource: string): URI;
|
||||
|
||||
scheme(): string;
|
||||
scheme(protocol: string): URI;
|
||||
search(): string;
|
||||
search(qry: string): URI;
|
||||
search(qry: boolean): any;
|
||||
search(qry: Object): URI;
|
||||
segment(): string[];
|
||||
segment(segments: string[]): URI;
|
||||
segment(position: number): string;
|
||||
segment(position: number, level: string): URI;
|
||||
segment(segment: string): URI;
|
||||
segmentCoded(): string[];
|
||||
segmentCoded(segments: string[]): URI;
|
||||
segmentCoded(position: number): string;
|
||||
segmentCoded(position: number, level: string): URI;
|
||||
segmentCoded(segment: string): URI;
|
||||
setQuery(key: string, value: string): URI;
|
||||
setQuery(qry: Object): URI;
|
||||
setSearch(key: string, value: string): URI;
|
||||
setSearch(qry: Object): URI;
|
||||
hasQuery(name: string | any, value?: string | number | boolean | Function | Array<string> | Array<number> | Array<boolean> | RegExp, withinArray?: boolean): boolean;
|
||||
hasSearch(name: string | any, value?: string | number | boolean | Function | Array<string> | Array<number> | Array<boolean> | RegExp, withinArray?: boolean): boolean;
|
||||
subdomain(): string;
|
||||
subdomain(subdomain: string): URI;
|
||||
suffix(): string;
|
||||
suffix(suffix: boolean): string;
|
||||
suffix(suffix: string): URI;
|
||||
|
||||
tld(): string;
|
||||
tld(tld: boolean): string;
|
||||
tld(tld: string): URI;
|
||||
|
||||
unicode(): URI;
|
||||
userinfo(): string;
|
||||
userinfo(userinfo: string): URI;
|
||||
username(): string;
|
||||
username(uname: string): URI;
|
||||
|
||||
valueOf(): string;
|
||||
}
|
||||
export = URI;
|
||||
}
|
10
gulpfile.js
10
gulpfile.js
@ -52,11 +52,6 @@ const paths = {
|
||||
"src/**/*.{ts,tsx,js}",
|
||||
"!src/**/*-test*.ts",
|
||||
],
|
||||
decl: [
|
||||
"decl/jed.d.ts",
|
||||
"decl/chrome/chrome.d.ts",
|
||||
"decl/urijs.d.ts",
|
||||
],
|
||||
test: [
|
||||
"src/**/*-test*.ts",
|
||||
],
|
||||
@ -78,7 +73,6 @@ const paths = {
|
||||
"Makefile",
|
||||
"README",
|
||||
"configure",
|
||||
"decl/**/*.d.ts",
|
||||
"gulpfile.js",
|
||||
"manifest.json",
|
||||
"package.json",
|
||||
@ -223,7 +217,6 @@ function srcdist() {
|
||||
// We can't just concat patterns due to exclude patterns
|
||||
const files = concatStreams(
|
||||
gulp.src(paths.ts.src, opts),
|
||||
gulp.src(paths.ts.decl, opts),
|
||||
gulp.src(paths.ts.test, opts),
|
||||
gulp.src(paths.dist, opts),
|
||||
gulp.src(paths.extra, opts));
|
||||
@ -341,8 +334,7 @@ function tsconfig() {
|
||||
let opts = {base: "."};
|
||||
const files = concatStreams(
|
||||
vfs.src(paths.ts.src, opts),
|
||||
vfs.src(paths.ts.test, opts),
|
||||
vfs.src(paths.ts.decl, opts));
|
||||
vfs.src(paths.ts.test, opts));
|
||||
return files.pipe(genTSConfig(tsBaseArgs))
|
||||
.pipe(gulp.dest("."));
|
||||
}
|
||||
|
@ -46,9 +46,11 @@
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/chrome": "^0.0.88",
|
||||
"@types/urijs": "^1.19.3",
|
||||
"axios": "^0.19.0",
|
||||
"commander": "^2.20.0",
|
||||
"idb-bridge": "0.0.2",
|
||||
"idb-bridge": "0.0.3",
|
||||
"source-map-support": "^0.5.12",
|
||||
"urijs": "^1.18.10"
|
||||
}
|
||||
|
@ -23,7 +23,9 @@
|
||||
*/
|
||||
import {strings} from "./i18n/strings";
|
||||
|
||||
// @ts-ignore: no type decl for this library
|
||||
import * as jedLib from "jed";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user