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

No exported TypeScript interface #8

Open
BenJackGill opened this issue May 22, 2023 · 1 comment
Open

No exported TypeScript interface #8

BenJackGill opened this issue May 22, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@BenJackGill
Copy link

BenJackGill commented May 22, 2023

We need an exported TypeScript interface named something like Vue3Autocounter that we can import and use for the TypeScript template ref definition.

Currently there is no exported interface for us to use. Or at least none that I could find.

For example:

<template>
  <vue3autocounter ref='counter' :startAmount='0' :endAmount='2021' :duration='3' '/>
  <button @click='handleClick'>Start counting</button>
</template>

<script setup lang="ts">
// Import everything
import Vue3autocounter from "vue3-autocounter";

// Define the template ref
const counter = ref<Vue3Autocounter | null>(null);

// Call the start method
const handleClick = () => {
  counter.start();
}
</script>

Here I am using Vue3Autocounter in const counter = ref<Vue3Autocounter | null>(null) as an example. But actually that example will not work because Vue3Autocounter was just made up for illustration purposes and was never imported because it doesn't currently exist.

@ps-cristopher
Copy link
Owner

You are right, in the last released version is not possible to have an exported type for the component. I`m working on the next release with no breaking changes and I'll add this as an enhancement in this new version. You can open a PR with the implementation if you need it now, in the meantime.

Thanks, @BenJackGill

@ps-cristopher ps-cristopher self-assigned this Jun 8, 2023
@ps-cristopher ps-cristopher added the enhancement New feature or request label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants