react-calendar
Version:
Ultimate calendar for your React app.
57 lines (56 loc) • 2.85 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { formatMonthYear as defaultFormatMonthYear, formatYear as defaultFormatYear } from '../shared/dateFormatter';
import type { Action, NavigationLabelFunc, RangeType } from '../shared/types';
type NavigationProps = {
activeStartDate: Date;
drillUp: () => void;
formatMonthYear?: typeof defaultFormatMonthYear;
formatYear?: typeof defaultFormatYear;
locale?: string;
maxDate?: Date;
minDate?: Date;
navigationAriaLabel?: string;
navigationAriaLive?: 'off' | 'polite' | 'assertive';
navigationLabel?: NavigationLabelFunc;
next2AriaLabel?: string;
next2Label?: React.ReactNode;
nextAriaLabel?: string;
nextLabel?: React.ReactNode;
prev2AriaLabel?: string;
prev2Label?: React.ReactNode;
prevAriaLabel?: string;
prevLabel?: React.ReactNode;
setActiveStartDate: (nextActiveStartDate: Date, action: Action) => void;
showDoubleView?: boolean;
view: RangeType;
views: string[];
};
declare function Navigation({ activeStartDate, drillUp, formatMonthYear, formatYear, locale, maxDate, minDate, navigationAriaLabel, navigationAriaLive, navigationLabel, next2AriaLabel, next2Label, nextAriaLabel, nextLabel, prev2AriaLabel, prev2Label, prevAriaLabel, prevLabel, setActiveStartDate, showDoubleView, view, views, }: NavigationProps): JSX.Element;
declare namespace Navigation {
var propTypes: {
activeStartDate: PropTypes.Validator<Date>;
drillUp: PropTypes.Validator<(...args: any[]) => any>;
formatMonthYear: PropTypes.Requireable<(...args: any[]) => any>;
formatYear: PropTypes.Requireable<(...args: any[]) => any>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Requireable<Date>;
minDate: PropTypes.Requireable<Date>;
navigationAriaLabel: PropTypes.Requireable<string>;
navigationAriaLive: PropTypes.Requireable<string>;
navigationLabel: PropTypes.Requireable<(...args: any[]) => any>;
next2AriaLabel: PropTypes.Requireable<string>;
next2Label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
nextAriaLabel: PropTypes.Requireable<string>;
nextLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
prev2AriaLabel: PropTypes.Requireable<string>;
prev2Label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
prevAriaLabel: PropTypes.Requireable<string>;
prevLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
setActiveStartDate: PropTypes.Validator<(...args: any[]) => any>;
showDoubleView: PropTypes.Requireable<boolean>;
view: (props: Record<string, unknown>, propName: string, componentName: string) => Error | null;
views: PropTypes.Validator<(string | null | undefined)[]>;
};
}
export default Navigation;