UNPKG

climb-onyx-gui

Version:
22 lines (20 loc) 1.41 kB
import { ExportHandlerProps, OnyxProps } from '../interfaces'; import { RecordType, DetailResponse, ErrorResponse, FilterConfig } from '../types'; /** Returns a random hexadecimal string. */ declare function generateKey(): string; /** Generate a default file name prefix based on the project code and search parameters. */ declare function getDefaultFileNamePrefix(project: string, searchParameters: string): string; interface DetailResponseProps extends OnyxProps { response: DetailResponse<RecordType> | ErrorResponse | undefined; } /** Handler for converting JSON data to a string for file export. */ declare function handleJSONExport(props: DetailResponseProps): (exportProps: ExportHandlerProps) => void; /** Takes an array of FilterConfig objects and formats into an array of field (+lookup), value pairs. */ declare function formatFilters(filters: FilterConfig[]): string[][]; /** Takes a Response object and returns its status code, formatted as a string. */ declare function formatResponseStatus(response: Response): string; export declare function formatTimeAgo(timestamp: string): string; declare function formatField(field: string): string; declare function formatLookup(lookup: string): string; declare function formatValue(value: string): string; export { formatFilters, formatField, formatLookup, formatResponseStatus, formatValue, generateKey, getDefaultFileNamePrefix, handleJSONExport, };