Comments (8)
Did you try import Portal from “svelte-portal/src/Portal.svelte”?
from svelte-portal.
I've created a new SvelteKit project and copypasted Portal.svelte
there.
It does the trick, now it includes the type definitions.
You can check my fork, or get it from NPM.
@romkor If you're interested in migrating the project to SvelteKit (as recommended in this tutorial), I'll glagly assist you. If you want to modify your current build process to also produce .d.ts
, that's also fine I guess :)
from svelte-portal.
Nice, that does the trick! I guess there's no problem, then :)
However, you might consider making it work even with import Portal from "svelte-portal"
.
from svelte-portal.
Trick is to keep backward compatibility for javascript users. Maybe it can be good idea just add types definition by hands))
from svelte-portal.
I think that any modern Svelte project can handle the packages generated by SvelteKit. So, personally, I'd consider bumping the major version to 3 and migrating to the new structure. If it breaked anyone's setup, they'd either stay on the last version of svelte-portal, or would be motivated to use an up-to-date version of Svelte in their project.
However, you might feel it differently. If you want to just add the type definitions as a separate file, the Plot.svelte.d.ts
file from my fork might come in handy. I can also make a PR adding the type definitions if you want me to.
from svelte-portal.
PR with Portal.svelte.d.ts
file will be useful.
Thanks!
from svelte-portal.
Sorry for the delay! I've created PR #135.
from svelte-portal.
Thanks, merged!
from svelte-portal.
Related Issues (13)
- Amazing library, thanks! HOT 1
- use portal inside keyed_each block HOT 3
- Cannot read properties of null (reading 'removeChild') HOT 5
- Add class and style attribute to default `div` HOT 1
- Build the package before publishing on npm HOT 4
- Open portal on popup HOT 1
- Element targets assume window context HOT 2
- Conflicts in svelte resolve HOT 5
- Fix warning while using with `vite-plugin-svelte` HOT 2
- Changes in 2.2.1 caused import error when following the old documentation HOT 2
- Check if target is string or DOM node HOT 2
- Update or replace? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-portal.