react-chrono-multicard
Version:
A Modern Timeline component for React with multiple card entries
74 lines (73 loc) • 2.37 kB
TypeScript
/// <reference types="react" />
import { Theme } from './Theme';
import { TimelineItemModel, ICardModel } from './TimelineItemModel';
/**
* model internally used by the component
*
* @export
* @interface TimelineModel
* @extends {TimelineProps}
*/
export declare type TimelineModel = Pick<TimelineProps, 'items' | 'onItemSelected' | 'onRestartSlideshow' | 'theme' | 'slideShow' | 'onScrollEnd'> & {
activeTimelineItem: number;
cardDivider: JSX.Element;
cardTemplate: (c: ICardModel) => JSX.Element;
contentDetailsChildren?: React.ReactNode | React.ReactNode[];
iconChildren?: React.ReactNode | React.ReactNode[];
onFirst: () => void;
onLast: () => void;
onNext: () => void;
onOutlineSelection: (index: number) => void;
onPrevious: () => void;
onTimelineUpdated: (id: number) => void;
slideItemDuration?: number;
slideShowEnabled?: boolean;
slideShowRunning?: boolean;
};
/**
* Main props used by the host app.
*
* @export
* @interface TimelineProps
*/
export declare type TimelineProps = {
activeItemIndex?: number;
allowDynamicUpdate?: boolean;
borderLessCards?: boolean;
cardDivider?: JSX.Element;
cardHeight?: number;
cardLess?: boolean;
cardPositionHorizontal?: 'TOP' | 'BOTTOM';
cardTemplate?: (c: ICardModel) => JSX.Element;
cardWidth?: number;
children?: React.ReactElement | React.ReactElement[];
disableAutoScrollOnClick?: boolean;
disableClickOnCircle?: boolean;
disableNavOnKey?: boolean;
enableOutline?: boolean;
flipLayout?: boolean;
fontSizes?: {
cardSubtitle?: string;
cardText?: string;
cardTitle?: string;
title?: string;
};
hideControls?: boolean;
itemWidth?: number;
items?: TimelineItemModel[];
lineWidth?: number;
mode?: TimelineMode;
onItemSelected?: (data: TimelineItemModel) => void;
onRestartSlideshow?: () => void;
onScrollEnd?: () => void;
scrollable?: boolean | {
scrollbar: boolean;
};
showAllCardsHorizontal?: boolean;
slideItemDuration?: number;
slideShow?: boolean;
theme?: Theme;
timelineCircleDimension?: number;
useReadMore?: boolean;
};
export declare type TimelineMode = 'VERTICAL' | 'HORIZONTAL' | 'VERTICAL_ALTERNATING';