import * as React from "react"; export interface ReactAttr extends React.HTMLAttributes {} export interface ReactAnchorAttr extends React.AnchorHTMLAttributes {} export interface ReactButtonAttr extends React.ButtonHTMLAttributes {} export interface ReactDivAttr extends ReactAttr {} export interface ReactInputAttr extends React.InputHTMLAttributes {} export interface ReactLabelAttr extends React.LabelHTMLAttributes {} export interface ReactLIAttr extends React.LiHTMLAttributes {} export type ShapeOf = (E extends never ? {} : E) & B; export type Overwrite = [T] extends [never] ? U : Omit & U; export type VerticalDirection = "bottom" | "top"; export type HorizontalDirection = "left" | "right"; export type Direction = HorizontalDirection | VerticalDirection; export type ListBoxBaseItemType = object | string; export type TooltipAlignment = "center" | "end" | "start"; export type TooltipPosition = Direction; export type CarbonSize = "lg" | "sm" | "xs"; export type CarbonInputSize = "sm" | "lg" | "xl"; // // In retrospect, it may not always be a good idea to lump shared props into a common reused interface. // There's no real relation between components that share these types and they could diverge causing painful refactors. // This approach should probably be left for more complicated types such as those that involve generics. // export interface DownshiftTypedProps { itemToString?(item: ItemType): string; } export interface InternationalProps> { translateWithId?(messageId: MID, args?: ARGS): string; } export interface MenuOffsetData { left?: number | undefined; top?: number | undefined; } export interface RenderIconProps

{ renderIcon?: React.ComponentType

| undefined; } export interface RequiresChildrenProps { children: NonNullable; } export interface RequiresIdProps { id: NonNullable; } export interface SizingProps { small?: boolean | undefined; } export interface SideNavSharedProps { isSideNavExpanded?: boolean | undefined; } export interface SideNavSizingProps { large?: boolean | undefined; } // // aliases for some React types that it doesn't export directly. They are needed to make sure we match the signatures // as close as possible. // // reference patterns: // function component with no generics: export declare const Comp: React.FC; // function component with generics: export declare function Comp(props: FCProps>): FCReturn; // forwardRef component with no generics: export declare const Comp: ForwardRefReturn; // forwardRef component with generics: export declare function Comp(props: ForwardRefProps>): FCReturn; // export type FCProps

= Parameters>[0]; export type FCReturn = ReturnType; export type ForwardRefProps = React.PropsWithoutRef> & React.RefAttributes; export type ForwardRefReturn = React.ForwardRefExoticComponent>; export type JSXIntrinsicElementProps< K extends keyof React.JSX.IntrinsicElements, REF extends boolean = false, > = REF extends true ? React.JSX.IntrinsicElements[K] : Omit; // for "as" props export type ReactComponentConstructor

= ((props: P) => FCReturn) | (new(props: P) => React.Component);