Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.4k stars 137 forks source link

TS definition errors since 8.5.0 #854

Closed julientechdev closed 2 months ago

julientechdev commented 2 months ago

Describe the bug After updating the lib from 8.4.0 to 8.5.0 (and 8.5.1), we have TS errors on build

To Reproduce Steps to reproduce the behavior: Update a project using the lib to 8.5.0 or 8.5.1, with skipLibCheck set to false in tsconfig so that it checks against libs.

Expected behavior Should build fine like in 8.4.0

Here are the build errors: ` > vue-tsc --noEmit && vite build --emptyOutDir

  ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:372:41 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.

  372     selectDate?: (day: { value: Date }, isNext: boolean = false) => {};
                                              ~~~~~~~~~~~~~~~~~~~~~~~

  ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:373:68 - error TS2304: Cannot find name 'boolea'.

  373     presetDate?: (value: Date[] | string[] | Date | string, noTz?: boolea) => void;
                                                                         ~~~~~~

  ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:425:51 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.

  425         handleMonthYearChange?: (isNext: boolean, fromNav = false) => void;
                                                        ~~~~~~~~~~~~~~~

  ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:432:48 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.

  432         updateTime: (value: number | number[], isHours = true, isSeconds = false) => void;
                                                     ~~~~~~~~~~~~~~

  ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:432:64 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.

  432         updateTime: (value: number | number[], isHours = true, isSeconds = false) => void;
                                                                     ~~~~~~~~~~~~~~~~~

  Found 5 errors in the same file, starting at: ../../node_modules/.pnpm/@vuepic+vue-datepicker@8.5.1_vue@3.4.26/node_modules/@vuepic/vue-datepicker/index.d.ts:372`

Environment: macOS 14.4.1 node 20.12.2 pnpm 8.15.8 typescript 5.4.5