From 4f895962af644bd2cbc8efdc206d1f967d762585 Mon Sep 17 00:00:00 2001 From: tangwenhui1 Date: Sun, 30 Mar 2025 10:47:45 +0800 Subject: [PATCH] feat: update aria type --- src/interface.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/interface.ts b/src/interface.ts index 3cfa6b3..ec02414 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -13,6 +13,11 @@ export type SemanticName = | 'description' | 'mask'; + +export type HTMLAriaDataAttributes = React.AriaAttributes & { + [key: `data-${string}`]: unknown; +} & Pick, 'role'>; + export interface TourStepInfo { arrow?: boolean | { pointAtCenter: boolean }; target?: HTMLElement | (() => HTMLElement) | null | (() => null); @@ -30,7 +35,7 @@ export interface TourStepInfo { style?: CSSProperties; scrollIntoViewOptions?: boolean | ScrollIntoViewOptions; closeIcon?: ReactNode; - closable?: boolean | ({ closeIcon?: ReactNode } & React.AriaAttributes); + closable?: boolean | ({ closeIcon?: ReactNode } & HTMLAriaDataAttributes); } export interface TourStepProps extends TourStepInfo {