jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
62 lines (61 loc) • 2.26 kB
TypeScript
import React from 'react';
import type { CustomTimeViewProps, DateType, TimeConstraints, TimeScale } from '../../types';
interface CustomTimeViewState {
daypart: any;
hours: any;
counters: Array<DateType>;
[propName: string]: any;
}
declare class CustomTimeView extends React.Component<CustomTimeViewProps, CustomTimeViewState> {
static defaultProps: Partial<CustomTimeViewProps>;
padValues: {
readonly hours: 2;
readonly minutes: 2;
readonly seconds: 2;
readonly milliseconds: 3;
};
timeConstraints: Required<TimeConstraints>;
timer?: any;
increaseTimer?: any;
constructor(props: any);
componentDidMount(): void;
updateSelectedDate: (event: React.MouseEvent<any>) => void;
componentDidUpdate(preProps: CustomTimeViewProps): void;
onStartClicking(action: any, type: string): () => void;
updateMilli(e: any): void;
renderHeader(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | null;
toggleDayPart(type: 'hours'): string;
increase(type: TimeScale): string;
decrease(type: TimeScale): string;
pad(type: TimeScale, value: number): string;
disableContextMenu(event: React.MouseEvent<any>): boolean;
calculateState(props: CustomTimeViewProps): {
hours: number;
minutes: string;
seconds: string;
milliseconds: string;
daypart: any;
counters: DateType[];
};
renderDayPart: () => JSX.Element;
getCounterValue: (type: string) => number;
renderCounter: (type: TimeScale | "daypart") => JSX.Element | null;
onConfirm: (value: (number | string)[]) => void;
getDayPartOptions: () => {
text: string;
value: string;
}[];
onPickerChange: (value: (number | string)[], index: number) => void;
renderMobilePicker: () => JSX.Element;
setTime: (type: TimeScale, value: number) => void;
scrollToTop: (type: TimeScale, value: number, i: number, label?: string) => void;
selectNowTime: () => void;
confirm: () => void;
cancel: () => void;
computedTimeOptions(timeScale: TimeScale): {
label: string;
value: string;
}[];
render(): JSX.Element;
}
export default CustomTimeView;