@bhplugin/vue3-datatable
Version:
Vue3 Datatable - fully customizable & easy to use datatable library
19 lines (18 loc) • 527 B
TypeScript
import { type Ref } from 'vue';
type SortDir = 'asc' | 'desc';
interface IUseSortingOptions {
sortColumn: Ref<string>;
sortDirection: Ref<SortDir>;
}
export declare function useSorting(options: IUseSortingOptions): {
currentSortColumn: Ref<string, string>;
currentSortDirection: Ref<SortDir, SortDir>;
initialSortColumn: string;
initialSortDirection: SortDir;
toggleSort: (field: string) => {
field: string;
direction: "asc" | "desc";
};
resetSort: () => void;
};
export {};