@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
58 lines • 3.32 kB
TypeScript
import { ISeriesSort } from './Interfaces';
export declare function sortObjectArrayByStringKey(arr: any[], order: ISeriesSort, key: string): any[];
/**
*
*
* NOTE sortObjectArrayByStringKeyCollator HAS NOT BEEN TESTED IN ANY WAY.
* JUST MODIFIED based upon sortStringArrayCollator
*
* @param arr
* @param order
* @param key
* @param convertNullToEmpty
* @param localLanguage
*/
export declare function sortObjectArrayByStringKeyCollator(arr: any[], order: ISeriesSort, key: string, convertNullToEmpty?: boolean, localLanguage?: string): any[];
/**
* This is different from sortObjectArrayByNumberKey in that you can look at nested children.
* In the case of ExtremeContents:
* There is an array of File types call infoTypes
* I wanted to sort by type.summary.keyToSortBy.
* This will let you pass in a key string like: key ='summary.count' and it will look at the children objects.
* NOTE: The keys are determined using the '.'
*
* @param arr
* @param order
* @param key
*/
export declare function sortObjectArrayByChildNumberKey(arr: any[], order: ISeriesSort, key: string): any[];
/***
* .d8888. .d88b. d8888b. d888888b db dD d88888b db db .d8888. d8888b. db db .d88b. d888888b db db d88888b d8888b. db dD d88888b db db
* 88' YP .8P Y8. 88 `8D `~~88~~' 88 ,8P' 88' `8b d8' 88' YP 88 `8D `8b d8' .8P Y8. `~~88~~' 88 88 88' 88 `8D 88 ,8P' 88' `8b d8'
* `8bo. 88 88 88oobY' 88 88,8P 88ooooo `8bd8' `8bo. 88oooY' `8bd8' 88 88 88 88ooo88 88ooooo 88oobY' 88,8P 88ooooo `8bd8'
* `Y8b. 88 88 88`8b 88 88`8b 88~~~~~ 88 `Y8b. 88~~~b. 88 88 88 88 88~~~88 88~~~~~ 88`8b 88`8b 88~~~~~ 88
* db 8D `8b d8' 88 `88. 88 88 `88. 88. 88 db 8D 88 8D 88 `8b d8' 88 88 88 88. 88 `88. 88 `88. 88. 88
* `8888Y' `Y88P' 88 YD YP YP YD Y88888P YP `8888Y' Y8888P' YP `Y88P' YP YP YP Y88888P 88 YD YP YD Y88888P YP
*
* 2020-12-14
* This function caused errors in TrackMyTime which was based on @yo 1.9.1 but works in Drilldown and ActionNews @yo 1.11.0
*
* Cannot invoke an expression whose type lacks a call signature. Type '((compareFn?: (a: string, b: string) => number) => string[]) | ((compareFn?: (a: number, b: numbe...' has no compatible call signatures.
*
* Rebuilt and added sortNumberArray and sortStringArray and it seems to work ok.
*/
/**
* 2025-01-27: Changed type of sortKey from ISeriesSort to string because it was clearly an error.
* Found testing in drilldown's sortRefinerObject function
* This also matches the types of the key found in the other functions in this file.
* @param obj
* @param sortKey
* @param order
* @param dataType
* @param otherKeys
* @param convertNullToEmpty
* @param localLanguage
* @returns
*/
export declare function sortKeysByOtherKey(obj: any, sortKey: string, order: ISeriesSort, dataType: 'number' | 'string', otherKeys: string[], convertNullToEmpty?: boolean, localLanguage?: string): any;
//# sourceMappingURL=objects.d.ts.map