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

22 lines 1.34 kB
/** * Gets or calculates the slot props for a component. * * Our component 'slots' are heavily inspired by MUI's slots and generally matches their design patterns. * See https://mui.com/x/common-concepts/custom-components/ * @param propsOrFn * @param ownerState */ export declare function getSlotProps<TProps extends object, TOwnerState = unknown>(propsOrFn: TProps | ((ownerState: TOwnerState) => TProps), ownerState: TOwnerState): TProps; type SlotPropsObject = Record<string, unknown>; type SlotPropsFunction<TArgs extends any[]> = (...args: TArgs) => SlotPropsObject; type SlotProps<TArgs extends any[]> = SlotPropsObject | SlotPropsFunction<TArgs>; type MergeReturn<TArgs extends any[], T1 extends SlotProps<TArgs>, T2 extends SlotProps<TArgs>> = T1 extends SlotPropsFunction<TArgs> ? SlotPropsFunction<TArgs> : T2 extends SlotPropsFunction<TArgs> ? SlotPropsFunction<TArgs> : SlotPropsObject; /** * Merges two slot props objects or functions so that a complex hierarchy of components can safely expose slots of * internal components as their own. * @param slotProps1 * @param slotProps2 */ export declare function mergeSlotProps<TArgs extends any[], T1 extends SlotProps<TArgs>, T2 extends SlotProps<TArgs>>(slotProps1: T1, slotProps2: T2): MergeReturn<TArgs, T1, T2>; export {}; //# sourceMappingURL=SlotUtils.d.ts.map