This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
date-time.d.ts
176 lines (157 loc) · 4.82 KB
/
date-time.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/**
* DO NOT EDIT
*
* This file was automatically generated by
* https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
*
* To modify these typings, edit the source file(s):
* date-time.js
*/
// tslint:disable:variable-name Describing an API that's defined elsewhere.
// tslint:disable:no-any describes the API as best we are able today
declare namespace UiElements {
/**
* An element to display formatted date and time.
*
* The `date` propery accepts Date object, Number as a timestamp or string
* that will be parsed to the Date object.
*
* This element uses the `Intl` interface which is available in IE 11+ browsers.
*
* To format the date use [Intl.DateTimeFormat]
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)
* inteface options.
*
* The default value for each date-time component property is undefined,
* but if all component properties are undefined, then year, month, and day
* are assumed to be "numeric" (per spec).
*
* ### Example
*
* ```html
* <date-time date="2010-12-10T11:50:45Z" year="numeric" month="narrow" day="numeric"></date-time>
* ```
*
* The element provides accessibility by using the `time` element and setting
* the `datetime` attribute on it.
*
* ### Styling
*
* `<date-time>` provides the following custom properties and mixins for styling:
*
* Custom property | Description | Default
* ----------------|-------------|----------
* `--date-time` | Mixin applied to the element | `{}`
*
* @deprecated Use the `@anypoint-web-components/awc` module instead.
*/
class DateTime extends HTMLElement {
/**
* A string with a BCP 47 language tag, or an array of such strings.
* For the general form and interpretation of the locales argument,
* see the Intl page.
* The following Unicode extension keys are allowed:
* - nu - Numbering system. Possible values include: "arab", "arabext",
* "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr",
* "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya",
* "tamldec", "telu", "thai", "tibt".
* - ca - Calendar. Possible values include: "buddhist", "chinese",
* "coptic", "ethioaa", "ethiopic", "gregory", "hebrew", "indian",
* "islamic", "islamicc", "iso8601", "japanese", "persian", "roc".
*/
locales: any;
/**
* The representation of the year.
* Possible values are "numeric", "2-digit".
*
*/
year: any;
/**
* The representation of the month.
* Possible values are "numeric", "2-digit", "narrow", "short", "long".
*
*/
month: any;
/**
* The representation of the day.
* Possible values are "numeric", "2-digit".
*
*/
day: any;
/**
* The representation of the hour.
* Possible values are "numeric", "2-digit".
*
*/
hour: any;
/**
* The representation of the minute.
* Possible values are "numeric", "2-digit".
*
*/
minute: any;
/**
* The representation of the second.
* Possible values are "numeric", "2-digit".
*
*/
second: any;
/**
* The representation of the weekday.
* Possible values are "narrow", "short", "long".
*
*/
weekday: any;
/**
* The representation of the time zone name.
*
* Possible values are "short", "long".
*
*/
timeZoneName: any;
/**
* The time zone to use. The only value implementations must recognize
* is "UTC"; the default is the runtime's default time zone.
* Implementations may also recognize the time zone names of the IANA
* time zone database, such as "Asia/Shanghai", "Asia/Kolkata",
* "America/New_York".
*
*/
timeZone: any;
/**
* The representation of the era.
*
* Possible values are "narrow", "short", "long".
*
*/
era: any;
/**
* Whether to use 12-hour time (as opposed to 24-hour time).
* Possible values are `true` and `false`; the default is locale
* dependent.
*/
hour12: any;
/**
* A date object to render.
* It can be a `Date` object, number representing a timestamp
* or valid date string. The argument is parsed by `Date` constructor
* to produce the value.
*/
date: any;
connectedCallback(): void;
disconnectedCallback(): void;
attributeChangedCallback(): void;
/**
* Parses input `date` to a Date object.
*
* @param date A date to parse
*/
_getParsableDate(date: String|Number|Date|null): Date|null;
_getIntlOptions(): any;
_updateLabel(): void;
_setIso(v: any): void;
}
}
interface HTMLElementTagNameMap {
"date-time": UiElements.DateTime;
}