vue-smooth-dnd icon indicating copy to clipboard operation
vue-smooth-dnd copied to clipboard

Typescript Definition files

Open nootn opened this issue 5 years ago • 4 comments

Hi, do you have any plans to include Typescript Definition files in vue-smooth-dnd (and smooth-dnd would also need one)?

If not, I might investigate creating them, if I did that would you accept a pull request?

nootn avatar Sep 24 '18 12:09 nootn

My vue-smooth-dnd.d.ts file:

declare module 'vue-smooth-dnd' {
    import Vue from 'vue';

    type Payload = any;
  
    interface DropResult {
        removedIndex: number;
        addedIndex: number;
        payload: Payload;
        element: Element;
    }
  
    interface DragEvent {
        isSource: boolean;
        payload: Payload;
        willAcceptDrop: boolean;
    }

    interface NodeDescription {
        value: string;
        props: Vue.VNodeData;
    }

    interface ContainerProps {
        orientation?: string;
        behaviour?: string;
        tag?: string | NodeDescription;
        groupName?: string;
        lockAxis?: string;
        dragHandleSelector?: string;
        nonDragAreaSelector?: string;
        dragBeginDelay?: number;
        animationDuration?: number;
        autoScrollEnabled?: boolean;
        dragClass?: string;
        dropClass?: string;
        removeOnDropOut?: boolean;
        getChildPayload?: (index: number) => Payload;
        shouldAnimateDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean;
        shouldAcceptDrop?: (sourceContainerOptions: ContainerProps, payload: Payload) => boolean;
        getGhostParent: () => Element;
        onDragStart?: (dragEvent: DragEvent) => void;
        onDragEnd?: (dragEvent: DragEvent) => void;
        onDrop?: (dropResult: DropResult) => void;
        onDragEnter?: () => void;
        onDragLeave?: () => void;
        onDropReady?: (dropResult: DropResult) => void;
    }

    class Container extends Vue {
        props: ContainerProps
    }

    class Draggable extends Vue {
        props: {
            tag?: string | NodeDescription;
        }
    }
}

soyersoyer avatar Feb 13 '19 23:02 soyersoyer

I needed this! Thanks so much!!

mesqueeb avatar Feb 05 '20 06:02 mesqueeb

very useful

mahdiprog avatar Nov 12 '20 12:11 mahdiprog

I need it very much, thank you very much

li-jingxuan avatar Dec 09 '20 15:12 li-jingxuan