/** * Used to merge and differentiate incoming props with the default props. * - Keys that exist in both `props1` and `props2` are placed in `props`, with values from `props2`. * - Keys that exist in `props2` but not in `props1` are placed in `attrs`. * * Uses structural comparison to preserve referential stability — if the computed * props and attrs are shallowly equal to the previous result, the same reference is returned. * This prevents unnecessary downstream useMemo invalidation even when the parent * passes a new props object reference with identical values (e.g., from JSX spread). * * @template P1 The type of the default set of props. * @template P2 The type of the incoming set of props. * * @param props1 The default set of props (e.g., default props). * @param props2 The incoming set of props (e.g., user-defined or dynamic props). * @returns An object containing: * - `props`: A new object containing keys that exist in both `props1` and `props2`, using values from `props2`. * - `attrs`: A new object containing keys that exist only in `props2`, excluding any keys from `props1`. * * @example * ```ts * const { props, attrs } = useProps({ className: 'baz' }, { id: 'foo', className: 'bar' }); * * console.log(props); // { className: 'bar' } * console.log(attrs); // { id: 'foo' } * ``` */ export declare function useProps(props1?: P1, props2?: P2): { props: Pick; attrs: Omit; };