Skip to content

Commit

Permalink
Fix #6334: typescript definition for Stepper and StepperPanel (#6356)
Browse files Browse the repository at this point in the history
* fix: typescript definition for Stepper and StepperPanel components

* added type StepperRefAttributes for proper ref methods type definition of Stepper

* added type StepperRefAttributes for proper ref methods type definition of Stepper
  • Loading branch information
dvpritzbuer authored Apr 16, 2024
1 parent 258af95 commit 0c40187
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion components/lib/stepper/stepper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ export interface StepperChangeEvent {
index: number;
}

/**
* Defines custom RefAttributes methods
*/
export interface StepperRefAttributes {
getElement: () => HTMLDivElement;
nextCallback: (e?: React.SyntheticEvent) => void;
prevCallback: (e?: React.SyntheticEvent) => void;
}

/**
* Defines valid properties in Stepper component.
* @group Properties
Expand Down Expand Up @@ -134,4 +143,4 @@ export interface StepperProps {
*
* @group Component
*/
export declare const Stepper: React.Component<StepperProps, any>;
export declare const Stepper: React.ForwardRefExoticComponent<React.PropsWithChildren<StepperProps> & React.RefAttributes<StepperRefAttributes>>;
2 changes: 1 addition & 1 deletion components/lib/stepperpanel/stepperpanel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ export interface StepperPanelProps {
*
* @group Component
*/
export declare const StepperPanel: React.Component<StepperPanelProps, any>;
export declare const StepperPanel: React.FC<React.PropsWithChildren<StepperPanelProps>>;

0 comments on commit 0c40187

Please sign in to comment.