source: trip-planner-front/node_modules/@angular/material/datepicker/date-range-selection-strategy.d.ts@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { InjectionToken, FactoryProvider } from '@angular/core';
9import { DateAdapter } from '@angular/material/core';
10import { DateRange } from './date-selection-model';
11/** Injection token used to customize the date range selection behavior. */
12export declare const MAT_DATE_RANGE_SELECTION_STRATEGY: InjectionToken<MatDateRangeSelectionStrategy<any>>;
13/** Object that can be provided in order to customize the date range selection behavior. */
14export interface MatDateRangeSelectionStrategy<D> {
15 /**
16 * Called when the user has finished selecting a value.
17 * @param date Date that was selected. Will be null if the user cleared the selection.
18 * @param currentRange Range that is currently show in the calendar.
19 * @param event DOM event that triggered the selection. Currently only corresponds to a `click`
20 * event, but it may get expanded in the future.
21 */
22 selectionFinished(date: D | null, currentRange: DateRange<D>, event: Event): DateRange<D>;
23 /**
24 * Called when the user has activated a new date (e.g. by hovering over
25 * it or moving focus) and the calendar tries to display a date range.
26 *
27 * @param activeDate Date that the user has activated. Will be null if the user moved
28 * focus to an element that's no a calendar cell.
29 * @param currentRange Range that is currently shown in the calendar.
30 * @param event DOM event that caused the preview to be changed. Will be either a
31 * `mouseenter`/`mouseleave` or `focus`/`blur` depending on how the user is navigating.
32 */
33 createPreview(activeDate: D | null, currentRange: DateRange<D>, event: Event): DateRange<D>;
34}
35/** Provides the default date range selection behavior. */
36export declare class DefaultMatCalendarRangeStrategy<D> implements MatDateRangeSelectionStrategy<D> {
37 private _dateAdapter;
38 constructor(_dateAdapter: DateAdapter<D>);
39 selectionFinished(date: D, currentRange: DateRange<D>): DateRange<D>;
40 createPreview(activeDate: D | null, currentRange: DateRange<D>): DateRange<D>;
41}
42/** @docs-private */
43export declare function MAT_CALENDAR_RANGE_STRATEGY_PROVIDER_FACTORY(parent: MatDateRangeSelectionStrategy<unknown>, adapter: DateAdapter<unknown>): MatDateRangeSelectionStrategy<unknown>;
44/** @docs-private */
45export declare const MAT_CALENDAR_RANGE_STRATEGY_PROVIDER: FactoryProvider;
Note: See TracBrowser for help on using the repository browser.