@solfacil/girassol
Version:
Girassol design system
25 lines (24 loc) • 914 B
TypeScript
import type { Args, Codes, NavigateGenericElement, NavigateInsideRow, UseNavigateArgs } from './types';
export declare function useNavigate(codes: Codes, args?: UseNavigateArgs): {
navigate: ({ code }: KeyboardEvent) => void;
};
export declare function useNavigateProvider({ target, query }: Args): {
elementFocus: {
id: string;
index: number;
rowIndex: number;
genericIndex: number;
};
isItemFocused: (arg: {
index?: number;
id?: string;
}) => boolean;
resetStateFocus: () => void;
focusListItem: (index?: number) => void;
focusOnPreviousItem: () => void;
focusOnNextItem: (dataLength: number) => void;
focusOnFirstItem: () => void;
focusOnLastItem: (dataLength: number) => void;
focusInsideRow: ({ query, to }: NavigateInsideRow) => void;
focusGenericElement: ({ query, to }: NavigateGenericElement) => void;
};