1 | import * as React from 'react';
|
2 | import { ClassValue } from 'clsx';
|
3 | import { Simplify } from '@mui/types';
|
4 | import { EventHandlers } from './types';
|
5 | export type WithCommonProps<T> = T & {
|
6 | className?: string;
|
7 | style?: React.CSSProperties;
|
8 | ref?: React.Ref<any>;
|
9 | };
|
10 | export interface MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> {
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 | getSlotProps?: (other: EventHandlers) => WithCommonProps<SlotProps>;
|
17 | |
18 |
|
19 |
|
20 | externalSlotProps?: WithCommonProps<ExternalSlotProps>;
|
21 | |
22 |
|
23 |
|
24 |
|
25 | externalForwardedProps?: WithCommonProps<ExternalForwardedProps>;
|
26 | |
27 |
|
28 |
|
29 | additionalProps?: WithCommonProps<AdditionalProps>;
|
30 | |
31 |
|
32 |
|
33 | className?: ClassValue | ClassValue[];
|
34 | }
|
35 | export type MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> = {
|
36 | props: Simplify<SlotProps & ExternalForwardedProps & ExternalSlotProps & AdditionalProps & {
|
37 | className?: string;
|
38 | style?: React.CSSProperties;
|
39 | }>;
|
40 | internalRef: React.Ref<any> | undefined;
|
41 | };
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export default function mergeSlotProps<SlotProps, ExternalForwardedProps extends Record<string, unknown>, ExternalSlotProps extends Record<string, unknown>, AdditionalProps>(parameters: MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>): MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>;
|