import { type Ref, type ComputedRef } from 'vue'; /** * Configuration for styled component wrapper */ export interface UseStyledComponentConfig> { /** Default prop values to apply project-wide */ defaults?: Record; /** Function to compute final props with smart defaults */ computeProps?: (merged: T, attrs: Record, props: T) => T; /** Additional properties to expose alongside child properties */ expose?: Record; } /** * Return type for useStyledComponent */ export interface UseStyledComponentReturn { /** Merged props to bind to child component */ mergedProps: ComputedRef>; /** Expose object that forwards child + custom properties */ expose: T; /** Reference to the child component */ childRef: Ref; } /** * Composable for creating styled wrapper components with SFC * Handles default props, smart defaults, and automatic child forwarding * * @template T - Type of the child component * @param childRef - Ref to the base component * @param props - Component props * @param config - Configuration object * @returns Helper methods and computed props * * @example * ```ts * import { ref } from 'vue'; * import { useStyledComponent } from '@twentyfourg/grimoire/composables'; * import { GDropdown } from '@twentyfourg/grimoire'; * * const dropdownRef = ref(null); * const props = defineProps({ ...GDropdown.props, variant: String }); * * const { mergedProps, expose } = useStyledComponent(dropdownRef, props, { * defaults: { * canClear: false, * canDeselect: false, * }, * computeProps(merged, attrs) { * if (attrs.mode === 'tags') { * merged.hideSelected = merged.hideSelected ?? false; * } * return merged; * }, * expose: { * myCustomMethod: () => console.log('styled'), * }, * }); * * defineExpose(expose); * ``` */ export declare function useStyledComponent(childRef: Ref, props: Record, config?: UseStyledComponentConfig): UseStyledComponentReturn;