Skip to content

Commit

Permalink
add minimal types for Svelte components
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Mar 26, 2024
1 parent fdb2645 commit 13ac5e0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 37 deletions.
3 changes: 2 additions & 1 deletion packages/@uppy/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
],
"files": [
"src",
"lib"
"lib",
"typings"
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../typings/index.d.ts"/>
export { default as Dashboard } from './components/Dashboard.svelte'
export { default as DashboardModal } from './components/DashboardModal.svelte'
export { default as DragDrop } from './components/DragDrop.svelte'
Expand Down
44 changes: 8 additions & 36 deletions packages/@uppy/svelte/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"extends": [
"../../../tsconfig.shared.json",
"@tsconfig/svelte/tsconfig.json",
],
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "react-jsx",
"jsxImportSource": "preact",
"emitDeclarationOnly": false,
"noEmit": true,
"paths": {
"@uppy/core": ["../core/src/index.js"],
"@uppy/core/lib/*": ["../core/src/*"],
"@uppy/dashboard": ["../dashboard/src/index.js"],
"@uppy/dashboard/lib/*": ["../dashboard/src/*"],
"@uppy/drag-drop": ["../drag-drop/src/index.js"],
"@uppy/drag-drop/lib/*": ["../drag-drop/src/*"],
"@uppy/progress-bar": ["../progress-bar/src/index.js"],
"@uppy/progress-bar/lib/*": ["../progress-bar/src/*"],
"@uppy/status-bar": ["../status-bar/src/index.js"],
"@uppy/status-bar/lib/*": ["../status-bar/src/*"],
},
"emitDeclarationOnly": true,
"rootDir": "./src",
"outDir": "./lib",
},
"include": ["./package.json", "./src/**/*.*"],
"include": ["./src/**/*.*", "src/**/*.svelte"],
"exclude": ["node_modules/*"],
"references": [
{
"path": "../core/tsconfig.build.json",
},
{
"path": "../dashboard/tsconfig.build.json",
},
{
"path": "../drag-drop/tsconfig.build.json",
},
{
"path": "../progress-bar/tsconfig.build.json",
},
{
"path": "../status-bar/tsconfig.build.json",
},
],
}
5 changes: 5 additions & 0 deletions packages/@uppy/svelte/typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '*.svelte' {
import { SvelteComponent } from 'svelte'

export default class extends SvelteComponent<any> {}
}

0 comments on commit 13ac5e0

Please sign in to comment.