Skip to content

No typings for plugin options #2588

@yassilah

Description

@yassilah

What problem does this feature solve?

Add typings for Vue 3 Plugin options.
I'm currently writing a Firebase plugin for Vue 3, which requires some configuration (e.g. projectId, appId, etc.). It would be particularly useful to include the plugin options typings when filling up those required properties.

What does the proposed API look like?

Change the current typings of the App interface's use method from:

use(plugin: Plugin_2, ...options: any[]): this

to:

use<P extends Plugin_2>(plugin: P, options: Parameters<P extends PluginInstallFunction ? P : P['install']>[1]): this
use(plugin: Plugin_2): this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions