getDraggables()

This method returns draggables based on the arguments passed as it is a overloaded function.

Definition:

  • static getDraggables(): Draggables

  • static getDraggables(instance: Redrop): DraggableInfo[]

  • static getDraggables(instance: Redrop, element: Element | DraggableElement | null): DraggableInfo

Description: Retrieves draggable elements, their options, or specific draggable information based on the provided arguments.

Overloads:

  1. Retrieve all draggables globally:

    static getDraggables(): Draggables
    • Description: Returns all global draggables managed by the Redrop class.

    • Returns:

      • Draggables: A map of all global draggable elements and their associated options.

    Example:

    const allDraggables = Redrop.getDraggables();
    console.log(allDraggables);

  2. Retrieve draggables from a specific Redrop instance:

    static getDraggables(instance: Redrop): DraggableInfo[]
    • Description: Returns information about all draggables associated with a specific Redrop instance.

    • Parameters:

      • instance (Redrop): The Redrop instance to retrieve draggable information from.

    • Returns:

      • DraggableInfo[]: An array of draggable elements and their options for the provided instance.

    Example:

    const draggablesFromInstance = Redrop.getDraggables(redropInstance);
    console.log(draggablesFromInstance);

  3. Retrieve information about a specific draggable:

    static getDraggables(instance: Redrop, element: Element | DraggableElement | null): DraggableInfo
    • Description: Returns information about a specific draggable element in a specific Redrop instance.

    • Parameters:

      • instance (Redrop): The Redrop instance to search for the draggable element.

      • element (Element | DraggableElement | null): The specific draggable element to retrieve information for.

    • Returns:

      • DraggableInfo: Information about the draggable element and its options, or undefined if not found.

    Example:

    const specificDraggable = Redrop.getDraggables(redropInstance, draggableElement);
    console.log(specificDraggable);

Last updated