@clubmed/trident-ui
Version:
Shared ClubMed React UI components
45 lines (44 loc) • 1.17 kB
TypeScript
import { RefObject } from 'react';
export declare const useActiveTab: () => number;
export declare const useTabDispatch: () => import('react').Dispatch<{
type: "update";
payload: number;
} | {
type: "unregister";
payload: {
value: number;
};
} | {
type: "start" | "end" | "previous" | "next";
} | {
type: "register";
payload: {
value: number;
ref: RefObject<HTMLElement>;
};
}>;
export declare const useTabsUid: () => string;
interface Props<T extends HTMLElement> {
value: number;
ref: RefObject<T>;
}
export declare function useRegisterTabControl<T extends HTMLElement>({ value, ref }: Props<T>): import('react').Dispatch<{
type: "update";
payload: number;
} | {
type: "unregister";
payload: {
value: number;
};
} | {
type: "start" | "end" | "previous" | "next";
} | {
type: "register";
payload: {
value: number;
ref: RefObject<HTMLElement>;
};
}>;
export declare const useTabControls: () => Map<number, RefObject<HTMLElement>>;
export declare const useActiveTabControl: () => readonly [number, RefObject<HTMLElement> | undefined];
export {};