hwc
Version:
A react Headless Week Calendar toolkit to build calendars like Google Calendar.
22 lines (21 loc) • 937 B
TypeScript
import React from 'react';
import { HwcEvent } from '../types';
export declare type GripPosition = 'start' | 'end';
export declare type GripStyle = Pick<React.CSSProperties, 'height' | 'position' | 'cursor' | 'width' | 'top' | 'bottom'>;
export declare type GripMouseEvents = Required<Pick<React.ComponentProps<'div'>, 'onMouseDown'>>;
export declare type RenderGripProps<EvType extends HwcEvent> = {
event: EvType;
index: number;
style: GripStyle;
position: GripPosition;
elProps: GripMouseEvents & {
style: GripStyle;
};
};
export declare type GripRendererProps<EvType extends HwcEvent> = {
position: GripPosition;
index: number;
event: EvType;
renderGrip?: (props: RenderGripProps<EvType>) => React.ReactNode;
};
export declare const GripRenderer: <EvType extends HwcEvent>({ event, index, position, renderGrip, }: GripRendererProps<EvType>) => React.ReactElement;