Skip to content

API reference ​

AnyDrop has two packages. @vedratech/anydrop-core is the headless engine (class AnyDropCore). @vedratech/anydrop-ui adds the drop zone, the folder tree and the mobile layout (class AnyDrop, which extends AnyDropCore). Everything in the core also works in the UI.

Start here ​

PageWhat is in it
OptionsEvery option with type, default and description, grouped: request, chunking, validation, folders, pause and resume, connectivity, UI and texts.
MethodsEvery public method, property and static, with its signature, a description and an example.
EventsEvery event with its arguments, when it fires, and an example.
Error codesThe 18 known error codes, what they mean and whether they are retried.
TypesEvery exported type: files, folders, errors, configuration, transport.

Generated reference ​

The pages below are generated from the TypeScript source and its TSDoc comments each time the site is built, so they always match the code. They list every member with its exact type.

PackageMain pages
@vedratech/anydrop-corePackage index, AnyDropCore, AnyDropCoreOptions, AnyDropEvents, AnyDropFile, FolderNode
@vedratech/anydrop-uiPackage index, AnyDrop, AnyDropUIOptions, AnyDropDict

Conventions ​

  • Options are given to the constructor, and changed later with setOption(name, value).
  • Methods that return a list (getErrors(), getQueuedFiles()) return a copy. getTree() and the FolderNode objects are live: read them, do not change them.
  • on(event, handler) returns a function that removes the handler. destroy() removes everything the instance added.
  • Nothing touches window or document when you import a package, so both are safe to import during server-side rendering.

Released under the MIT License.