All Projects → ktsn → vuetype

ktsn / vuetype

Licence: MIT license
Generate TypeScript declaration files for .vue files

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vuetype

aliyun-dts-subscribe-sdk-java
aliyun-dts-subscribe-sdk-java
Stars: ✭ 18 (-85.12%)
Mutual labels:  dts
vite-plugin-dts
A vite plugin for generating `.d.ts` files.
Stars: ✭ 539 (+345.45%)
Mutual labels:  dts
Definitelytyped
The repository for high quality TypeScript type definitions.
Stars: ✭ 37,066 (+30533.06%)
Mutual labels:  dts
react-dts-generator
Typescript definitions for React components.
Stars: ✭ 18 (-85.12%)
Mutual labels:  dts
python-dts-calibration
A Python package to load raw Distributed Temperature Sensing (DTS) files, perform a calibration, and plot the result.
Stars: ✭ 21 (-82.64%)
Mutual labels:  dts
viewts
Display PCR, DTS, PTS, bitrate, jitter of a mpeg TS.
Stars: ✭ 46 (-61.98%)
Mutual labels:  dts
webgpu-seed
🔺🌱 An example on how to render a hello triangle with WebGPU.
Stars: ✭ 178 (+47.11%)
Mutual labels:  dts
mt762x-wm8960
MT762X WM8960 ALSA SoC machine driver
Stars: ✭ 19 (-84.3%)
Mutual labels:  dts

vuetype

npm version Build Status

Generate TypeScript declaration files for .vue files

Installation

You can use vuetype command after exec one of following commands.

$ npm install --global vuetype # npm
$ yarn global add vuetype # yarn

Usage

Specify the directory that includes your .vue files as the 2nd argument of vuetype command. Note that the .vue files should have TypeScript code (in <script lang="ts"> element).

vuetype src/components

Then .vue.d.ts file corresponding .vue file will be output. So you can import each .vue component with concrete type declaration! This would useful if you would like to unit test your components in TypeScript.

For example, if there is the following component:

<template>
  <div>{{ message }}</div>
</template>

<script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component'

@Component
export default class MyComp extends Vue {
  message = 'Hello'
}
</script>

You will acquire the following declaration file:

import Vue from 'vue';
export default class MyComp extends Vue {
    message: string;
}

Watch mode

You can enable watch mode by adding --watch (shorthand -w) flag. In the watch mode, vuetype watches update of .vue files and generates declaration files when the .vue files are updated.

vuetype --watch src/components

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].