Skip to content

vue-tsc create unexpect declaration file from js #4051

@FoundTheWOUT

Description

@FoundTheWOUT

input

// .js
import { defineComponent } from "vue";

export const Foo = defineComponent({
	props: {
		foo: String
	}
})

output

export const Comp: import('vue').DefineComponent<
  {
    foo: StringConstructor;
  },
  any, // should be unknown
  any, // should be unknown
  {},
  {},
  import('vue').ComponentOptionsMixin,
  import('vue').ComponentOptionsMixin,
  {},
  string,
  import('vue').PublicProps,
  Readonly<
    import('vue').ExtractPropTypes<{
      foo: StringConstructor;
    }>
  >,
  {},
  {}
>;

using any would broke the type infer.
vuejs/core@6aa2256

do we have any craft except migrating to typescript for preventing this, if this is a tsc problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions