|
1 | | -declare module 'vuedraggable' { |
2 | | - |
3 | | - import { ComponentPublicInstance, VueConstructor } from 'vue'; |
4 | | - |
5 | | - type CombinedVueInstance< |
6 | | - Instance extends ComponentPublicInstance, |
7 | | - Data, |
8 | | - Methods, |
9 | | - Computed, |
10 | | - Props |
11 | | - > = Data & Methods & Computed & Props & Instance; |
12 | | - |
13 | | - type ExtendedVue< |
14 | | - Instance extends ComponentPublicInstance, |
15 | | - Data, |
16 | | - Methods, |
17 | | - Computed, |
18 | | - Props |
19 | | - > = VueConstructor< |
20 | | - CombinedVueInstance<Instance, Data, Methods, Computed, Props> & ComponentPublicInstance |
21 | | - >; |
22 | | - |
23 | | - export type DraggedContext<T> = { |
24 | | - index: number; |
25 | | - futureIndex: number; |
26 | | - element: T; |
27 | | - }; |
28 | | - |
29 | | - export type DropContext<T> = { |
30 | | - index: number; |
31 | | - component: ComponentPublicInstance; |
32 | | - element: T; |
33 | | - }; |
34 | | - |
35 | | - export type Rectangle = { |
36 | | - top: number; |
37 | | - right: number; |
38 | | - bottom: number; |
39 | | - left: number; |
40 | | - width: number; |
41 | | - height: number; |
42 | | - }; |
43 | | - |
44 | | - export type MoveEvent<T> = { |
45 | | - originalEvent: DragEvent; |
46 | | - dragged: Element; |
47 | | - draggedContext: DraggedContext<T>; |
48 | | - draggedRect: Rectangle; |
49 | | - related: Element; |
50 | | - relatedContext: DropContext<T>; |
51 | | - relatedRect: Rectangle; |
52 | | - from: Element; |
53 | | - to: Element; |
54 | | - willInsertAfter: boolean; |
55 | | - isTrusted: boolean; |
56 | | - }; |
57 | | - |
58 | | - export type ChangeEvent<T> = { |
59 | | - added?: { |
60 | | - element: T; |
61 | | - newIndex: number; |
| 1 | +declare const draggableComponent: import("vue").DefineComponent<{ |
| 2 | + list: { |
| 3 | + type: ArrayConstructor; |
| 4 | + required: boolean; |
| 5 | + default: any; |
62 | 6 | }; |
63 | | - removed?: { |
64 | | - element: T; |
65 | | - oldIndex: number; |
| 7 | + modelValue: { |
| 8 | + type: ArrayConstructor; |
| 9 | + required: boolean; |
| 10 | + default: any; |
66 | 11 | }; |
67 | | - moved?: { |
68 | | - element: T; |
69 | | - newIndex: number; |
70 | | - oldIndex: number; |
| 12 | + itemKey: { |
| 13 | + type: (FunctionConstructor | StringConstructor)[]; |
| 14 | + required: boolean; |
71 | 15 | }; |
72 | | - }; |
73 | | - |
74 | | - const draggable: ExtendedVue< |
75 | | - ComponentPublicInstance, |
76 | | - {}, |
77 | | - {}, |
78 | | - {}, |
79 | | - { |
80 | | - options: any; |
81 | | - list: any[]; |
82 | | - value: any[]; |
83 | | - clone: any; |
84 | | - tag?: string | null; |
85 | | - move: any; |
86 | | - componentData: any; |
87 | | - } |
88 | | - >; |
89 | | - |
90 | | - export default draggable; |
91 | | -} |
| 16 | + clone: { |
| 17 | + type: FunctionConstructor; |
| 18 | + default: (original: any) => any; |
| 19 | + }; |
| 20 | + tag: { |
| 21 | + type: StringConstructor; |
| 22 | + default: string; |
| 23 | + }; |
| 24 | + move: { |
| 25 | + type: FunctionConstructor; |
| 26 | + default: any; |
| 27 | + }; |
| 28 | + componentData: { |
| 29 | + type: ObjectConstructor; |
| 30 | + required: boolean; |
| 31 | + default: any; |
| 32 | + }; |
| 33 | +}, unknown, { |
| 34 | + error: boolean; |
| 35 | +}, { |
| 36 | + realList(): any; |
| 37 | + getKey(): any; |
| 38 | +}, { |
| 39 | + getUnderlyingVm(domElement: any): any; |
| 40 | + getUnderlyingPotencialDraggableComponent(htmElement: any): any; |
| 41 | + emitChanges(evt: any): void; |
| 42 | + alterList(onList: any): void; |
| 43 | + spliceList(): void; |
| 44 | + updatePosition(oldIndex: any, newIndex: any): void; |
| 45 | + getRelatedContextFromMoveEvent({ to, related }: { |
| 46 | + to: any; |
| 47 | + related: any; |
| 48 | + }): any; |
| 49 | + getVmIndexFromDomIndex(domIndex: any): any; |
| 50 | + onDragStart(evt: any): void; |
| 51 | + onDragAdd(evt: any): void; |
| 52 | + onDragRemove(evt: any): void; |
| 53 | + onDragUpdate(evt: any): void; |
| 54 | + computeFutureIndex(relatedContext: any, evt: any): any; |
| 55 | + onDragMove(evt: any, originalEvent: any): any; |
| 56 | + onDragEnd(): void; |
| 57 | +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ |
| 58 | + move: Function; |
| 59 | + tag: string; |
| 60 | + clone: Function; |
| 61 | + list: unknown[]; |
| 62 | + modelValue: unknown[]; |
| 63 | + componentData: Record<string, any>; |
| 64 | +} & { |
| 65 | + itemKey?: string | Function; |
| 66 | +}>, { |
| 67 | + move: Function; |
| 68 | + tag: string; |
| 69 | + clone: Function; |
| 70 | + list: unknown[]; |
| 71 | + modelValue: unknown[]; |
| 72 | + componentData: Record<string, any>; |
| 73 | +}>; |
| 74 | +export default draggableComponent; |
0 commit comments