You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
5.9 KiB

{"version":3,"file":"date-selection-model.d.ts","sources":["date-selection-model.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { FactoryProvider, OnDestroy } from '@angular/core';\nimport { DateAdapter } from '@angular/material/core';\nimport { Observable } from 'rxjs';\n/** A class representing a range of dates. */\nexport declare class DateRange<D> {\n /** The start date of the range. */\n readonly start: D | null;\n /** The end date of the range. */\n readonly end: D | null;\n /**\n * Ensures that objects with a `start` and `end` property can't be assigned to a variable that\n * expects a `DateRange`\n */\n private _disableStructuralEquivalency;\n constructor(\n /** The start date of the range. */\n start: D | null, \n /** The end date of the range. */\n end: D | null);\n}\n/**\n * Conditionally picks the date type, if a DateRange is passed in.\n * @docs-private\n */\nexport declare type ExtractDateTypeFromSelection<T> = T extends DateRange<infer D> ? D : NonNullable<T>;\n/**\n * Event emitted by the date selection model when its selection changes.\n * @docs-private\n */\nexport interface DateSelectionModelChange<S> {\n /** New value for the selection. */\n selection: S;\n /** Object that triggered the change. */\n source: unknown;\n /** Previous value */\n oldValue?: S;\n}\n/**\n * A selection model containing a date selection.\n * @docs-private\n */\nexport declare abstract class MatDateSelectionModel<S, D = ExtractDateTypeFromSelection<S>> implements OnDestroy {\n /** The current selection. */\n readonly selection: S;\n protected _adapter: DateAdapter<D>;\n private readonly _selectionChanged;\n /** Emits when the selection has changed. */\n selectionChanged: Observable<DateSelectionModelChange<S>>;\n protected constructor(\n /** The current selection. */\n selection: S, _adapter: DateAdapter<D>);\n /**\n * Updates the current selection in the model.\n * @param value New selection that should be assigned.\n * @param source Object that triggered the selection change.\n */\n updateSelection(value: S, source: unknown): void;\n ngOnDestroy(): void;\n protected _isValidDateInstance(date: D): boolean;\n /** Adds a date to the current selection. */\n abstract add(date: D | null): void;\n /** Checks whether the current selection is valid. */\n abstract isValid(): boolean;\n /** Checks whether the current selection is complete. */\n abstract isComplete(): boolean;\n /** Clones the selection model. */\n abstract clone(): MatDateSelectionModel<S, D>;\n}\n/**\n * A selection model that contains a single date.\n * @docs-private\n */\nexport declare class MatSingleDateSelectionModel<D> extends MatDateSelectionModel<D | null, D> {\n constructor(adapter: DateAdapter<D>);\n /**\n * Adds a date to the current selection. In the case of a single date selection, the added date\n * simply overwrites the previous selection\n */\n add(date: D | null): void;\n /** Checks whether the current selection is valid. */\n isValid(): boolean;\n /**\n * Checks whether the current selection is complete. In the case of a single date selection, this\n * is true if the current selection is not null.\n */\n isComplete(): boolean;\n /** Clones the selection model. */\n clone(): MatSingleDateSelectionModel<D>;\n}\n/**\n * A selection model that contains a date range.\n * @docs-private\n */\nexport declare class MatRangeDateSelectionModel<D> extends MatDateSelectionModel<DateRange<D>, D> {\n constructor(adapter: DateAdapter<D>);\n /**\n * Adds a date to the current selection. In the case of a date range selection, the added date\n * fills in the next `null` value in the range. If both the start and the end already have a date,\n * the selection is reset so that the given date is the new `start` and the `end` is null.\n */\n add(date: D | null): void;\n /** Checks whether the current selection is valid. */\n isValid(): boolean;\n /**\n * Checks whether the current selection is complete. In the case of a date range selection, this\n * is true if the current selection has a non-null `start` and `end`.\n */\n isComplete(): boolean;\n /** Clones the selection model. */\n clone(): MatRangeDateSelectionModel<D>;\n}\n/** @docs-private */\nexport declare function MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY(parent: MatSingleDateSelectionModel<unknown>, adapter: DateAdapter<unknown>): MatSingleDateSelectionModel<unknown>;\n/**\n * Used to provide a single selection model to a component.\n * @docs-private\n */\nexport declare const MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider;\n/** @docs-private */\nexport declare function MAT_RANGE_DATE_SELECTION_MODEL_FACTORY(parent: MatSingleDateSelectionModel<unknown>, adapter: DateAdapter<unknown>): MatSingleDateSelectionModel<unknown>;\n/**\n * Used to provide a range selection model to a component.\n * @docs-private\n */\nexport declare const MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider;\n"]}