Skip to content

Commit 4914b20

Browse files
committed
feat: types SFC prop typehinting
1 parent bb8fa1b commit 4914b20

File tree

1 file changed

+73
-4
lines changed

1 file changed

+73
-4
lines changed

src/Multiselect.d.ts

+73-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { VNode, defineComponent } from 'vue';
22

3-
43
interface ClassList {
54
assist: string;
65
caret: Array<string>;
@@ -36,11 +35,10 @@ interface ClassList {
3635
wrapper: string;
3736
}
3837

39-
40-
declare class Multiselect implements ReturnType<typeof defineComponent> {
38+
interface MultiselectProps {
4139
modelValue?: any;
4240
value?: any;
43-
mode: 'single' | 'multiple' | 'tags';
41+
mode?: 'single' | 'multiple' | 'tags';
4442
options?: any[] | object | Function;
4543
searchable?: boolean;
4644
valueProp?: string;
@@ -104,6 +102,77 @@ declare class Multiselect implements ReturnType<typeof defineComponent> {
104102
appendToBody?: boolean;
105103
closeOnScroll?: boolean;
106104
breakTags?: boolean;
105+
}
106+
107+
declare class Multiselect implements ReturnType<typeof defineComponent> {
108+
modelValue: MultiselectProps['modelValue'];
109+
value: MultiselectProps['value'];
110+
mode: MultiselectProps['mode'];
111+
options: MultiselectProps['options'];
112+
searchable: MultiselectProps['searchable'];
113+
valueProp: MultiselectProps['valueProp'];
114+
trackBy: MultiselectProps['trackBy'];
115+
label: MultiselectProps['label'];
116+
placeholder: MultiselectProps['placeholder'];
117+
multipleLabel: MultiselectProps['multipleLabel'];
118+
disabled: MultiselectProps['disabled'];
119+
max: MultiselectProps['max'];
120+
limit: MultiselectProps['limit'];
121+
loading: MultiselectProps['loading'];
122+
id: MultiselectProps['id'];
123+
caret: MultiselectProps['caret'];
124+
maxHeight: MultiselectProps['maxHeight'];
125+
noOptionsText: MultiselectProps['noOptionsText'];
126+
noResultsText: MultiselectProps['noResultsText'];
127+
canDeselect: MultiselectProps['canDeselect'];
128+
canClear: MultiselectProps['canClear'];
129+
clearOnSearch: MultiselectProps['clearOnSearch'];
130+
clearOnSelect: MultiselectProps['clearOnSelect'];
131+
delay: MultiselectProps['delay'];
132+
filterResults: MultiselectProps['filterResults'];
133+
minChars: MultiselectProps['minChars'];
134+
resolveOnLoad: MultiselectProps['resolveOnLoad'];
135+
appendNewTag: MultiselectProps['appendNewTag'];
136+
appendNewOption: MultiselectProps['appendNewOption'];
137+
createTag: MultiselectProps['createTag'];
138+
createOption: MultiselectProps['createOption'];
139+
addTagOn: MultiselectProps['addTagOn'];
140+
addOptionOn: MultiselectProps['addOptionOn'];
141+
hideSelected: MultiselectProps['hideSelected'];
142+
showOptions: MultiselectProps['showOptions'];
143+
object: MultiselectProps['object'];
144+
required: MultiselectProps['required'];
145+
openDirection: MultiselectProps['openDirection'];
146+
nativeSupport: MultiselectProps['nativeSupport'];
147+
classes: MultiselectProps['classes'];
148+
strict: MultiselectProps['strict'];
149+
closeOnSelect: MultiselectProps['closeOnSelect'];
150+
closeOnDeselect: MultiselectProps['closeOnDeselect'];
151+
autocomplete: MultiselectProps['autocomplete'];
152+
groups: MultiselectProps['groups'];
153+
groupLabel: MultiselectProps['groupLabel'];
154+
groupOptions: MultiselectProps['groupOptions'];
155+
groupHideEmpty: MultiselectProps['groupHideEmpty'];
156+
groupSelect: MultiselectProps['groupSelect'];
157+
inputType: MultiselectProps['inputType'];
158+
attrs: MultiselectProps['attrs'];
159+
onCreate: MultiselectProps['onCreate'];
160+
searchStart: MultiselectProps['searchStart'];
161+
reverse: MultiselectProps['reverse'];
162+
regex: MultiselectProps['regex'];
163+
rtl: MultiselectProps['rtl'];
164+
infinite: MultiselectProps['infinite'];
165+
aria: MultiselectProps['aria'];
166+
clearOnBlur: MultiselectProps['clearOnBlur'];
167+
locale: MultiselectProps['locale'];
168+
fallbackLocale: MultiselectProps['fallbackLocale'];
169+
searchFilter: MultiselectProps['searchFilter'];
170+
allowAbsent: MultiselectProps['allowAbsent'];
171+
appendToBody: MultiselectProps['appendToBody'];
172+
closeOnScroll: MultiselectProps['closeOnScroll'];
173+
breakTags: MultiselectProps['breakTags'];
174+
175+
$props: MultiselectProps;
107176

108177
$emit(eventName: 'change', value: any, instance: this): this | void;
109178
$emit(eventName: 'select', value: any, option: any, instance:this): this | void;

0 commit comments

Comments
 (0)