Skip to content

Commit 2e7c83a

Browse files
Updated LKG.
1 parent a633652 commit 2e7c83a

20 files changed

+253611
-190864
lines changed

lib/lib.d.ts

+150-108
Large diffs are not rendered by default.

lib/lib.dom.d.ts

+55-15
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ interface KeyAlgorithm {
142142
}
143143

144144
interface KeyboardEventInit extends EventModifierInit {
145+
code?: string;
145146
key?: string;
146147
location?: number;
147148
repeat?: boolean;
@@ -2304,7 +2305,7 @@ declare var DeviceRotationRate: {
23042305
new(): DeviceRotationRate;
23052306
}
23062307

2307-
interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent {
2308+
interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode {
23082309
/**
23092310
* Sets or gets the URL for the current document.
23102311
*/
@@ -3367,7 +3368,7 @@ declare var Document: {
33673368
new(): Document;
33683369
}
33693370

3370-
interface DocumentFragment extends Node, NodeSelector {
3371+
interface DocumentFragment extends Node, NodeSelector, ParentNode {
33713372
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
33723373
}
33733374

@@ -3436,7 +3437,7 @@ declare var EXT_texture_filter_anisotropic: {
34363437
readonly TEXTURE_MAX_ANISOTROPY_EXT: number;
34373438
}
34383439

3439-
interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode {
3440+
interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode {
34403441
readonly classList: DOMTokenList;
34413442
className: string;
34423443
readonly clientHeight: number;
@@ -3691,6 +3692,16 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
36913692
getElementsByClassName(classNames: string): NodeListOf<Element>;
36923693
matches(selector: string): boolean;
36933694
closest(selector: string): Element | null;
3695+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
3696+
scroll(options?: ScrollToOptions): void;
3697+
scroll(x: number, y: number): void;
3698+
scrollTo(options?: ScrollToOptions): void;
3699+
scrollTo(x: number, y: number): void;
3700+
scrollBy(options?: ScrollToOptions): void;
3701+
scrollBy(x: number, y: number): void;
3702+
insertAdjacentElement(position: string, insertedElement: Element): Element | null;
3703+
insertAdjacentHTML(where: string, html: string): void;
3704+
insertAdjacentText(where: string, text: string): void;
36943705
addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
36953706
addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
36963707
addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -4462,7 +4473,7 @@ interface HTMLCanvasElement extends HTMLElement {
44624473
* @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
44634474
*/
44644475
toDataURL(type?: string, ...args: any[]): string;
4465-
toBlob(callback: (result: Blob | null) => void, ... arguments: any[]): void;
4476+
toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;
44664477
}
44674478

44684479
declare var HTMLCanvasElement: {
@@ -4637,11 +4648,7 @@ interface HTMLElement extends Element {
46374648
click(): void;
46384649
dragDrop(): boolean;
46394650
focus(): void;
4640-
insertAdjacentElement(position: string, insertedElement: Element): Element;
4641-
insertAdjacentHTML(where: string, html: string): void;
4642-
insertAdjacentText(where: string, text: string): void;
46434651
msGetInputContext(): MSInputMethodContext;
4644-
scrollIntoView(top?: boolean): void;
46454652
setActive(): void;
46464653
addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
46474654
addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -5906,6 +5913,7 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle {
59065913
*/
59075914
type: string;
59085915
import?: Document;
5916+
integrity: string;
59095917
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
59105918
}
59115919

@@ -6194,7 +6202,7 @@ interface HTMLMediaElement extends HTMLElement {
61946202
*/
61956203
canPlayType(type: string): string;
61966204
/**
6197-
* Fires immediately after the client loads the object.
6205+
* Resets the audio or video object and loads a new media resource.
61986206
*/
61996207
load(): void;
62006208
/**
@@ -6767,6 +6775,7 @@ interface HTMLScriptElement extends HTMLElement {
67676775
* Sets or retrieves the MIME type for the associated scripting engine.
67686776
*/
67696777
type: string;
6778+
integrity: string;
67706779
}
67716780

67726781
declare var HTMLScriptElement: {
@@ -7772,6 +7781,7 @@ interface KeyboardEvent extends UIEvent {
77727781
readonly repeat: boolean;
77737782
readonly shiftKey: boolean;
77747783
readonly which: number;
7784+
readonly code: string;
77757785
getModifierState(keyArg: string): boolean;
77767786
initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;
77777787
readonly DOM_KEY_LOCATION_JOYSTICK: number;
@@ -9144,6 +9154,7 @@ interface PerformanceTiming {
91449154
readonly responseStart: number;
91459155
readonly unloadEventEnd: number;
91469156
readonly unloadEventStart: number;
9157+
readonly secureConnectionStart: number;
91479158
toJSON(): any;
91489159
}
91499160

@@ -11421,8 +11432,8 @@ declare var StereoPannerNode: {
1142111432
interface Storage {
1142211433
readonly length: number;
1142311434
clear(): void;
11424-
getItem(key: string): string;
11425-
key(index: number): string;
11435+
getItem(key: string): string | null;
11436+
key(index: number): string | null;
1142611437
removeItem(key: string): void;
1142711438
setItem(key: string, data: string): void;
1142811439
[key: string]: any;
@@ -12963,7 +12974,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1296312974
onunload: (this: this, ev: Event) => any;
1296412975
onvolumechange: (this: this, ev: Event) => any;
1296512976
onwaiting: (this: this, ev: Event) => any;
12966-
readonly opener: Window;
12977+
opener: any;
1296712978
orientation: string | number;
1296812979
readonly outerHeight: number;
1296912980
readonly outerWidth: number;
@@ -13018,6 +13029,9 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1301813029
webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
1301913030
webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
1302013031
webkitRequestAnimationFrame(callback: FrameRequestCallback): number;
13032+
scroll(options?: ScrollToOptions): void;
13033+
scrollTo(options?: ScrollToOptions): void;
13034+
scrollBy(options?: ScrollToOptions): void;
1302113035
addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
1302213036
addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
1302313037
addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
@@ -14045,6 +14059,20 @@ interface ProgressEventInit extends EventInit {
1404514059
total?: number;
1404614060
}
1404714061

14062+
interface ScrollOptions {
14063+
behavior?: ScrollBehavior;
14064+
}
14065+
14066+
interface ScrollToOptions extends ScrollOptions {
14067+
left?: number;
14068+
top?: number;
14069+
}
14070+
14071+
interface ScrollIntoViewOptions extends ScrollOptions {
14072+
block?: ScrollLogicalPosition;
14073+
inline?: ScrollLogicalPosition;
14074+
}
14075+
1404814076
interface ClipboardEventInit extends EventInit {
1404914077
data?: string;
1405014078
dataType?: string;
@@ -14088,7 +14116,7 @@ interface EcdsaParams extends Algorithm {
1408814116
}
1408914117

1409014118
interface EcKeyGenParams extends Algorithm {
14091-
typedCurve: string;
14119+
namedCurve: string;
1409214120
}
1409314121

1409414122
interface EcKeyAlgorithm extends KeyAlgorithm {
@@ -14224,6 +14252,13 @@ interface JsonWebKey {
1422414252
k?: string;
1422514253
}
1422614254

14255+
interface ParentNode {
14256+
readonly children: HTMLCollection;
14257+
readonly firstElementChild: Element;
14258+
readonly lastElementChild: Element;
14259+
readonly childElementCount: number;
14260+
}
14261+
1422714262
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1422814263

1422914264
interface ErrorEventHandler {
@@ -14294,7 +14329,7 @@ declare var location: Location;
1429414329
declare var locationbar: BarProp;
1429514330
declare var menubar: BarProp;
1429614331
declare var msCredentials: MSCredentials;
14297-
declare var name: string;
14332+
declare const name: never;
1429814333
declare var navigator: Navigator;
1429914334
declare var offscreenBuffering: string | boolean;
1430014335
declare var onabort: (this: Window, ev: UIEvent) => any;
@@ -14388,7 +14423,7 @@ declare var ontouchstart: (ev: TouchEvent) => any;
1438814423
declare var onunload: (this: Window, ev: Event) => any;
1438914424
declare var onvolumechange: (this: Window, ev: Event) => any;
1439014425
declare var onwaiting: (this: Window, ev: Event) => any;
14391-
declare var opener: Window;
14426+
declare var opener: any;
1439214427
declare var orientation: string | number;
1439314428
declare var outerHeight: number;
1439414429
declare var outerWidth: number;
@@ -14441,6 +14476,9 @@ declare function webkitCancelAnimationFrame(handle: number): void;
1444114476
declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
1444214477
declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
1444314478
declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;
14479+
declare function scroll(options?: ScrollToOptions): void;
14480+
declare function scrollTo(options?: ScrollToOptions): void;
14481+
declare function scrollBy(options?: ScrollToOptions): void;
1444414482
declare function toString(): string;
1444514483
declare function addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
1444614484
declare function dispatchEvent(evt: Event): boolean;
@@ -14596,6 +14634,8 @@ type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;
1459614634
type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete;
1459714635
type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
1459814636
type payloadtype = number;
14637+
type ScrollBehavior = "auto" | "instant" | "smooth";
14638+
type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
1459914639
type IDBValidKey = number | string | Date | IDBArrayKey;
1460014640
type BufferSource = ArrayBuffer | ArrayBufferView;
1460114641
type MouseWheelEvent = WheelEvent;

lib/lib.dom.iterable.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
/// <reference no-default-lib="true"/>
17-
/// <reference path="lib.dom.generated.d.ts" />
17+
/// <reference path="lib.dom.d.ts" />
1818

1919
interface DOMTokenList {
2020
[Symbol.iterator](): IterableIterator<string>;

lib/lib.es2015.collection.d.ts

+17-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ and limitations under the License.
1717
interface Map<K, V> {
1818
clear(): void;
1919
delete(key: K): boolean;
20-
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
20+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
2121
get(key: K): V | undefined;
2222
has(key: K): boolean;
23-
set(key: K, value: V): this;
23+
set(key: K, value?: V): this;
2424
readonly size: number;
2525
}
2626

@@ -31,12 +31,18 @@ interface MapConstructor {
3131
}
3232
declare var Map: MapConstructor;
3333

34+
interface ReadonlyMap<K, V> {
35+
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
36+
get(key: K): V|undefined;
37+
has(key: K): boolean;
38+
readonly size: number;
39+
}
40+
3441
interface WeakMap<K, V> {
35-
clear(): void;
3642
delete(key: K): boolean;
3743
get(key: K): V | undefined;
3844
has(key: K): boolean;
39-
set(key: K, value: V): this;
45+
set(key: K, value?: V): this;
4046
}
4147

4248
interface WeakMapConstructor {
@@ -50,7 +56,7 @@ interface Set<T> {
5056
add(value: T): this;
5157
clear(): void;
5258
delete(value: T): boolean;
53-
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
59+
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
5460
has(value: T): boolean;
5561
readonly size: number;
5662
}
@@ -62,9 +68,14 @@ interface SetConstructor {
6268
}
6369
declare var Set: SetConstructor;
6470

71+
interface ReadonlySet<T> {
72+
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
73+
has(value: T): boolean;
74+
readonly size: number;
75+
}
76+
6577
interface WeakSet<T> {
6678
add(value: T): this;
67-
clear(): void;
6879
delete(value: T): boolean;
6980
has(value: T): boolean;
7081
}

lib/lib.es2015.core.d.ts

+32-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ interface Array<T> {
2929
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T | undefined;
3030

3131
/**
32-
* Returns the index of the first element in the array where predicate is true, and undefined
32+
* Returns the index of the first element in the array where predicate is true, and -1
3333
* otherwise.
3434
* @param predicate find calls predicate once for each element of the array, in ascending
35-
* order, until it finds one where predicate returns true. If such an element is found,
35+
* order, until it finds one where predicate returns true. If such an element is found,
3636
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3737
* @param thisArg If provided, it will be used as the this value for each invocation of
3838
* predicate. If it is not provided, undefined is used instead.
3939
*/
40-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
40+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
4141

4242
/**
4343
* Returns the this object after filling the section identified by start and end with value
@@ -84,6 +84,10 @@ interface ArrayConstructor {
8484
of<T>(...items: T[]): Array<T>;
8585
}
8686

87+
interface DateConstructor {
88+
new (value: Date): Date;
89+
}
90+
8791
interface Function {
8892
/**
8993
* Returns the name of the function. Function names are read-only and can not be changed.
@@ -242,7 +246,7 @@ interface NumberConstructor {
242246
/**
243247
* The value of the largest integer n such that n and n + 1 are both exactly representable as
244248
* a Number value.
245-
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
249+
* The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
246250
*/
247251
readonly MAX_SAFE_INTEGER: number;
248252

@@ -359,6 +363,30 @@ interface ObjectConstructor {
359363
defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
360364
}
361365

366+
interface ReadonlyArray<T> {
367+
/**
368+
* Returns the value of the first element in the array where predicate is true, and undefined
369+
* otherwise.
370+
* @param predicate find calls predicate once for each element of the array, in ascending
371+
* order, until it finds one where predicate returns true. If such an element is found, find
372+
* immediately returns that element value. Otherwise, find returns undefined.
373+
* @param thisArg If provided, it will be used as the this value for each invocation of
374+
* predicate. If it is not provided, undefined is used instead.
375+
*/
376+
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
377+
378+
/**
379+
* Returns the index of the first element in the array where predicate is true, and -1
380+
* otherwise.
381+
* @param predicate find calls predicate once for each element of the array, in ascending
382+
* order, until it finds one where predicate returns true. If such an element is found,
383+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
384+
* @param thisArg If provided, it will be used as the this value for each invocation of
385+
* predicate. If it is not provided, undefined is used instead.
386+
*/
387+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
388+
}
389+
362390
interface RegExp {
363391
/**
364392
* Returns a string indicating the flags of the regular expression in question. This field is read-only.

lib/lib.es2015.iterable.d.ts

+20
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,26 @@ interface ArrayConstructor {
7979
from<T>(iterable: Iterable<T>): Array<T>;
8080
}
8181

82+
interface ReadonlyArray<T> {
83+
/** Iterator */
84+
[Symbol.iterator](): IterableIterator<T>;
85+
86+
/**
87+
* Returns an array of key, value pairs for every entry in the array
88+
*/
89+
entries(): IterableIterator<[number, T]>;
90+
91+
/**
92+
* Returns an list of keys in the array
93+
*/
94+
keys(): IterableIterator<number>;
95+
96+
/**
97+
* Returns an list of values in the array
98+
*/
99+
values(): IterableIterator<T>;
100+
}
101+
82102
interface IArguments {
83103
/** Iterator */
84104
[Symbol.iterator](): IterableIterator<any>;

0 commit comments

Comments
 (0)