UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

56 lines 2.14 kB
import { Facet } from '@sage-bionetworks/synapse-types'; export declare const MAX_FACET_VALUES_SHOWN = 10; export declare const timeRanges: ({ id: string; label: string; range: null; } | { id: string; label: string; range: number; })[]; export declare const FACET_DISPLAY_NAMES: Record<string, string>; export declare const FACET_DISPLAY_ORDER: string[]; export declare const USER_FACET_NAMES: string[]; export declare const FACET_PLURAL_DISPLAY_NAMES: Record<string, string>; /** * Get the label for the "All" option in a facet, e.g. "All Entity Types" for the 'node_type' facet */ export declare function getAllFacetLabel(facetName: string): string; /** * Determines if a facet value should be displayed in the UI. * Hides 'link' entity types and colon-prefixed values */ export declare function shouldShowFacetValue(facetName: string, value: string): boolean; /** * Check if a facet is a user facet (e.g., 'modified_by' or 'created_by') * Accepts either snake_case or PascalCase facet names. */ export declare const isUserFacet: (name: string) => boolean; /** * Format facet name: capitalize first letter, replace underscores with spaces */ export declare function formatFacetName(name: string): string; /** * Get user-friendly display name for a facet */ export declare function getFacetDisplayName(facetName: string): string; /** * Check if a facet should be rendered (some facets like 'link' are hidden) */ export declare function shouldRenderFacet(facet: Facet): boolean; /** * Get timestamp from URL/query and determine which time range preset it matches * * @param timestamp - The stored timestamp (in seconds) from the URL/query * @returns The ID of the matching time range preset ('PAST_HOUR', 'PAST_DAY', etc.) */ export declare function getSelectedTimeRangeId(timestamp: string): string; /** * Formats a timestamp for display in the applied facets chip. * * @param timestamp - The stored timestamp (in seconds) * @returns A friendly display string */ export declare function formatTimeRangeDisplayValue(timestamp: string): string; //# sourceMappingURL=SearchFacetPanelUtils.d.ts.map