1 | import type { LitElement, PropertyValues } from 'lit';
|
2 | import type { DateTimeFormatter } from 'nodemod/dist/calendar/typings.js';
|
3 | import type { startViews } from './constants.js';
|
4 | import type { DatePicker } from './date-picker/date-picker.js';
|
5 | import type { keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnd, keyEnter, keyHome, keyPageDown, keyPageUp, keySpace, keyTab } from './key-values.js';
|
6 | import type { DatePickerMinMaxProperties, DatePickerMixinProperties, ElementMixinProperties } from './mixins/typings.js';
|
7 | import type { Constructor } from './utility-typings.js';
|
8 | export type ChangedProperties<T = Record<string, unknown>> = PropertyValues & Map<keyof T, T[keyof T]>;
|
9 | export interface CustomEventAction<T extends string, CustomEventDetail> {
|
10 | detail: CustomEventDetail;
|
11 | type: T;
|
12 | }
|
13 | export interface CustomEventDetail {
|
14 | ['date-updated']: CustomEventAction<'date-updated', CustomEventDetailDateUpdated>;
|
15 | ['first-updated']: CustomEventAction<'first-updated', CustomEventDetailFirstUpdated>;
|
16 | ['year-updated']: CustomEventAction<'year-updated', CustomEventDetailYearUpdated>;
|
17 | }
|
18 | interface CustomEventDetailDateUpdated extends KeyEvent, DatePickerValues {
|
19 | }
|
20 | interface CustomEventDetailFirstUpdated extends DatePickerValues {
|
21 | focusableElements: HTMLElement[];
|
22 | }
|
23 | interface CustomEventDetailYearUpdated {
|
24 | year: number;
|
25 | }
|
26 | export interface DatePickerProperties extends DatePickerMinMaxProperties, DatePickerMixinProperties, ElementMixinProperties {
|
27 | }
|
28 | type DatePickerValues = Required<Pick<DatePicker, 'value' | 'valueAsDate' | 'valueAsNumber'>>;
|
29 | export interface Formatters extends Pick<DatePicker, 'locale'> {
|
30 | dayFormat: DateTimeFormatter;
|
31 | fullDateFormat: DateTimeFormatter;
|
32 | longWeekdayFormat: DateTimeFormatter;
|
33 | narrowWeekdayFormat: DateTimeFormatter;
|
34 | longMonthFormat: DateTimeFormatter;
|
35 | longMonthYearFormat: DateTimeFormatter;
|
36 | dateFormat: DateTimeFormatter;
|
37 | yearFormat: DateTimeFormatter;
|
38 | }
|
39 | export type InferredFromSet<SetType> = SetType extends Set<infer T> ? T : never;
|
40 | interface KeyEvent {
|
41 | isKeypress: boolean;
|
42 | key?: SupportedKey;
|
43 | }
|
44 | export type LitConstructor = Constructor<LitElement>;
|
45 | export type StartView = StartViewTuple[number];
|
46 | export type StartViewTuple = typeof startViews;
|
47 | export type SupportedKey = typeof keyArrowDown | typeof keyArrowLeft | typeof keyArrowRight | typeof keyArrowUp | typeof keyEnd | typeof keyEnter | typeof keyHome | typeof keyPageDown | typeof keyPageUp | typeof keySpace | typeof keyTab;
|
48 | export interface ValueUpdatedEvent extends KeyEvent {
|
49 | value: string;
|
50 | }
|
51 | export {};
|
52 |
|
\ | No newline at end of file |