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

improve tsx support #1168

Merged
merged 6 commits into from
Apr 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import Vue, { VNode } from 'vue'

declare module '*.vue' {
import Vue from 'vue';
export default Vue;
export default Vue
}

declare global {
namespace JSX {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, JSX declaration should be included in core lib’s declaration.
I remember @blake-newman was working on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but it's not available right now.
Maybe we could use this until core lib's declaration released

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently using this as a stop gap: https://github.com/wonderful-panda/vue-tsx-support (Some of the typing is wrong)

May be worth bringing some of this in, i think with some planning we should be able to get it all via types with no need for an API.

// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
[elem: string]: any
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts"
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
Expand Down