react-equal-height
Version:
A React library with TypeScript support that automatically compares and sets the highest element height, including the ability to sort elements per row. Protected by the 'use client' directive, making it compatible with React Server Components and Next.js
34 lines (33 loc) • 1.98 kB
TypeScript
import { ContextType, DependencyList, Dispatch, SetStateAction } from 'react';
import { ElementsMaxSizesProps, HoldersInfoProps } from './equal-height';
import { ElementsProps } from "./equal-height-holder";
export interface EqualHeightContextProps {
equalRows: boolean | number;
animationSpeed: number | `${string}s` | `${string}ms`;
update: {
value: boolean;
};
updateOnChange?: DependencyList;
forceUpdate: () => void;
developerMode: boolean | 'DEEP';
maxSizes: ElementsMaxSizesProps[];
holdersInfo: HoldersInfoProps[];
setHoldersInfo: Dispatch<SetStateAction<HoldersInfoProps[]>>;
}
declare const EqualHeightContext: import("react").Context<EqualHeightContextProps>;
declare const EqualHeightProvider: import("react").Provider<EqualHeightContextProps>;
declare const EqualHeightConsumer: import("react").Consumer<EqualHeightContextProps>;
declare const useEqualHeightContext: () => ContextType<typeof EqualHeightContext> | never;
declare const getEqualHeightContext: () => EqualHeightContextProps;
export { EqualHeightContext, EqualHeightProvider, EqualHeightConsumer, useEqualHeightContext, getEqualHeightContext };
export interface EqualHeightHolderContextProps {
elementsInfo: ElementsProps[];
setElementsInfo: Dispatch<SetStateAction<ElementsProps[]>>;
position: number | undefined;
}
declare const EqualHeightHolderContext: import("react").Context<EqualHeightHolderContextProps>;
declare const EqualHeightHolderProvider: import("react").Provider<EqualHeightHolderContextProps>;
declare const EqualHeightHolderConsumer: import("react").Consumer<EqualHeightHolderContextProps>;
declare const useEqualHeightHolderContext: () => ContextType<typeof EqualHeightHolderContext> | never;
declare const getEqualHeightHolderContext: () => EqualHeightHolderContextProps;
export { EqualHeightHolderContext, EqualHeightHolderProvider, EqualHeightHolderConsumer, useEqualHeightHolderContext, getEqualHeightHolderContext };