From 0c401872c705aafe8afc363a5cf64bed5e3644d8 Mon Sep 17 00:00:00 2001 From: Daniel vP Date: Tue, 16 Apr 2024 21:14:57 +0200 Subject: [PATCH] Fix #6334: typescript definition for Stepper and StepperPanel (#6356) * 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 --- components/lib/stepper/stepper.d.ts | 11 ++++++++++- components/lib/stepperpanel/stepperpanel.d.ts | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/lib/stepper/stepper.d.ts b/components/lib/stepper/stepper.d.ts index 0f93500a0d..0969821245 100644 --- a/components/lib/stepper/stepper.d.ts +++ b/components/lib/stepper/stepper.d.ts @@ -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 @@ -134,4 +143,4 @@ export interface StepperProps { * * @group Component */ -export declare const Stepper: React.Component; +export declare const Stepper: React.ForwardRefExoticComponent & React.RefAttributes>; diff --git a/components/lib/stepperpanel/stepperpanel.d.ts b/components/lib/stepperpanel/stepperpanel.d.ts index 9d2d7ee040..80df027a21 100644 --- a/components/lib/stepperpanel/stepperpanel.d.ts +++ b/components/lib/stepperpanel/stepperpanel.d.ts @@ -155,4 +155,4 @@ export interface StepperPanelProps { * * @group Component */ -export declare const StepperPanel: React.Component; +export declare const StepperPanel: React.FC>;