import { PropsWithChildren } from 'react'; import Sortable, { Options } from 'sortablejs'; import { MultiDragEvent } from './react-sortable'; import { AllMethodNames, ItemInterface, ReactSortableProps } from './types'; /** * Removes the `node` from the DOM * @param node */ export declare function removeNode(node: HTMLElement): void; /** * Inserts the `newChild` node at the given index in a parent * @param parent The parent HTML Element. * @param newChild A HTML eement to add as a child of the parent. * @param index index of the parent to place the new child in. */ export declare function insertNodeAt(parent: HTMLElement, newChild: HTMLElement, index: number): void; /** removes stuff from the dom in a nice order */ export declare function handleDOMChanges(customs: Normalized[]): void; export declare function removeNodes(customs: Normalized[]): void; export declare function insertNodes(customs: Normalized[]): void; export declare function createCustoms(evt: MultiDragEvent, list: T[]): Normalized[]; /** moves items form old index to new index without breaking anything ideally. */ export declare function handleStateChanges(normalized: Normalized[], list: T[]): T[]; export declare function handleStateRemove(normalized: Normalized[], list: T[]): T[]; export declare function handleStateAdd(normalized: Normalized[], list: T[], evt?: Sortable.SortableEvent, clone?: ((currentItem: T, evt: Sortable.SortableEvent) => T) | undefined): T[]; export declare function getMode(evt: MultiDragEvent): 'multidrag' | 'swap' | 'normal'; export declare function createNormalized(inputs: Input[], list: T[]): Normalized[]; export interface Input { parentElement: HTMLElement; element: HTMLElement; oldIndex: number; newIndex: number; } export interface Normalized extends Input { item: T; } /** * Removes the following group of properties from `props`, * leaving only `Sortable.Options` without any `on` methods. * @param props `ReactSortable.Props` */ export declare function destructurePropsForOptions(props: PropsWithChildren>): Exclude; /** * Construct a type with the properties of T except for those in type K. * Including this allows for backwards compatibility with earlier versions of TS. */ export declare type Omit = Pick>;