react-sortable icon indicating copy to clipboard operation
react-sortable copied to clipboard

Typescript Definition File

Open nolawnchairs opened this issue 7 years ago • 1 comments

Can you please include a typescript definition file?

nolawnchairs avatar May 17 '18 07:05 nolawnchairs

I whipped this together for anyone looking for a quick hack:

declare module 'react-sortable' {
  export function sortable<ItemType, BaseProps = {}>( component: React.FC<BaseProps> )
  : React.FC<BaseProps & SortableProps<ItemType>>;
}

interface SortableProps<ItemType> {
  onSortItems: ( items: ItemType[] ) => void;
  items: ItemType[];
  sortId: number;
  key: number | string;
}

This goes into a file such as react-sortable.d.ts and should work from there.

maslade avatar Sep 14 '23 00:09 maslade