UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

12 lines (9 loc) 415 B
import React from 'react'; type ConditionalWrapperProps<T extends { wrapperAsChild?: boolean }> = T['wrapperAsChild'] extends true ? T : T & { interactiveProps?: React.ComponentPropsWithoutRef<'button'> }; export type WrapperProps = | ConditionalWrapperProps<{ wrapperAsChild: true }> | ConditionalWrapperProps<{ wrapperAsChild: false }> | ConditionalWrapperProps<{ wrapperAsChild?: undefined }>;