Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions @types/interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export interface UploadFile extends File {
uploadTarget: string;
elapsed: number;
elapsedStr: string;
remaining: number;
remainingStr: string;
progress: number;
speed: number;
size: number;
web-padawan marked this conversation as resolved.
Show resolved Hide resolved
totalStr: string;
loaded: number;
loadedStr: string;
status: string;
error: string;
abort?: boolean;
complete?: boolean;
uploading?: boolean;
}

export interface UploadI18n {
dropFiles: {
one: string;
many: string;
};
addFiles: {
one: string;
many: string;
};
cancel: string;
error: {
tooManyFiles: string;
fileIsTooBig: string;
incorrectFileType: string;
};
uploading: {
status: {
connecting: string;
stalled: string;
processing: string;
held: string;
};
remainingTime: {
prefix: string;
unknown: string;
};
error: {
serverUnavailable: string;
unexpectedServerError: string;
forbidden: string;
};
};
units: {
size: string[];
};
web-padawan marked this conversation as resolved.
Show resolved Hide resolved
formatSize?: (bytes: number) => string;
formatTime?: (seconds: number, units: number[]) => string;
}

export type UploadMethod = "POST" | "PUT";
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
],
"dependencies": {
"polymer": "^2.0.0",
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.2.1",
"vaadin-button": "vaadin/vaadin-button#^2.3.0",
"vaadin-progress-bar": "vaadin/vaadin-progress-bar#^1.2.0",
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.6.1",
"vaadin-button": "vaadin/vaadin-button#^2.4.0-alpha1",
"vaadin-progress-bar": "vaadin/vaadin-progress-bar#^1.3.0-alpha1",
"vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.1.0",
"vaadin-material-styles": "vaadin/vaadin-material-styles#^1.1.0",
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.3.0"
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.4.1"
},
"devDependencies": {
"iron-component-page": "^3.0.0",
"iron-test-helpers": "^2.0.0",
"mock-http-request": "abuinitski/MockHttpRequest#npm_fix",
"webcomponentsjs": "^1.0.0",
"web-component-tester": "^6.1.5",
"vaadin-demo-helpers": "vaadin/vaadin-demo-helpers#^3.1.0-alpha1",
"vaadin-demo-helpers": "vaadin/vaadin-demo-helpers#^3.1.0",
"iron-icons": "^2.0.1"
}
}
18 changes: 18 additions & 0 deletions gen-tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"excludeFiles": [
"wct.conf.js",
"index.html",
"src/vaadin-upload-file.js",
"src/vaadin-upload-icons.js",
"demo/**/*",
"test/**/*",
"theme/**/*"
],
"autoImport": {
"./@types/interfaces": [
"UploadFile",
"UploadI18n",
"UploadMethod"
]
}
}
11 changes: 11 additions & 0 deletions magi-p3-post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
files: [
'vaadin-upload.js'
],
from: [
/import '\.\/theme\/lumo\/vaadin-(.+)\.js';/
],
to: [
`import './theme/lumo/vaadin-$1.js';\nexport * from './src/vaadin-$1.js';`
]
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
},
"homepage": "https://vaadin.com/components",
"files": [
"vaadin-*.d.ts",
"vaadin-*.js",
"@types",
"src",
"theme"
],
Expand Down
Loading