anchor-context.ts 417 B

12345678910111213
  1. import React from 'react';
  2. import Anchor, { AnchorProps, AnchorState } from '.';
  3. export type AnchorContextType = Pick<AnchorProps, 'showTooltip' | 'position' | 'autoCollapse' | 'size'>
  4. & Pick<AnchorState, 'activeLink'>
  5. & Pick<Anchor, 'addLink' | 'removeLink' | 'childMap'>
  6. & {
  7. onClick: Anchor['handleClick'];
  8. };
  9. const AnchorContext = React.createContext<AnchorContextType>(null);
  10. export default AnchorContext;