@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
17 lines (16 loc) • 940 B
TypeScript
import React from 'react';
import { ListContextValue } from './List.types';
import { ListItemBaseIndex } from '../ListItemBase/ListItemBase.types';
export declare const ListContext: React.Context<ListContextValue>;
export declare const useListContext: () => ListContextValue;
/**
* Calculate the next (or previous) index of a list
*
* @param isBackward Increase or decrease the index
* @param listSize List size
* @param currentFocus Current index
* @param noLoop loop back to the front or the back of the list
* @param allItemIndexes available indexes in order
*/
export declare const setNextFocus: (currentFocus: ListItemBaseIndex, listSize: number, isBackward: boolean, noLoop: boolean, allItemIndexes: ListItemBaseIndex[]) => ListItemBaseIndex;
export declare const onCurrentFocusNotFound: (currentFocus: ListItemBaseIndex, allItemIndexes: ListItemBaseIndex[], previousAllItemIndexes: ListItemBaseIndex[]) => ListItemBaseIndex;