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

TypeScript Support #229

Open
karaaa006 opened this issue Apr 26, 2024 · 1 comment
Open

TypeScript Support #229

karaaa006 opened this issue Apr 26, 2024 · 1 comment

Comments

@karaaa006
Copy link

Issue Description:
I'm in need of TypeScript typings to use the vue-confetti library in TypeScript projects.

Proposal:
Add TypeScript declaration files (.d.ts) to support TypeScript.

Expected Outcome:
After adding TypeScript declaration files, users will be able to safely use the vue-confetti library in TypeScript projects with autocompletion and type checking.

Additional Information:
The vue-confetti library is highly useful and desirable for many Vue.js developers, but the lack of TypeScript typings may hinder comfortable development with TypeScript. Adding TypeScript declaration files will significantly ease the use of this library in projects built on Vue.js with TypeScript.

@snakysnake
Copy link

snakysnake commented Dec 6, 2024

This is what I use for a nuxt typescript integration

// vue-confetti.d.ts

// If vue-confetti exports types, you can import them directly
// For now, let's assume Confetti type can be inferred from the plugin. 
// If not, you may manually define the methods or use `any` as a fallback.

declare module '#app' {
    interface NuxtApp {
        $confetti: {
            start: (any?: any) => void
            stop: () => void
            update: (options: object) => void
        }
    }
}

// This is important to ensure the module augmentation takes effect
export { }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants