vaadin / vaadin-upload

The Web Component for uploading multiple files with progress indication. Part of the Vaadin components.
https://vaadin.com/components
Apache License 2.0
90 stars 63 forks source link

feat: prepare for TS defs generation [skip ci] #318

Closed web-padawan closed 4 years ago

web-padawan commented 4 years ago

Fixes #316

Generated TS definitions look like this:

import {PolymerElement} from '@polymer/polymer/polymer-element.js';

import {resetMouseCanceller} from '@polymer/polymer/lib/utils/gestures.js';

import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

import {ElementMixin} from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';

import {html} from '@polymer/polymer/lib/utils/html-tag.js';

declare class UploadElement extends
  ThemableMixin(
  ElementMixin(
  PolymerElement)) {
  nodrop: boolean;
  target: string;
  method: UploadMethod;
  headers: object|null;
  timeout: number;
  files: UploadFile[];
  maxFiles: number;
  readonly maxFilesReached: boolean;
  accept: string;
  maxFileSize: number;
  formDataName: string;
  noAuto: boolean;
  withCredentials: boolean;
  capture: string|null|undefined;
  i18n: UploadI18n;
  ready(): void;
  uploadFiles(files?: UploadFile|UploadFile[]): void;
  _addFile(file: UploadFile): void;
  _removeFile(file: UploadFile): void;
}

declare global {
  interface HTMLElementTagNameMap {
    "vaadin-upload": UploadElement;
  }
}

export {UploadElement};

import {UploadMethod} from '../@types/interfaces';

import {UploadFile} from '../@types/interfaces';

import {UploadI18n} from '../@types/interfaces';