Typescript definitions are not included the package
See original GitHub issueIt would be good to include the definitions along with this package.
Right now the following code needs to be included in the VueJS app in order to make the typescript recognise them.
import Vue from 'vue';
declare module 'vue/types/vue' {
export interface VueConstructor<V extends Vue = Vue> {
$log: {
debug(...args: any[]): void;
info(...args: any[]): void;
warn(...args: any[]): void;
error(...args: any[]): void;
fatal(...args: any[]): void;
};
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:21 (8 by maintainers)
Top Results From Across the Web
Type definitions bundled with npm modules are not ... - GitHub
I have a JS project that depends on mobx and other libs that include its own type definitions bundled and properly declared in...
Read more >Documentation - Publishing - TypeScript
Including declarations in your npm package. If your package has a main .js file, you will need to indicate the main declaration file...
Read more >Package type definition cannot be found - Stack Overflow
We are using a global namespace for all files and all the compiled files get concatenated because of the outFile compiler option. No...
Read more >Typescript Typings: The Complete Guide: @types Compiler ...
The @types scope package contains type definitions for a lot of libraries, like Express, Sequelize, JQuery, and many others. So definitively ...
Read more >Type Declarations
If a library you're using is published as an npm package, it may include type declaration files as part of its distribution already....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi everyone, I am still struggling with Typescript import system. However, I found that this code is working for me:
It works with
vuejs-logger@1.5.4
.Im using ts with vue 2.6.14 and
"vuejs-logger": "^1.5.5",
and this works for me. Here is what I have:Hope this helps someone.