Add TS types support for build (#28)

* build ts types.

* fix default export for lib.
This commit is contained in:
Miroslav Šedivý
2023-04-22 14:23:17 +02:00
committed by GitHub
parent 9f8310fe10
commit 1d076cc20c
5 changed files with 82 additions and 3 deletions

View File

@ -19,6 +19,8 @@ export async function getFilesFromDataTansfer(dataTransfer: DataTransfer): Promi
}
const promises: Array<Promise<any>> = []
// Type 'DataTransferItemList' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
// @ts-ignore
for (const item of dataTransfer.items) {
if ('webkitGetAsEntry' in item) {
promises.push(traverse(item.webkitGetAsEntry()))
@ -29,6 +31,8 @@ export async function getFilesFromDataTansfer(dataTransfer: DataTransfer): Promi
}
if (promises.length === 0) {
// Type 'FileList' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
// @ts-ignore
return [...dataTransfer.files]
}

View File

@ -18,5 +18,4 @@ if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(NekoElements, {})
}
export { Neko }
export default NekoElements
export default Neko