activedescendant-key-manager.d-Bjic5obv.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. import { L as ListKeyManagerOption, a as ListKeyManager } from './list-key-manager.d-BlK3jyRn.js';
  2. /**
  3. * This is the interface for highlightable items (used by the ActiveDescendantKeyManager).
  4. * Each item must know how to style itself as active or inactive and whether or not it is
  5. * currently disabled.
  6. */
  7. interface Highlightable extends ListKeyManagerOption {
  8. /** Applies the styles for an active item to this item. */
  9. setActiveStyles(): void;
  10. /** Applies the styles for an inactive item to this item. */
  11. setInactiveStyles(): void;
  12. }
  13. declare class ActiveDescendantKeyManager<T> extends ListKeyManager<Highlightable & T> {
  14. /**
  15. * Sets the active item to the item at the specified index and adds the
  16. * active styles to the newly active item. Also removes active styles
  17. * from the previously active item.
  18. * @param index Index of the item to be set as active.
  19. */
  20. setActiveItem(index: number): void;
  21. /**
  22. * Sets the active item to the item to the specified one and adds the
  23. * active styles to the it. Also removes active styles from the
  24. * previously active item.
  25. * @param item Item to be set as active.
  26. */
  27. setActiveItem(item: T): void;
  28. }
  29. export { ActiveDescendantKeyManager as A };
  30. export type { Highlightable as H };