From 61bbfdbd6aeae2daafd2110be333a24c5d77bd24 Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Wed, 3 Mar 2021 20:35:25 +0100 Subject: [PATCH] added typescript definitions to fix #68 --- package.json | 1 + src/vue-typeahead-bootstrap.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/vue-typeahead-bootstrap.d.ts diff --git a/package.json b/package.json index 088e2da..ddc266e 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "license": "MIT", "author": "Matt Zollinhofer ", "main": "src/components/VueTypeaheadBootstrap.vue", + "types": "src/vue-typeahead-bootstrap.d.ts", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build --target lib --name VueTypeaheadBootstrap src/components/VueTypeaheadBootstrap.vue", diff --git a/src/vue-typeahead-bootstrap.d.ts b/src/vue-typeahead-bootstrap.d.ts new file mode 100644 index 0000000..fb69be3 --- /dev/null +++ b/src/vue-typeahead-bootstrap.d.ts @@ -0,0 +1,28 @@ +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; + + export default VueTypeaheadBootstrap; +}