@ahoo-wang/fetcher-wow
Version:
Support for Wow(https://github.com/Ahoo-Wang/Wow) in Fetcher
34 lines • 1.1 kB
TypeScript
/**
* Enumeration of sort directions.
* ASC for ascending order, DESC for descending order.
*/
export declare enum SortDirection {
ASC = "ASC",
DESC = "DESC"
}
/**
* Interface for sort criteria.
*/
export interface FieldSort<FIELDS extends string = string> {
field: FIELDS;
direction: SortDirection;
}
/**
* Creates a sort object with ascending direction for the specified field.
* @param field - The field to sort by
* @returns A Sort object with the specified field and ascending direction
*/
export declare function asc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
/**
* Creates a sort object with descending direction for the specified field.
* @param field - The field to sort by
* @returns A Sort object with the specified field and descending direction
*/
export declare function desc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
/**
* Interface for objects that support sorting.
*/
export interface SortCapable<FIELDS extends string = string> {
sort?: FieldSort<FIELDS>[];
}
//# sourceMappingURL=sort.d.ts.map