pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
import { EventHandlers } from './types';
|
||||
/**
|
||||
* Combines the two get*Props functions from Base UI hooks into one.
|
||||
* Useful when a hook uses two other hooks behind the scenes
|
||||
* (such as useSelect that depends on useList and useButton for its root slot).
|
||||
*
|
||||
* The resulting function will return the combined props.
|
||||
* They are merged from left to right, similarly to how Object.assign works.
|
||||
*
|
||||
* The getSecondProps function will receive the result of the getFirstProps function as its argument,
|
||||
* so its event handlers can call the previous handlers and act depending on its result.
|
||||
*
|
||||
* @param getFirstProps - A getter function that returns the props for the first slot. It receives the external event handlers as its argument.
|
||||
* @param getSecondProps - A getter function that returns the props for the second slot. It receives the result of the getFirstProps function as its argument.
|
||||
*/
|
||||
export declare function combineHooksSlotProps<ExternalHandlers extends EventHandlers, FirstSlotProps extends ExternalHandlers, SecondSlotProps extends ExternalHandlers>(getFirstProps: (external?: ExternalHandlers) => FirstSlotProps, getSecondProps: (external?: ExternalHandlers) => SecondSlotProps): <OtherProps extends ExternalHandlers>(external?: OtherProps) => OtherProps & FirstSlotProps & SecondSlotProps;
|
||||
Reference in new issue
Block a user