UNPKG

@fgv/ts-web-extras

Version:

Browser-compatible utilities and FileTree implementations

115 lines (52 loc) 1.9 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@fgv/ts-web-extras](./ts-web-extras.md) &gt; [FileApiTreeAccessors](./ts-web-extras.fileapitreeaccessors.md) ## FileApiTreeAccessors class Helper class to create FileTree instances from various file sources. Supports File API (FileList) and File System Access API handles. **Signature:** ```typescript export declare class FileApiTreeAccessors<TCT extends string = string> ``` ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [create(initializers, params)](./ts-web-extras.fileapitreeaccessors.create.md) </td><td> `static` </td><td> Create FileTree from various file sources using TreeInitializer array. </td></tr> <tr><td> [extractFileMetadata(file)](./ts-web-extras.fileapitreeaccessors.extractfilemetadata.md) </td><td> `static` </td><td> Extract file metadata from a File. </td></tr> <tr><td> [fromDirectoryUpload(fileList, params)](./ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md) </td><td> `static` </td><td> Create FileTree from directory upload with webkitRelativePath. </td></tr> <tr><td> [fromFileList(fileList, params)](./ts-web-extras.fileapitreeaccessors.fromfilelist.md) </td><td> `static` </td><td> Create FileTree from FileList (e.g., from input\[type="file"\]). </td></tr> <tr><td> [getOriginalFile(fileList, targetPath)](./ts-web-extras.fileapitreeaccessors.getoriginalfile.md) </td><td> `static` </td><td> Get the File object for a specific path from the original FileList. This is useful for accessing the original File API object for operations like getting file metadata, MIME type, etc. </td></tr> </tbody></table>