context.d.ts 1.3 KB

123456789101112131415161718192021222324
  1. import * as React from 'react';
  2. import type { PanelMode, SharedPanelProps } from '../interface';
  3. export interface PanelContextProps<DateType extends object = any> extends Pick<SharedPanelProps<DateType>, 'prefixCls' | 'cellRender' | 'generateConfig' | 'locale' | 'onSelect' | 'hoverValue' | 'hoverRangeValue' | 'onHover' | 'values' | 'pickerValue' | 'disabledDate' | 'minDate' | 'maxDate' | 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon'> {
  4. /** Tell current panel type */
  5. panelType: PanelMode;
  6. now: DateType;
  7. }
  8. /** Used for each single Panel. e.g. DatePanel */
  9. export declare const PanelContext: React.Context<PanelContextProps<any>>;
  10. export declare function usePanelContext<DateType extends object = any>(): PanelContextProps<DateType>;
  11. /**
  12. * Get shared props for the SharedPanelProps interface.
  13. */
  14. export declare function useInfo<DateType extends object = any>(props: SharedPanelProps<DateType>, panelType: PanelMode): [sharedProps: PanelContextProps<DateType>, now: DateType];
  15. export interface PickerHackContextProps {
  16. hidePrev?: boolean;
  17. hideNext?: boolean;
  18. hideHeader?: boolean;
  19. onCellDblClick?: () => void;
  20. }
  21. /**
  22. * Internal usage for RangePicker to not to show the operation arrow
  23. */
  24. export declare const PickerHackContext: React.Context<PickerHackContextProps>;