Skip to content

$route and $router type declarations seem to be missing in distributed declaration file #419

@AjaiKN

Description

@AjaiKN

Version

4.0.0-beta.6

Reproduction link

https://github.com/aurelius333/vue-router-next-typing-repro

Steps to reproduce

Open src/views/index.vue and look for typing errors.

What is expected?

Should be typed correctly

What is actually happening?

Error message:

Property '$route' does not exist on type 'ComponentPublicInstance<{}, {}, {}, { theRoutePath(): string; }, {}, Record<string, any>, Readonly<{}>, ComponentOptionsBase<{}, {}, {}, { theRoutePath(): string; }, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<...>, string>>'.

It looks like the types appear here: https://github.com/vuejs/vue-router-next/blob/7869764cb5fefcf1fe02521c252b3e1ee35d4180/src/index.ts#L65-L115

However, they don't seem to show up in the final distributed vue-router.d.ts: https://unpkg.com/browse/vue-router@4.0.0-beta.6/dist/vue-router.d.ts. (I just searched for "$route" in this file and it didn't show up.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptProblem related to TS typings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions