svogv
Version:
A decorator based approach for model driven forms, including an advanced DataGrid and a TreeView component.
16 lines (15 loc) • 874 B
TypeScript
/**
* The Sortable decorator.
*
* The {@link `DataGrid` does not sort columns for properties tagged with}`@Sortable(false)`.
* The default is that all columsn are sortable. Either avoid this decorator or use `@Sortable(true)`.
* Additionally, if the decorator is provided, you can add a sort function callback as second parameter.
*
* @param canSort Suppress or allow sorting.
* @param sortCallback An optional callback that provides a sort instruction. If omitted, `Array.prototype.sort` is being used.
*/
export declare function Sortable(canSort: boolean, sortCallback?: (a: any, b: any) => 1 | -1 | 0): (target: object, property: string | symbol) => void;
export declare namespace Sortable {
var IsSortable: (target: object, key: string, def?: string) => any;
var SortCallback: (target: object, key: string, def?: string) => any;
}