vue-typeahead-bootstrap icon indicating copy to clipboard operation
vue-typeahead-bootstrap copied to clipboard

Typescript support

Open wolph opened this issue 5 years ago • 7 comments

I've made a basic definition which should do the trick :)

// vue-typeahead-bootstrap.d.ts
declare module 'vue-typeahead-bootstrap' {

    import {Component} from 'vue';

    interface Props {
        append?: string;
        autoClose?: boolean;
        backgroundVariant?: string;
        data: any[];
        disabled?: boolean;
        disabledValues?: any[];
        disableSort?: boolean;
        highlightClass?: string;
        inputClass?: string;
        maxMatches?: number;
        minMatchingChars?: number;
        prepend?: string;
        serializer?: (input: string) => string;
        showAllResults?: boolean;
        showOnFocus?: boolean;
        size?: 'sm' | 'lg';
        textVariant?: string;
    }

    const VueTypeaheadBootstrap: Component<any, any, any, Props>;

    export default VueTypeaheadBootstrap;
}

wolph avatar Aug 07 '20 13:08 wolph

I'm not super familiar (not familiar at all...). I just don't have a preference here or really know the cost vs the value of this. The only thing that strikes me as an issue is ensuring we keep this definition up to date, feels like I'm completely forget to update this.

@BozoJim @alpharahl any thoughts?

mattzollinhofer avatar Aug 07 '20 23:08 mattzollinhofer

Well... honestly, keeping it up to date isn't even that much of a problem really. It might depend on the editor but at least Jetbrains Webstorm doesn't complain if you add different arguments than the supported ones.

And I have to say, I'm no expert either so perhaps it can be improved. But this at least removes the warnings from my editor :)

wolph avatar Aug 07 '20 23:08 wolph

Yeah I had to add this manually for my project, it would be great if it was included

eberkund avatar Aug 18 '20 20:08 eberkund

Alright, I let this sit long enough, sorry about that.

If someone (@WoLpH, @eberkund ?) submits a PR for this I'll merge it.

mattzollinhofer avatar Dec 31 '20 20:12 mattzollinhofer

@mattzollinhofer I've created a pull request, but I'm honestly not sure if I'm doing it correctly. I've never published an npm package :)

wolph avatar Mar 03 '21 19:03 wolph

hmm, well I don't really know how to test PR (#68) so I hesitate to just accept it. Can anyone help give us some more confidence in this?

mattzollinhofer avatar Apr 30 '21 01:04 mattzollinhofer

@eberkund perhaps you can test this?

I can't really test my own pull request without bias :)

wolph avatar Sep 28 '21 15:09 wolph