Akryum / floating-vue

💬 Easy tooltips, popovers, dropdown, menus... for Vue
https://floating-vue.starpad.dev/
MIT License
3.32k stars 339 forks source link

Provide vanilla TS types for getting fine types #918

Open edimitchel opened 1 year ago

edimitchel commented 1 year ago

Types are not well provided and provided a lot of Vue types correlated, not just plain type for each component.

On usage of VTooltip in a reusable tooltip component (which will fall-through props), I would like to use VTooltip types as extensions of the custom component to get all props available.

I didn't get a proper way to get them without Vue types correlated

Here the types I have when importing from 'floating-vue/dist/index.d.ts'

Popper's types ```ts const VTooltipType: () => DefineComponent<{ theme: { type: StringConstructor; required: true; }; targetNodes: { type: FunctionConstructor; required: true; }; referenceNode: { type: FunctionConstructor; default: any; }; popperNode: { type: FunctionConstructor; required: true; }; shown: { type: BooleanConstructor; default: boolean; }; showGroup: { type: StringConstructor; default: any; }; ariaId: { default: any; }; disabled: { type: BooleanConstructor; default: (props: any) => any; }; positioningDisabled: { type: BooleanConstructor; default: (props: any) => any; }; placement: { ...; }; ... 29 more ...; noAutoFocus: { ...; }; }, ... 10 more ..., { ...; }> import VTooltipType ```

What it could be nice to export in types.ts in root all components vanilla types.

interface VCommonPopper  {
    placement: Placement;
    // common types for all FV components
}

interface VTooltip extends VCommonPopper {
    // specific types for VTooltip
}
DenisLantero commented 4 months ago

We are currently facing the same issue, any updates?