SetupBindings in vue.d.ts should be optional

This issue has been created since 2022-07-29.

Vue version

2.7.8

Link to minimal reproduction

https://stackblitz.com/edit/node-bwjvef?file=src/app.ts

Steps to reproduce

run npx tsc in terminal.

You will get following error:

comp-26/dist/message.d.ts:2:32 - error TS2314: Generic type 'ExtendedVue' requires 6 type argument(s).

  2 export declare const vMessage: import('vue/types/vue').ExtendedVue<
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3   Vue,
    ~~~~~~
... 
  9   Record<never, any>
    ~~~~~~~~~~~~~~~~~~~~
 10 >;
    ~


Found 1 error in comp-26/dist/message.d.ts:2

What is expected?

Pass the type checking.

What is actually happening?

I use a Vue component library with Typescript in my project. The component from the library is built on Vue 2.6.

Vue 2.7 changed the vue.d.ts, the type definition generated by Vue 2.6 is not compatible with 2.7.

message.js

import Vue from 'vue';
export const vMessage = Vue.extend({
  data: {
    message: 'Hello Vue v2.6!',
  },
  template: '<div>{{ message }}</div>',
});

message.d.ts

import Vue from 'vue';
export declare const vMessage: import('vue/types/vue').ExtendedVue<
  Vue,
  {
    message: string;
  },
  unknown,
  unknown,
  Record<never, any>
>;

There are 6 type parameters in Vue 2.7.

vue/types/vue.d.ts

export type ExtendedVue<
  Instance extends Vue,
  Data,
  Methods,
  Computed,
  Props,
  SetupBindings
> = VueConstructor<
  CombinedVueInstance<Instance, Data, Methods, Computed, Props, SetupBindings> &
    Vue
>

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Xeon(R) Gold 5115 CPU @ 2.40GHz
    Memory: 10.14 GB / 15.63 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - /usr/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 8.11.0 - /usr/bin/npm
  npmPackages:
    vue: ^2.7.8 => 2.7.8

Any additional comments?

SetupBindings in vue.d.ts should be optional.

hubvue wrote this answer on 2022-07-29

This is the 3.x version of the repository, I assume you are raising the issue in the 2.x version of the repository. vue2.x

vue-bot wrote this answer on 2022-07-29

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-07
Star Count 199821
Watcher Count 6092
Fork Count 32893
Issue Count 587

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Match on empty string 2 2021-07-02 2022-08-29
Community Recognition 🎉 10 2020-09-08 2022-09-25
[Bug Report] Unable to build from source 8 2021-03-27 2022-08-15
SpotBugs is out of date 0 2022-02-07 2022-10-03
problem about 'python setup.py install' 1 2021-07-07 2022-09-19
samp-sever crashing (Trying to unload RconCommand/ClientCheckResponse fix FS...) 1 2022-04-24 2022-09-26
使用lua脚本MONGO同步报错 0 2021-07-14 2021-12-29
Misleading documentation, Performance losses 3 2022-01-05 2022-09-24
HtmlUnit returns UnexpectedPage when Content-Type header is missing 8 2021-06-11 2022-10-03
l-collapse-item title颜色样式有误 1 2022-06-24 2022-09-15
Add Adjustment input fields cause weird cursor behavior 3 2022-08-15 2022-09-13
optional improvement for event-listener demos in documentation 关于文档里 自定义事件tag demo的(可选)建议 2 2021-01-29 2022-10-05
Issue with startBuild().logs when starting an NPM project 5 2020-08-21 2022-10-05
Sensors widget label 2 2022-02-19 2022-05-11
Why do we need to write the entire config data within update hooks? 5 2018-10-27 2022-08-15
The replay doesn't say how much there is left to execute 0 2021-11-05 2022-08-02
🐞 Bug report: Error opning editor after upgrading to 3.6.0 23 2022-03-23 2022-08-01
Make logging configurable 5 2017-06-10 2022-09-28
Infinite loop at install time, with tracked down reason 5 2022-07-09 2022-09-27
Investigate issues with devices stopping working after hibernate 4 2019-01-30 2022-09-08
Can't connect to "scroll-event" signal 2 2021-06-07 2022-10-02
Symfony RedirectResponse throws Exception for codes other than 301, 302, 303, 307, & 308 2 2022-08-03 2022-09-28
Frida in Browser via WebUSB 2 2022-03-31 2022-08-30
key, val = kv.split('=', maxsplit=1) ValueError: not enough values to unpack (expected 2, got 1) 3 2022-03-27 2022-10-04
chess|move|e2d1|17102 1 2021-10-09 2022-10-06
[v4] | [v2] Cannot go back to the previous screen by gesture in ios where the bottomSheet is overlapping 2 2021-11-12 2022-10-01
TS4023 when extracting types from a styled component 5 2021-10-25 2022-07-23
[BUG] `node_modules/.package-lock.json` contains `lockfileVersion` 2 instead of 3 6 2021-11-02 2022-09-25
tab resets to first tab onclick event 5 2016-01-14 2022-10-06
opt -loop-reroll crashes with Assertion `!LoopControlIV && "Found two loop control only IV"' failed. 0 2022-01-11 2022-08-15
Suboptimal codegen for x86 vector rotate 4 2022-01-11 2022-01-22
ICE on ternary expression of __debugbreak and void. 0 2022-01-11 2022-08-26
[WPL] Cauldron Lord Razarch (11076) SmartAI empty 0 2022-06-25 2022-10-05
Initial draft for Scheme code conventions 2 2021-01-24 2022-09-14
Struggling to understand ChanceMode 5 2022-02-23 2022-10-03
Notifications For Sent Messages 0 2022-08-02 2022-09-26
24hr review doesnt work across timezones 0 2022-08-17 2022-09-27
Publish updates from master 2 2021-08-27 2022-07-25
Gradle Configuration Cache incompatibilities 2 2021-02-03 2022-09-18
Sugerencia/Suggestion 1 2020-12-16 2022-09-15
Use docker hub 1 2020-10-09 2022-01-16
If the issue is off topic, why do you have a banner of it at the top of your website? 1 2020-08-20 2022-07-02
[Raleway] Incorrect glyph for palochka-cyrl (U+04CF) 0 2022-04-16 2022-10-05
[BUG] PipeRPCWrapper 4 2021-12-26 2022-10-06
request help: Use certificates from AWS ACM service when deploying on Amazon EKS 1 2022-09-14 2022-09-26
[Bug]: Rename a distributed hypertable from access node is ok, but data node's hypertable's name is not changed 0 2022-07-05 2022-09-25
Build error in master brave-core 0 2022-03-15 2022-09-08
TS cannot find gen folders on arm64 builds 0 2022-03-15 2022-07-25
Document IDisposable implementation of ICacheEntry 1 2022-02-07 2022-10-05
`[ng test]` Can't debug tests when `-code-coverage` 3 2021-10-25 2022-08-01