file-selector

  • Version 0.2.4
  • Published
  • 138 kB
  • 1 dependency
  • MIT license

Install

npm i file-selector
yarn add file-selector
pnpm add file-selector

Overview

Convert DataTransfer object to a list of File objects

Index

Functions

Interfaces

Functions

function fromEvent

fromEvent: (evt: Event) => Promise<(FileWithPath | DataTransferItem)[]>;
  • Convert a DragEvent's DataTrasfer object to a list of File objects NOTE: If some of the items are folders, everything will be flattened and placed in the same list but the paths will be kept as a {path} property.

    Parameter evt

Interfaces

interface FileWithPath

interface FileWithPath extends DOMFile {}

    property path

    readonly path?: string;

      Package Files (3)

      Dependencies (1)

      Dev Dependencies (16)

      Peer Dependencies (0)

      No peer dependencies.

      Badge

      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/file-selector.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/file-selector)
      • HTML
        <a href="https://www.jsdocs.io/package/file-selector"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>