GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.37k stars 82 forks source link

FileSystemDirectoryHandle does not have proper types #125

Closed Johan-Liebert1 closed 1 year ago

Johan-Liebert1 commented 1 year ago

A lot of properties on FileSystemDirectoryHandle are not added to types.

Defined Types

/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
    readonly kind: "directory";
    getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
    getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
    removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
    resolve(possibleDescendant: FileSystemHandle): Promise<string[] | null>;
}

declare var FileSystemDirectoryHandle: {
    prototype: FileSystemDirectoryHandle;
    new(): FileSystemDirectoryHandle;
};

Not included in types

image

tomayac commented 1 year ago

This library doesn't define types for FileSystemDirectoryHandle, as you can see in index.d.ts. It uses whatever TypeScript already ships with. Maybe updating to the latest version fixes this for you.