Skip to content

Commit

Permalink
export EventData/EventHandler from react-utilites
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanboXue-Amber committed Jan 10, 2024
1 parent c5d6a60 commit 4a28221
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export function createPriorityQueue<T>(compare: PriorityQueueCompareFn<T>): Prio
// @internal
export function elementContains(parent: Node | null, child: Node | null): boolean;

// @public
export type EventData<Type extends string, TEvent> = {
type: undefined;
event: React_2.SyntheticEvent | Event;
} | {
type: Type;
event: TEvent;
};

// @public
export type EventHandler<TData extends EventData<string, unknown>> = (ev: React_2.SyntheticEvent | Event, data: TData) => void;

// @public
export type ExtractSlotProps<S> = Exclude<S, SlotShorthandValue | null | undefined>;

Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/react-utilities/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export type {
SlotComponentType,
SlotOptions,
InferredElementRefType,
EventData,
EventHandler,
} from './compose/index';

export {
Expand Down

0 comments on commit 4a28221

Please sign in to comment.