 # = require ./files/input
 # = require ./files/url
 # = require ./files/uploaded
+# = require ./files/group
 
 {
   namespace,

          e.originalEvent.dataTransfer.files
        else
          e.target.files
        new f.EventFile settings, files[0]
      else
        @input settings, e.target
    input: (settings, input) ->
      new f.InputFile settings, input
    url: (settings, url) ->
      # We also accept plain UUIDs here for an internally used shortcut.
      # Typically, you should use the `uploaded` converter for clarity.
      cdn = new RegExp("^#{settings.cdnBase}/#{utils.uuidRegex.source}", 'i')
      if utils.fullUuidRegex.test(url) || cdn.test(url)
        new f.UploadedFile settings, url
      else
        new f.UrlFile settings, url
    uploaded: (settings, uuid) ->
      new f.UploadedFile settings, uuid


namespace 'uploadcare', (ns) ->

  # backwards compatibility
  ns.fileFrom = (type, data, settings) ->
    converters[type](settings, data)[0].promise()

  ns.filesFrom = (type, data, settings = {}) ->
    file.promise() for file in converters[type](settings, data)

  converters =
    event: (settings, e) ->
