import { DecafClient } from '@decafhub/decaf-client'; import { DecafContextType } from '@decafhub/decaf-react'; import Decimal from 'decimal.js'; import { Params } from 'react-router-dom'; /** * This hook is used to calculate the remaining height of an element. * It takes into account the footer height and padding. * * @param elementId the id of the element to calculate the available height. * @returns the remaining height of the element. */ export declare function useRemaningHeight(elementId: string): number; /** * This hook is used to calculate the max possible height of a table. * It is used to set the height of the table to make it scrollable * when the content is too large. * @param elementId the id of the element that contains the table. * @param bottomSpace extra space to be added to the bottom of the table container. * @returns the max height of the table. * @example * ```tsx * const maxHeight = useTableMaxHeight('table-container', 50); * return ( * * ); * ``` **/ export declare function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number; export declare function getElementComputedHeight(element?: Element | null): number; export declare function getElementTotalOffset(element?: Element | null): number; export declare function lightenDarkenColor(col: string, amt: number): string; export declare function logout(client: DecafClient, fromAll?: boolean): void; /** * Follow an `href` from a menu/dropdown/palette item with the same heuristic * everywhere: same-origin paths trigger a full-page navigation in the same * tab (typical "go to sibling webapp" use case); cross-origin URLs open in a * new tab. Consumers who explicitly want a new tab for a same-origin URL * should use `onClick`/`onSelect` and call `window.open` themselves. */ export declare function followHref(href: string): void; export declare function getGravatarUrl(email: string): Promise; export type BooleanMap = { True: T; False: T; }; export declare function booleanMap(map: BooleanMap): (x: boolean) => T; export type NullableBooleanMap = { Null: T; } & BooleanMap; export declare function nullableBooleanMap(map: NullableBooleanMap): (x?: boolean | undefined | null) => T; export declare enum Direction { Short = -1, Square = 0, Long = 1 } export declare function toDirection(x: number | Decimal | Direction): Direction; export type DirectionMap = { Short: T; Square: T; Long: T; }; export declare function directionMap(map: DirectionMap): (x: number | Decimal | Direction) => T; export declare function setAtKey(array: T[], items: T[], key: keyof T): T[]; export type DecafLoaderFactory = (context: DecafContextType) => DecafLoader; export type DecafLoader = (args: { request: Request; params: Params; context?: any; }) => Promise; export declare function getSearchParams(request: Request): URLSearchParams; export declare function getSearchParam(request: Request, name: string): string | null; export declare function getSearchParamDefault(request: Request, name: string, defaultValue: string): string; export declare function getSearchParamAll(request: Request, name: string): string[]; //# sourceMappingURL=utils.d.ts.map