UNPKG

1.26 kBTypeScriptView Raw
1import { Boundary } from "@blueprintjs/core";
2import { DateRange } from "./common/dateRange";
3export interface IDateRangeSelectionState {
4 /**
5 * The boundary that would be modified by clicking the provided `day`.
6 */
7 boundary?: Boundary;
8 /**
9 * The date range that would be selected after clicking the provided `day`.
10 */
11 dateRange: DateRange;
12}
13export declare class DateRangeSelectionStrategy {
14 /**
15 * Returns the new date-range and the boundary that would be affected if `day` were clicked. The
16 * affected boundary may be different from the provided `boundary` in some cases. For example,
17 * clicking a particular boundary's selected date will always deselect it regardless of which
18 * `boundary` you provide to this function (because it's simply a more intuitive interaction).
19 */
20 static getNextState(currentRange: DateRange, day: Date, allowSingleDayRange: boolean, boundary?: Boundary): IDateRangeSelectionState;
21 private static getNextStateForBoundary;
22 private static getDefaultNextState;
23 private static getOtherBoundary;
24 private static getBoundaryDate;
25 private static isOverlappingOtherBoundary;
26 private static createRangeForBoundary;
27 private static createRange;
28}