npm.io
2020.8.5 • Published 2 years ago

@types/wicg-entries-api

Licence
MIT
Version
2020.8.5
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/wicg-entries-api

Summary

This package contains type definitions for wicg-entries-api (https://github.com/WICG/entries-api).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wicg-entries-api.

index.d.ts

type ErrorCallback = (err: DOMException) => void;
type FileSystemEntryCallback = (entry: FileSystemEntry) => void;
type FileSystemEntriesCallback = (entries: FileSystemEntry[]) => void;
type FileCallback = (file: File) => void;

interface FileSystemFlags {
    create?: boolean | undefined;
    exclusive?: boolean | undefined;
}

declare global {
    interface FileSystemEntry {
        readonly isFile: boolean;
        readonly isDirectory: boolean;
        readonly name: string;
        readonly fullPath: string;
        readonly filesystem: FileSystem;

        getParent(successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void;
    }

    interface FileSystemDirectoryEntry extends FileSystemEntry {
        createReader(): FileSystemDirectoryReader;
        getFile(
            path?: string,
            options?: FileSystemFlags,
            successCallback?: FileSystemEntryCallback,
            errorCallback?: ErrorCallback,
        ): void;
        getDirectory(
            path?: string,
            options?: FileSystemFlags,
            successCallback?: FileSystemEntryCallback,
            errorCallback?: ErrorCallback,
        ): void;
    }

    interface FileSystemDirectoryReader {
        readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void;
    }

    interface FileSystemFileEntry extends FileSystemEntry {
        file(successCallback: FileCallback, errorCallback?: ErrorCallback): void;
    }

    interface FileSystem {
        readonly name: string;
        readonly root: FileSystemDirectoryEntry;
    }

    interface File {
        readonly webkitRelativePath: string;
    }

    interface HTMLInputElement {
        webkitdirectory: boolean;
        readonly webkitEntries: readonly FileSystemEntry[];
    }

    interface DataTransferItem {
        webkitGetAsEntry(): FileSystemEntry | null;
    }
}

export {};

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: none

Credits

These definitions were written by Henning Kasch, and Ingvar Stepanyan.