Skip to content

Commit f520dd4

Browse files
committed
fix: type fixes
1 parent 60b54ec commit f520dd4

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

src/Toggle.d.ts

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
1-
import Vue,{ VNode } from 'vue';
1+
import { VNode, defineComponent } from 'vue';
22

3-
declare class Toggle extends Vue {
4-
modelValue?: any;
5-
value?: any;
6-
id?: string;
7-
name?: string;
8-
disabled?: boolean;
9-
required?: boolean;
10-
falseValue?: any;
11-
trueValue?: any;
12-
offLabel?: string;
13-
onLabel?: string;
14-
labelledby?: string;
15-
describedby?: string;
16-
classes?: object;
17-
aria?: object;
3+
interface ToggleProps {
4+
modelValue?: any;
5+
value?: any;
6+
id?: string;
7+
name?: string;
8+
disabled?: boolean;
9+
required?: boolean;
10+
falseValue?: any;
11+
trueValue?: any;
12+
offLabel?: string;
13+
onLabel?: string;
14+
labelledby?: string;
15+
describedby?: string;
16+
classes?: object;
17+
aria?: object;
18+
}
19+
20+
declare class Toggle implements ReturnType<typeof defineComponent> {
21+
modelValue: ToggleProps['modelValue'];
22+
value: ToggleProps['value'];
23+
id: ToggleProps['id'];
24+
name: ToggleProps['name'];
25+
disabled: ToggleProps['disabled'];
26+
required: ToggleProps['required'];
27+
falseValue: ToggleProps['falseValue'];
28+
trueValue: ToggleProps['trueValue'];
29+
offLabel: ToggleProps['offLabel'];
30+
onLabel: ToggleProps['onLabel'];
31+
labelledby: ToggleProps['labelledby'];
32+
describedby: ToggleProps['describedby'];
33+
classes: ToggleProps['classes'];
34+
aria: ToggleProps['aria'];
35+
36+
$props: ToggleProps;
1837

19-
$emit(eventName: 'change', e: {originalEvent: Event, value: any}): this;
38+
$emit(eventName: 'change', value: any): this | void;
2039

21-
$slots: {
22-
label: VNode[];
23-
};
40+
$slots: {
41+
label: VNode[];
42+
};
2443
}
2544

2645
export default Toggle;

0 commit comments

Comments
 (0)