Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: typescript @ 3.3.4000 .. 3.4.1

lib/lib.dom.d.ts

@@ -203,6 +203,10 @@
type?: ClientTypes;
}
+interface ClipboardEventInit extends EventInit {
+ clipboardData?: DataTransfer | null;
+}
+
interface CloseEventInit extends EventInit {
code?: number;
reason?: string;
@@ -448,6 +452,10 @@
shiftKey?: boolean;
}
+interface EventSourceInit {
+ withCredentials?: boolean;
+}
+
interface ExceptionInformation {
domain?: string | null;
}
@@ -479,12 +487,16 @@
preventScroll?: boolean;
}
+interface FullscreenOptions {
+ navigationUI?: FullscreenNavigationUI;
+}
+
interface GainOptions extends AudioNodeOptions {
gain?: number;
}
interface GamepadEventInit extends EventInit {
- gamepad?: Gamepad;
+ gamepad: Gamepad;
}
interface GetNotificationOptions {
@@ -619,15 +631,17 @@
}
interface MediaKeyMessageEventInit extends EventInit {
- message?: ArrayBuffer | null;
- messageType?: MediaKeyMessageType;
+ message: ArrayBuffer;
+ messageType: MediaKeyMessageType;
}
interface MediaKeySystemConfiguration {
audioCapabilities?: MediaKeySystemMediaCapability[];
distinctiveIdentifier?: MediaKeysRequirement;
initDataTypes?: string[];
+ label?: string;
persistentState?: MediaKeysRequirement;
+ sessionTypes?: string[];
videoCapabilities?: MediaKeySystemMediaCapability[];
}
@@ -744,6 +758,8 @@
buttons?: number;
clientX?: number;
clientY?: number;
+ movementX?: number;
+ movementY?: number;
relatedTarget?: EventTarget | null;
screenX?: number;
screenY?: number;
@@ -1462,6 +1478,11 @@
source?: ServiceWorker | MessagePort | null;
}
+interface ShadowRootInit {
+ delegatesFocus?: boolean;
+ mode: ShadowRootMode;
+}
+
interface StereoPannerOptions extends AudioNodeOptions {
pan?: number;
}
@@ -1629,6 +1650,7 @@
(evt: Event): void;
}
+/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */
interface ANGLE_instanced_arrays {
drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;
drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;
@@ -1636,6 +1658,7 @@
readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;
}
+/** The AbortController interface represents a controller object that allows you to abort one or more DOM requests as and when desired. */
interface AbortController {
/**
* Returns the AbortSignal object associated with this object.
@@ -1654,16 +1677,17 @@
};
interface AbortSignalEventMap {
- "abort": ProgressEvent;
+ "abort": Event;
}
+/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
interface AbortSignal extends EventTarget {
/**
* Returns true if this AbortSignal's AbortController has signaled to abort, and false
* otherwise.
*/
readonly aborted: boolean;
- onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null;
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -1708,6 +1732,7 @@
length: number;
}
+/** The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. */
interface AnalyserNode extends AudioNode {
fftSize: number;
readonly frequencyBinCount: number;
@@ -1776,6 +1801,7 @@
new(): AnimationEffect;
};
+/** The AnimationEvent interface represents events providing information related to animations. */
interface AnimationEvent extends Event {
readonly animationName: string;
readonly elapsedTime: number;
@@ -1865,6 +1891,7 @@
readonly UPDATEREADY: number;
};
+/** This type represents a DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. */
interface Attr extends Node {
readonly localName: string;
readonly name: string;
@@ -1880,6 +1907,7 @@
new(): Attr;
};
+/** Objects of these types are designed to hold small audio snippets, typically less than 45 s. For longer sounds, objects implementing the MediaElementAudioSourceNode are more suitable. The buffer contains data in the following format:  non-interleaved IEEE754 32-bit linear PCM with a nominal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. If the AudioBuffer has multiple channels, they are stored in separate buffer. */
interface AudioBuffer {
readonly duration: number;
readonly length: number;
@@ -1895,6 +1923,7 @@
new(options: AudioBufferOptions): AudioBuffer;
};
+/** The AudioBufferSourceNode interface is an AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. */
interface AudioBufferSourceNode extends AudioScheduledSourceNode {
buffer: AudioBuffer | null;
readonly detune: AudioParam;
@@ -1914,6 +1943,7 @@
new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode;
};
+/** The AudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode. */
interface AudioContext extends BaseAudioContext {
readonly baseLatency: number;
readonly outputLatency: number;
@@ -1935,6 +1965,7 @@
new(contextOptions?: AudioContextOptions): AudioContext;
};
+/** AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. */
interface AudioDestinationNode extends AudioNode {
readonly maxChannelCount: number;
}
@@ -1944,6 +1975,7 @@
new(): AudioDestinationNode;
};
+/** The AudioListener interface represents the position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. */
interface AudioListener {
readonly forwardX: AudioParam;
readonly forwardY: AudioParam;
@@ -1965,6 +1997,7 @@
new(): AudioListener;
};
+/** The AudioNode interface is a generic interface for representing an audio processing module. Examples include: */
interface AudioNode extends EventTarget {
channelCount: number;
channelCountMode: ChannelCountMode;
@@ -1988,6 +2021,7 @@
new(): AudioNode;
};
+/** The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). */
interface AudioParam {
automationRate: AutomationRate;
readonly defaultValue: number;
@@ -2017,6 +2051,7 @@
new(): AudioParamMap;
};
+/** The Web Audio API AudioProcessingEvent represents events that occur when a ScriptProcessorNode input buffer is ready to be processed. */
interface AudioProcessingEvent extends Event {
readonly inputBuffer: AudioBuffer;
readonly outputBuffer: AudioBuffer;
@@ -2047,13 +2082,14 @@
new(): AudioScheduledSourceNode;
};
+/** The AudioTrack interface represents a single audio track from one of the HTML media elements, <audio> or <video>. */
interface AudioTrack {
enabled: boolean;
readonly id: string;
kind: string;
readonly label: string;
language: string;
- readonly sourceBuffer: SourceBuffer;
+ readonly sourceBuffer: SourceBuffer | null;
}
declare var AudioTrack: {
@@ -2067,6 +2103,7 @@
"removetrack": TrackEvent;
}
+/** The AudioTrackList interface is used to represent a list of the audio tracks contained within a given HTML media element, with each track represented by a separate AudioTrack object in the list. */
interface AudioTrackList extends EventTarget {
readonly length: number;
onaddtrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;
@@ -2165,6 +2202,7 @@
new(): BaseAudioContext;
};
+/** The beforeunload event is fired when the window, the document and its resources are about to be unloaded. */
interface BeforeUnloadEvent extends Event {
returnValue: any;
}
@@ -2196,6 +2234,7 @@
new(): BhxBrowser;
};
+/** The BiquadFilterNode interface represents a simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. */
interface BiquadFilterNode extends AudioNode {
readonly Q: AudioParam;
readonly detune: AudioParam;
@@ -2210,6 +2249,7 @@
new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode;
};
+/** A Blob object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */
interface Blob {
readonly size: number;
readonly type: string;
@@ -2267,6 +2307,7 @@
messageerror: MessageEvent;
}
+/** The ByteLengthQueuingStrategy interface of the the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. */
interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
highWaterMark: number;
size(chunk: ArrayBufferView): number;
@@ -2277,6 +2318,7 @@
new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
};
+/** The CDATASection interface represents a CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. */
interface CDATASection extends Text {
}
@@ -2285,12 +2327,14 @@
new(): CDATASection;
};
+/** The CSS interface holds useful CSS-related methods. No object with this interface are implemented: it contains only static methods and therefore is a utilitarian interface. */
interface CSS {
escape(value: string): string;
supports(property: string, value?: string): boolean;
}
declare var CSS: CSS;
+/** An object implementing the CSSConditionRule interface represents a single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */
interface CSSConditionRule extends CSSGroupingRule {
conditionText: string;
}
@@ -2309,6 +2353,7 @@
new(): CSSFontFaceRule;
};
+/** An object implementing the CSSGroupingRule interface represents any CSS at-rule that contains other rules nested within it. */
interface CSSGroupingRule extends CSSRule {
readonly cssRules: CSSRuleList;
deleteRule(index: number): void;
@@ -2331,6 +2376,7 @@
new(): CSSImportRule;
};
+/** The CSSKeyframeRule interface describes an object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). */
interface CSSKeyframeRule extends CSSRule {
keyText: string;
readonly style: CSSStyleDeclaration;
@@ -2341,6 +2387,7 @@
new(): CSSKeyframeRule;
};
+/** The CSSKeyframesRule interface describes an object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). */
interface CSSKeyframesRule extends CSSRule {
readonly cssRules: CSSRuleList;
name: string;
@@ -2354,6 +2401,7 @@
new(): CSSKeyframesRule;
};
+/** The CSSMediaRule is an interface representing a single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). */
interface CSSMediaRule extends CSSConditionRule {
readonly media: MediaList;
}
@@ -2363,6 +2411,7 @@
new(): CSSMediaRule;
};
+/** The CSSNamespaceRule interface describes an object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). */
interface CSSNamespaceRule extends CSSRule {
readonly namespaceURI: string;
readonly prefix: string;
@@ -2373,6 +2422,7 @@
new(): CSSNamespaceRule;
};
+/** CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). */
interface CSSPageRule extends CSSRule {
readonly pseudoClass: string;
readonly selector: string;
@@ -2385,6 +2435,7 @@
new(): CSSPageRule;
};
+/** The CSSRule interface represents a single CSS rule. There are several types of rules, listed in the Type constants section below. */
interface CSSRule {
cssText: string;
readonly parentRule: CSSRule | null;
@@ -2421,6 +2472,7 @@
readonly VIEWPORT_RULE: number;
};
+/** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */
interface CSSRuleList {
readonly length: number;
item(index: number): CSSRule | null;
@@ -2432,6 +2484,7 @@
new(): CSSRuleList;
};
+/** The CSSStyleDeclaration API represents an object that is a CSS declaration block, that exposes style information and various style-related methods and properties. */
interface CSSStyleDeclaration {
alignContent: string | null;
alignItems: string | null;
@@ -2903,6 +2956,7 @@
new(): CSSStyleDeclaration;
};
+/** CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). */
interface CSSStyleRule extends CSSRule {
selectorText: string;
readonly style: CSSStyleDeclaration;
@@ -2913,6 +2967,7 @@
new(): CSSStyleRule;
};
+/** The CSSStyleSheet interface represents a single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. */
interface CSSStyleSheet extends StyleSheet {
readonly cssRules: CSSRuleList;
/** @deprecated */
@@ -2950,6 +3005,7 @@
new(): CSSStyleSheet;
};
+/** The CSSSupportsRule interface describes an object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). */
interface CSSSupportsRule extends CSSConditionRule {
}
@@ -2958,6 +3014,7 @@
new(): CSSSupportsRule;
};
+/** The Cache interface provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
interface Cache {
add(request: RequestInfo): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
@@ -2973,6 +3030,7 @@
new(): Cache;
};
+/** The CacheStorage interface represents the storage for Cache objects. */
interface CacheStorage {
delete(cacheName: string): Promise<boolean>;
has(cacheName: string): Promise<boolean>;
@@ -3023,6 +3081,7 @@
filter: string;
}
+/** The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
interface CanvasGradient {
/**
* Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset
@@ -3074,6 +3133,7 @@
setLineDash(segments: number[]): void;
}
+/** The CanvasPattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
interface CanvasPattern {
/**
* Sets the transformation matrix that will be used when rendering the pattern during a fill or
@@ -3093,6 +3153,7 @@
strokeRect(x: number, y: number, w: number, h: number): void;
}
+/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. */
interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath {
readonly canvas: HTMLCanvasElement;
}
@@ -3156,6 +3217,7 @@
new(): CaretPosition;
};
+/** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */
interface ChannelMergerNode extends AudioNode {
}
@@ -3164,6 +3226,7 @@
new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode;
};
+/** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */
interface ChannelSplitterNode extends AudioNode {
}
@@ -3172,6 +3235,7 @@
new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode;
};
+/** The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. */
interface CharacterData extends Node, NonDocumentTypeChildNode, ChildNode {
data: string;
readonly length: number;
@@ -3237,8 +3301,19 @@
new(): ClientRectList;
};
+interface Clipboard extends EventTarget {
+ readText(): Promise<string>;
+ writeText(data: string): Promise<void>;
+}
+
+declare var Clipboard: {
+ prototype: Clipboard;
+ new(): Clipboard;
+};
+
+/** The ClipboardEvent interface represents events providing information related to modification of the clipboard, that is cut, copy, and paste events. */
interface ClipboardEvent extends Event {
- readonly clipboardData: DataTransfer;
+ readonly clipboardData: DataTransfer | null;
}
declare var ClipboardEvent: {
@@ -3246,11 +3321,7 @@
new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
};
-interface ClipboardEventInit extends EventInit {
- data?: string;
- dataType?: string;
-}
-
+/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
interface CloseEvent extends Event {
readonly code: number;
readonly reason: string;
@@ -3264,6 +3335,7 @@
new(type: string, eventInitDict?: CloseEventInit): CloseEvent;
};
+/** The Comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. Comments are represented in HTML and XML as content between '<!--' and '-->'. In XML, the character sequence '--' cannot be used within a comment. */
interface Comment extends CharacterData {
}
@@ -3272,6 +3344,7 @@
new(data?: string): Comment;
};
+/** The DOM CompositionEvent represents events that occur due to the user indirectly entering text. */
interface CompositionEvent extends UIEvent {
readonly data: string;
readonly locale: string;
@@ -3292,6 +3365,7 @@
publicInfo?: Uint8Array;
}
+/** The Console object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. */
interface Console {
memory: any;
assert(condition?: boolean, message?: string, ...data: any[]): void;
@@ -3338,6 +3412,7 @@
new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode;
};
+/** The ConvolverNode interface is an AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. */
interface ConvolverNode extends AudioNode {
buffer: AudioBuffer | null;
normalize: boolean;
@@ -3348,6 +3423,7 @@
new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode;
};
+/** The Coordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. */
interface Coordinates {
readonly accuracy: number;
readonly altitude: number | null;
@@ -3358,6 +3434,7 @@
readonly speed: number | null;
}
+/** The CountQueuingStrategy interface of the the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. */
interface CountQueuingStrategy extends QueuingStrategy {
highWaterMark: number;
size(chunk: any): 1;
@@ -3368,6 +3445,7 @@
new(options: { highWaterMark: number }): CountQueuingStrategy;
};
+/** The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
interface Crypto {
readonly subtle: SubtleCrypto;
getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;
@@ -3378,6 +3456,7 @@
new(): Crypto;
};
+/** The CryptoKey interface represents a cryptographic key derived from a specific key algorithm. */
interface CryptoKey {
readonly algorithm: KeyAlgorithm;
readonly extractable: boolean;
@@ -3426,6 +3505,7 @@
new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
};
+/** The DOMError interface describes an error object that contains an error name. */
interface DOMError {
readonly name: string;
toString(): string;
@@ -3436,6 +3516,7 @@
new(): DOMError;
};
+/** The DOMException interface represents an abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */
interface DOMException {
readonly code: number;
readonly message: string;
@@ -3497,6 +3578,7 @@
readonly WRONG_DOCUMENT_ERR: number;
};
+/** The DOMImplementation interface represent an object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */
interface DOMImplementation {
createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;
createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;
@@ -3599,6 +3681,8 @@
rotateFromVector(x?: number, y?: number): DOMMatrix;
scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
+ /** @deprecated */
+ scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
skewX(sx?: number): DOMMatrix;
skewY(sy?: number): DOMMatrix;
toFloat32Array(): Float32Array;
@@ -3616,6 +3700,7 @@
fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
};
+/** The DOMParser interface provides the ability to parse XML or HTML source code from a string into a DOM Document. */
interface DOMParser {
parseFromString(str: string, type: SupportedType): Document;
}
@@ -3726,6 +3811,7 @@
new(): DOMSettableTokenList;
};
+/** A type returned by some APIs which contains a list of DOMString (strings). */
interface DOMStringList {
/**
* Returns the number of strings in strings.
@@ -3748,6 +3834,7 @@
new(): DOMStringList;
};
+/** Used by the dataset HTML attribute to represent data for custom attributes added to elements. */
interface DOMStringMap {
[name: string]: string | undefined;
}
@@ -3757,6 +3844,7 @@
new(): DOMStringMap;
};
+/** The DOMTokenList interface represents a set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. */
interface DOMTokenList {
/**
* Returns the number of tokens.
@@ -3829,6 +3917,7 @@
new(): DataCue;
};
+/** The DataTransfer object is used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. */
interface DataTransfer {
dropEffect: string;
effectAllowed: string;
@@ -3869,6 +3958,7 @@
new(): DataTransfer;
};
+/** The DataTransferItem object represents one drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */
interface DataTransferItem {
/**
* Returns the drag data item kind, one of: "string",
@@ -3896,6 +3986,7 @@
new(): DataTransferItem;
};
+/** The DataTransferItemList object is a list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. */
interface DataTransferItemList {
/**
* Returns the number of items in the drag data store.
@@ -3938,6 +4029,7 @@
new(): DeferredPermissionRequest;
};
+/** The DelayNode interface represents a delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. */
interface DelayNode extends AudioNode {
readonly delayTime: AudioParam;
}
@@ -3947,6 +4039,7 @@
new(context: BaseAudioContext, options?: DelayOptions): DelayNode;
};
+/** A DeviceAcceleration object provides information about the amount of acceleration the device is experiencing along all three axes. */
interface DeviceAcceleration {
readonly x: number | null;
readonly y: number | null;
@@ -3958,6 +4051,7 @@
new(): DeviceAcceleration;
};
+/** The DeviceLightEvent provides web developers with information from photo sensors or similiar detectors about ambient light levels near the device. For example this may be useful to adjust the screen's brightness based on the current ambient light level in order to save energy or provide better readability. */
interface DeviceLightEvent extends Event {
readonly value: number;
}
@@ -3967,6 +4061,7 @@
new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;
};
+/** The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. */
interface DeviceMotionEvent extends Event {
readonly acceleration: DeviceAcceleration | null;
readonly accelerationIncludingGravity: DeviceAcceleration | null;
@@ -3980,6 +4075,7 @@
new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;
};
+/** The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. */
interface DeviceOrientationEvent extends Event {
readonly absolute: boolean;
readonly alpha: number | null;
@@ -3993,6 +4089,7 @@
new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;
};
+/** A DeviceRotationRate object provides information about the rate at which the device is rotating around all three axes. */
interface DeviceRotationRate {
readonly alpha: number | null;
readonly beta: number | null;
@@ -4026,10 +4123,13 @@
interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {
"fullscreenchange": Event;
"fullscreenerror": Event;
+ "pointerlockchange": Event;
+ "pointerlockerror": Event;
"readystatechange": ProgressEvent;
"visibilitychange": Event;
}
+/** The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */
interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, GlobalEventHandlers, DocumentAndElementEventHandlers {
/**
* Sets or gets the URL for the current document.
@@ -4186,6 +4286,8 @@
location: Location;
onfullscreenchange: ((this: Document, ev: Event) => any) | null;
onfullscreenerror: ((this: Document, ev: Event) => any) | null;
+ onpointerlockchange: ((this: Document, ev: Event) => any) | null;
+ onpointerlockerror: ((this: Document, ev: Event) => any) | null;
/**
* Fires when the state of the object has changed.
* @param ev The event
@@ -4283,68 +4385,11 @@
* When supplied, options's is can be used to create a customized built-in element.
*/
createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement;
+ createElementNS<K extends keyof SVGElementTagNameMap>(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K];
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "cursor"): SVGCursorElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement;
- createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement;
createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement;
createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element;
createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element;
@@ -4483,6 +4528,7 @@
* resolves promise when done.
*/
exitFullscreen(): Promise<void>;
+ exitPointerLock(): void;
getAnimations(): Animation[];
/**
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
@@ -4516,9 +4562,18 @@
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;
/**
+ * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
+ */
+ getSelection(): Selection | null;
+ /**
* Gets a value indicating whether the object currently has focus.
*/
hasFocus(): boolean;
+ /**
+ * Returns a copy of node. If deep is true, the copy also includes the node's descendants.
+ * If node is a document or a shadow root, throws a
+ * "NotSupportedError" DOMException.
+ */
importNode<T extends Node>(importedNode: T, deep: boolean): T;
/**
* Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
@@ -4565,9 +4620,6 @@
* @param content The text and HTML tags to write.
*/
writeln(...text: string[]): void;
- /**
- * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
- */
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -4676,6 +4728,7 @@
createEvent(eventInterface: string): Event;
}
+/** The DocumentFragment interface represents a minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */
interface DocumentFragment extends Node, NonElementParentNode, ParentNode {
getElementById(elementId: string): HTMLElement | null;
}
@@ -4687,6 +4740,8 @@
interface DocumentOrShadowRoot {
readonly activeElement: Element | null;
+ readonly fullscreenElement: Element | null;
+ readonly pointerLockElement: Element | null;
/**
* Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
*/
@@ -4707,6 +4762,7 @@
new(options?: DocumentTimelineOptions): DocumentTimeline;
};
+/** The DocumentType interface represents a Node containing a doctype. */
interface DocumentType extends Node, ChildNode {
readonly name: string;
readonly publicId: string;
@@ -4718,6 +4774,7 @@
new(): DocumentType;
};
+/** The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. */
interface DragEvent extends MouseEvent {
/**
* Returns the DataTransfer object for the event.
@@ -4730,6 +4787,7 @@
new(type: string, eventInitDict?: DragEventInit): DragEvent;
};
+/** Inherits properties from its parent, AudioNode. */
interface DynamicsCompressorNode extends AudioNode {
readonly attack: AudioParam;
readonly knee: AudioParam;
@@ -4749,6 +4807,7 @@
readonly MIN_EXT: GLenum;
}
+/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */
interface EXT_frag_depth {
}
@@ -4762,6 +4821,7 @@
interface EXT_shader_texture_lod {
}
+/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */
interface EXT_texture_filter_anisotropic {
readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
@@ -4772,6 +4832,7 @@
"fullscreenerror": Event;
}
+/** Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. */
interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable, Animatable {
readonly assignedSlot: HTMLSlotElement | null;
readonly attributes: NamedNodeMap;
@@ -4830,7 +4891,7 @@
/**
* Creates a shadow root for element and returns it.
*/
- attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;
+ attachShadow(init: ShadowRootInit): ShadowRoot;
/**
* Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
*/
@@ -4895,8 +4956,14 @@
removeAttributeNode(attr: Attr): Attr;
/**
* Displays element fullscreen and resolves promise when done.
+ * When supplied, options's navigationUI member indicates whether showing
+ * navigation UI while in fullscreen is preferred or not. If set to "show", navigation
+ * simplicity is preferred over screen space, and if set to "hide", more screen space
+ * is preferred. User agents are always free to honor user preference over the application's. The
+ * default value "auto" indicates no application preference.
*/
- requestFullscreen(): Promise<void>;
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
+ requestPointerLock(): void;
scroll(options?: ScrollToOptions): void;
scroll(x: number, y: number): void;
scrollBy(options?: ScrollToOptions): void;
@@ -4947,6 +5014,7 @@
is?: string;
}
+/** The ErrorEvent interface represents events providing information related to errors in scripts or in files. */
interface ErrorEvent extends Event {
readonly colno: number;
readonly error: any;
@@ -4960,6 +5028,7 @@
new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
};
+/** The Event interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). While events are usually triggered by such "external" sources, they can also be triggered programmatically, such as by calling the HTMLElement.click() method of an element, or by defining the event, then sending it to a specified target using EventTarget.dispatchEvent(). There are many types of events, some of which use other interfaces based on the main Event interface. Event itself contains the properties and methods which are common to all events. */
interface Event {
/**
* Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
@@ -4985,7 +5054,7 @@
readonly isTrusted: boolean;
returnValue: boolean;
/** @deprecated */
- readonly srcElement: Element | null;
+ readonly srcElement: EventTarget | null;
/**
* Returns the object to which event is dispatched (its target).
*/
@@ -5033,28 +5102,50 @@
handleEvent(evt: Event): void;
}
+interface EventSourceEventMap {
+ "error": Event;
+ "message": MessageEvent;
+ "open": Event;
+}
+
interface EventSource extends EventTarget {
- readonly CLOSED: number;
- readonly CONNECTING: number;
- readonly OPEN: number;
- onerror: (evt: MessageEvent) => any;
- onmessage: (evt: MessageEvent) => any;
- onopen: (evt: MessageEvent) => any;
+ onerror: ((this: EventSource, ev: Event) => any) | null;
+ onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
+ onopen: ((this: EventSource, ev: Event) => any) | null;
+ /**
+ * Returns the state of this EventSource object's connection. It can have the
+ * values described below.
+ */
readonly readyState: number;
+ /**
+ * Returns the URL providing the event stream.
+ */
readonly url: string;
+ /**
+ * Returns true if the credentials mode
+ * for connection requests to the URL providing the
+ * event stream is set to "include", and false otherwise.
+ */
readonly withCredentials: boolean;
close(): void;
+ readonly CLOSED: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
+ addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var EventSource: {
prototype: EventSource;
new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;
+ readonly CLOSED: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
};
-interface EventSourceInit {
- readonly withCredentials: boolean;
-}
-
+/** EventTarget is an interface implemented by objects that can receive events and may have listeners for them. */
interface EventTarget {
/**
* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
@@ -5107,6 +5198,7 @@
IsSearchProviderInstalled(): void;
}
+/** The File interface provides information about files and allows JavaScript in a web page to access their content. */
interface File extends Blob {
readonly lastModified: number;
readonly name: string;
@@ -5117,6 +5209,7 @@
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
};
+/** An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type="file"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */
interface FileList {
readonly length: number;
item(index: number): File | null;
@@ -5137,6 +5230,7 @@
"progress": ProgressEvent;
}
+/** The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */
interface FileReader extends EventTarget {
readonly error: DOMException | null;
onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;
@@ -5169,6 +5263,7 @@
readonly LOADING: number;
};
+/** The FocusEvent interface represents focus-related events like focus, blur, focusin, or focusout. */
interface FocusEvent extends UIEvent {
readonly relatedTarget: EventTarget;
initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;
@@ -5193,6 +5288,7 @@
new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;
};
+/** The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
interface FormData {
append(name: string, value: string | Blob, fileName?: string): void;
delete(name: string): void;
@@ -5208,6 +5304,7 @@
new(form?: HTMLFormElement): FormData;
};
+/** The GainNode interface represents a change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. */
interface GainNode extends AudioNode {
readonly gain: AudioParam;
}
@@ -5217,13 +5314,13 @@
new(context: BaseAudioContext, options?: GainOptions): GainNode;
};
+/** The Gamepad interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. */
interface Gamepad {
- readonly axes: number[];
- readonly buttons: GamepadButton[];
+ readonly axes: ReadonlyArray<number>;
+ readonly buttons: ReadonlyArray<GamepadButton>;
readonly connected: boolean;
- readonly displayId: number;
readonly hand: GamepadHand;
- readonly hapticActuators: GamepadHapticActuator[];
+ readonly hapticActuators: ReadonlyArray<GamepadHapticActuator>;
readonly id: string;
readonly index: number;
readonly mapping: GamepadMappingType;
@@ -5236,6 +5333,7 @@
new(): Gamepad;
};
+/** The GamepadButton interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. */
interface GamepadButton {
readonly pressed: boolean;
readonly touched: boolean;
@@ -5247,15 +5345,17 @@
new(): GamepadButton;
};
+/** The GamepadEvent interface of the Gamepad API contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. */
interface GamepadEvent extends Event {
readonly gamepad: Gamepad;
}
declare var GamepadEvent: {
prototype: GamepadEvent;
- new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;
+ new(type: string, eventInitDict: GamepadEventInit): GamepadEvent;
};
+/** The GamepadHapticActuator interface of the Gamepad API represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. */
interface GamepadHapticActuator {
readonly type: GamepadHapticActuatorType;
pulse(value: number, duration: number): Promise<boolean>;
@@ -5266,6 +5366,7 @@
new(): GamepadHapticActuator;
};
+/** The GamepadPose interface of the Gamepad API represents the pose of a WebVR controller at a given timestamp (which includes orientation, position, velocity, and acceleration information.) */
interface GamepadPose {
readonly angularAcceleration: Float32Array | null;
readonly angularVelocity: Float32Array | null;
@@ -5282,16 +5383,13 @@
new(): GamepadPose;
};
+/** The Geolocation interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. */
interface Geolocation {
clearWatch(watchId: number): void;
getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;
watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;
}
-interface GetSVGDocument {
- getSVGDocument(): Document;
-}
-
interface GlobalEventHandlersEventMap {
"abort": UIEvent;
"animationcancel": AnimationEvent;
@@ -5356,11 +5454,13 @@
"ratechange": Event;
"reset": Event;
"resize": UIEvent;
- "scroll": UIEvent;
+ "scroll": Event;
"securitypolicyviolation": SecurityPolicyViolationEvent;
"seeked": Event;
"seeking": Event;
- "select": UIEvent;
+ "select": Event;
+ "selectionchange": Event;
+ "selectstart": Event;
"stalled": Event;
"submit": Event;
"suspend": Event;
@@ -5475,7 +5575,7 @@
* Fires when an error occurs during object loading.
* @param ev The event.
*/
- onerror: ErrorEventHandler;
+ onerror: OnErrorEventHandler;
/**
* Fires when the object receives focus.
* @param ev The event.
@@ -5591,7 +5691,7 @@
* Fires when the user repositions the scroll box in the scroll bar on the object.
* @param ev The event.
*/
- onscroll: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
/**
* Occurs when the seek operation ends.
@@ -5607,7 +5707,9 @@
* Fires when the current selection changes.
* @param ev The event.
*/
- onselect: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/**
* Occurs when the download has stopped.
* @param ev The event.
@@ -5675,6 +5777,7 @@
new(): HTMLAllCollection;
};
+/** The HTMLAnchorElement interface represents hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. */
interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
/**
* Sets or retrieves the character set used to encode the object.
@@ -5783,6 +5886,7 @@
new(): HTMLAppletElement;
};
+/** The HTMLAreaElement interface provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of area elements. */
interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {
/**
* Sets or retrieves a text alternative to the graphic.
@@ -5821,6 +5925,7 @@
new(): HTMLAreaElement;
};
+/** The HTMLAudioElement interface provides access to the properties of <audio> elements, as well as methods to manipulate them. It derives from the HTMLMediaElement interface. */
interface HTMLAudioElement extends HTMLMediaElement {
addEventListener<K extends keyof HTMLMediaElementEventMap>(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -5833,6 +5938,7 @@
new(): HTMLAudioElement;
};
+/** The HTMLBRElement interface represents a HTML line break element (<br>). It inherits from HTMLElement. */
interface HTMLBRElement extends HTMLElement {
/**
* Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.
@@ -5850,6 +5956,7 @@
new(): HTMLBRElement;
};
+/** The HTMLBaseElement interface contains the base URI for a document. This object inherits all of the properties and methods as described in the HTMLElement interface. */
interface HTMLBaseElement extends HTMLElement {
/**
* Gets or sets the baseline URL on which relative links are based.
@@ -5870,6 +5977,7 @@
new(): HTMLBaseElement;
};
+/** The HTMLBaseFontElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <basefont> elements. */
interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {
/**
* Sets or retrieves the current typeface family.
@@ -5896,6 +6004,7 @@
"orientationchange": Event;
}
+/** The HTMLBodyElement interface provides special properties (beyond those of the regular HTMLElement interface they also inherit) for manipulating body elements. */
interface HTMLBodyElement extends HTMLElement, WindowEventHandlers {
/** @deprecated */
aLink: string;
@@ -5925,6 +6034,7 @@
new(): HTMLBodyElement;
};
+/** The HTMLButtonElement interface provides properties and methods (beyond the <button> object interface it also has available to them by inheritance) for manipulating the layout and presentation of button elements. */
interface HTMLButtonElement extends HTMLElement {
/**
* Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
@@ -6001,6 +6111,7 @@
new(): HTMLButtonElement;
};
+/** The HTMLCanvasElement interface provides properties and methods for manipulating the layout and presentation of <canvas> elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement interface. */
interface HTMLCanvasElement extends HTMLElement {
/**
* Gets or sets the height of a canvas element on a document.
@@ -6034,6 +6145,7 @@
new(): HTMLCanvasElement;
};
+/** The HTMLCollection interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. */
interface HTMLCollectionBase {
/**
* Sets or retrieves the number of objects in a collection.
@@ -6064,6 +6176,7 @@
[index: number]: T;
}
+/** The HTMLDListElement interface provides special properties (beyond those of the regular HTMLElement interface it also has available to it by inheritance) for manipulating definition list elements. */
interface HTMLDListElement extends HTMLElement {
/** @deprecated */
compact: boolean;
@@ -6078,6 +6191,7 @@
new(): HTMLDListElement;
};
+/** The HTMLDataElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <data> elements. */
interface HTMLDataElement extends HTMLElement {
value: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -6091,6 +6205,7 @@
new(): HTMLDataElement;
};
+/** The HTMLDataListElement interface provides special properties (beyond the HTMLElement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content. */
interface HTMLDataListElement extends HTMLElement {
readonly options: HTMLCollectionOf<HTMLOptionElement>;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -6148,6 +6263,7 @@
new(): HTMLDirectoryElement;
};
+/** The HTMLDivElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <div> elements. */
interface HTMLDivElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
@@ -6165,6 +6281,7 @@
new(): HTMLDivElement;
};
+/** The HTMLDocument property of Window objects is an alias that browsers expose for the Document interface object. */
interface HTMLDocument extends Document {
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -6180,6 +6297,7 @@
interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {
}
+/** The HTMLElement interface represents any HTML element. Some elements directly implement this interface, others implement it via an interface that inherits it. */
interface HTMLElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle {
accessKey: string;
readonly accessKeyLabel: string;
@@ -6209,56 +6327,29 @@
new(): HTMLElement;
};
-interface HTMLEmbedElement extends HTMLElement, GetSVGDocument {
+/** The HTMLEmbedElement interface, which provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <embed> elements. */
+interface HTMLEmbedElement extends HTMLElement {
/** @deprecated */
align: string;
/**
* Sets or retrieves the height of the object.
*/
height: string;
- hidden: any;
- /**
- * Gets or sets whether the DLNA PlayTo device is available.
- */
- msPlayToDisabled: boolean;
- /**
- * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
- */
- msPlayToPreferredSourceUri: string;
- /**
- * Gets or sets the primary DLNA PlayTo device.
- */
- msPlayToPrimary: boolean;
- /**
- * Gets the source associated with the media element for use by the PlayToManager.
- */
- readonly msPlayToSource: any;
/**
* Sets or retrieves the name of the object.
*/
/** @deprecated */
name: string;
/**
- * Retrieves the palette used for the embedded document.
- */
- readonly palette: string;
- /**
- * Retrieves the URL of the plug-in used to view an embedded document.
- */
- readonly pluginspage: string;
- readonly readyState: string;
- /**
* Sets or retrieves a URL to be loaded by the object.
*/
src: string;
- /**
- * Sets or retrieves the height and width units of the embed object.
- */
- units: string;
+ type: string;
/**
* Sets or retrieves the width of the object.
*/
width: string;
+ getSVGDocument(): Document | null;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -6270,6 +6361,7 @@
new(): HTMLEmbedElement;
};
+/** The HTMLFieldSetElement interface has special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of field-set elements. */
interface HTMLFieldSetElement extends HTMLElement {
disabled: boolean;
readonly elements: HTMLCollection;
@@ -6312,6 +6404,7 @@
new(): HTMLFieldSetElement;
};
+/** Implements the document object model (DOM) representation of the font element. The HTML Font Element <font> defines the font size, font face and color of text. */
interface HTMLFontElement extends HTMLElement {
/** @deprecated */
color: string;
@@ -6333,6 +6426,7 @@
new(): HTMLFontElement;
};
+/** The HTMLFormControlsCollection interface represents a collection of HTML form control elements. */
interface HTMLFormControlsCollection extends HTMLCollectionBase {
/**
* element = collection[name]
@@ -6345,6 +6439,7 @@
new(): HTMLFormControlsCollection;
};
+/** The HTMLFormElement interface represents a <form> element in the DOM; it allows access to and in some cases modification of aspects of the form, as well as access to its component elements. */
interface HTMLFormElement extends HTMLElement {
/**
* Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.
@@ -6481,6 +6576,7 @@
interface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {
}
+/** The HTMLFrameSetElement interface provides special properties (beyond those of the regular HTMLElement interface they also inherit) for manipulating <frameset> elements. */
interface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers {
/**
* Sets or retrieves the frame widths of the object.
@@ -6503,6 +6599,7 @@
new(): HTMLFrameSetElement;
};
+/** The HTMLHRElement interface provides special properties (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating <hr> elements. */
interface HTMLHRElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
@@ -6534,6 +6631,7 @@
new(): HTMLHRElement;
};
+/** The HTMLHeadElement interface contains the descriptive information, or metadata, for a document. This object inherits all of the properties and methods described in the HTMLElement interface. */
interface HTMLHeadElement extends HTMLElement {
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -6546,6 +6644,7 @@
new(): HTMLHeadElement;
};
+/** The HTMLHeadingElement interface represents the different heading elements. It inherits methods and properties from the HTMLElement interface. */
interface HTMLHeadingElement extends HTMLElement {
/**
* Sets or retrieves a value that indicates the table alignment.
@@ -6563,6 +6662,7 @@
new(): HTMLHeadingElement;
};
+/** The HTMLHtmlElement interface serves as the root node for a given HTML document. This object inherits the properties and methods described in the HTMLElement interface. */
interface HTMLHtmlElement extends HTMLElement {
/**
* Sets or retrieves the DTD version that governs the current document.
@@ -6594,12 +6694,14 @@
username: string;
}
-interface HTMLIFrameElement extends HTMLElement, GetSVGDocument {
+/** The HTMLIFrameElement interface provides special properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. */
+interface HTMLIFrameElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
*/
/** @deprecated */
align: string;
+ allow: string;
allowFullscreen: boolean;
allowPaymentRequest: boolean;
/**
@@ -6609,7 +6711,7 @@
/**
* Retrieves the object of the specified.
*/
- readonly contentWindow: Window | null;
+ readonly contentWindow: WindowProxy | null;
/**
* Sets or retrieves whether to display a border for the frame.
*/
@@ -6638,7 +6740,7 @@
* Sets or retrieves the frame name.
*/
name: string;
- readonly referrerPolicy: ReferrerPolicy;
+ referrerPolicy: ReferrerPolicy;
readonly sandbox: DOMTokenList;
/**
* Sets or retrieves whether the frame can be scrolled.
@@ -6657,6 +6759,7 @@
* Sets or retrieves the width of the object.
*/
width: string;
+ getSVGDocument(): Document | null;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -6668,6 +6771,7 @@
new(): HTMLIFrameElement;
};
+/** The HTMLImageElement interface provides special properties and methods  for manipulating the layout and presentation of <img> elements. */
interface HTMLImageElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
@@ -6757,6 +6861,7 @@
new(): HTMLImageElement;
};
+/** The HTMLInputElement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements. */
interface HTMLInputElement extends HTMLElement {
/**
* Sets or retrieves a comma-separated list of content types.
@@ -6961,6 +7066,7 @@
new(): HTMLInputElement;
};
+/** The HTMLLIElement interface exposes specific properties and methods (beyond those defined by regular HTMLElement interface it also has available to it by inheritance) for manipulating list elements. */
interface HTMLLIElement extends HTMLElement {
/** @deprecated */
type: string;
@@ -6979,6 +7085,7 @@
new(): HTMLLIElement;
};
+/** The HTMLLabelElement interface gives access to properties specific to <label> elements. It inherits methods and properties from the base HTMLElement interface. */
interface HTMLLabelElement extends HTMLElement {
readonly control: HTMLElement | null;
/**
@@ -7000,6 +7107,7 @@
new(): HTMLLabelElement;
};
+/** The HTMLLegendElement is an interface allowing to access properties of the <legend> elements. It inherits properties and methods from the HTMLElement interface. */
interface HTMLLegendElement extends HTMLElement {
/** @deprecated */
align: string;
@@ -7018,6 +7126,7 @@
new(): HTMLLegendElement;
};
+/** The HTMLLinkElement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa. This object inherits all of the properties and methods of the HTMLElement interface. */
interface HTMLLinkElement extends HTMLElement, LinkStyle {
as: string;
/**
@@ -7084,6 +7193,7 @@
new(): HTMLMainElement;
};
+/** The HTMLMapElement interface provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. */
interface HTMLMapElement extends HTMLElement {
/**
* Retrieves a collection of the area objects defined for the given map object.
@@ -7110,6 +7220,7 @@
"start": Event;
}
+/** The HTMLMarqueeElement interface provides methods to manipulate <marquee> elements. */
interface HTMLMarqueeElement extends HTMLElement {
/** @deprecated */
behavior: string;
@@ -7157,8 +7268,10 @@
interface HTMLMediaElementEventMap extends HTMLElementEventMap {
"encrypted": MediaEncryptedEvent;
"msneedkey": Event;
+ "waitingforkey": Event;
}
+/** The HTMLMediaElement interface adds to HTMLElement the properties and methods needed to support basic media-related capabilities that are common to audio and video. */
interface HTMLMediaElement extends HTMLElement {
/**
* Returns an AudioTrackList object with the audio tracks for a given video element.
@@ -7252,6 +7365,7 @@
onencrypted: ((this: HTMLMediaElement, ev: MediaEncryptedEvent) => any) | null;
/** @deprecated */
onmsneedkey: ((this: HTMLMediaElement, ev: Event) => any) | null;
+ onwaitingforkey: ((this: HTMLMediaElement, ev: Event) => any) | null;
/**
* Gets a flag that specifies whether playback is paused.
*/
@@ -7364,6 +7478,7 @@
new(): HTMLMenuElement;
};
+/** The HTMLMetaElement interface contains descriptive metadata about a document. It inherits all of the properties and methods described in the HTMLElement interface. */
interface HTMLMetaElement extends HTMLElement {
/**
* Gets or sets meta-information to associate with httpEquiv or name.
@@ -7393,6 +7508,7 @@
new(): HTMLMetaElement;
};
+/** The HTML <meter> elements expose the HTMLMeterElement interface, which provides special properties and methods (beyond the HTMLElement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements. */
interface HTMLMeterElement extends HTMLElement {
high: number;
readonly labels: NodeListOf<HTMLLabelElement>;
@@ -7412,6 +7528,7 @@
new(): HTMLMeterElement;
};
+/** The HTMLModElement interface provides special properties (beyond the regular methods and properties available through the HTMLElement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>. */
interface HTMLModElement extends HTMLElement {
/**
* Sets or retrieves reference information about the object.
@@ -7432,6 +7549,7 @@
new(): HTMLModElement;
};
+/** The HTMLOListElement interface provides special properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating ordered list elements. */
interface HTMLOListElement extends HTMLElement {
/** @deprecated */
compact: boolean;
@@ -7452,11 +7570,8 @@
new(): HTMLOListElement;
};
-interface HTMLObjectElement extends HTMLElement, GetSVGDocument {
- /**
- * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.
- */
- readonly BaseHref: string;
+/** The HTMLObjectElement interface provides special properties and methods (beyond those on the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources. */
+interface HTMLObjectElement extends HTMLElement {
/** @deprecated */
align: string;
/**
@@ -7485,6 +7600,7 @@
* Retrieves the document object of the page or frame.
*/
readonly contentDocument: Document | null;
+ readonly contentWindow: WindowProxy | null;
/**
* Sets or retrieves the URL that references the data of the object.
*/
@@ -7502,26 +7618,9 @@
/** @deprecated */
hspace: number;
/**
- * Gets or sets whether the DLNA PlayTo device is available.
- */
- msPlayToDisabled: boolean;
- /**
- * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
- */
- msPlayToPreferredSourceUri: string;
- /**
- * Gets or sets the primary DLNA PlayTo device.
- */
- msPlayToPrimary: boolean;
- /**
- * Gets the source associated with the media element for use by the PlayToManager.
- */
- readonly msPlayToSource: any;
- /**
* Sets or retrieves the name of the object.
*/
name: string;
- readonly readyState: number;
/**
* Sets or retrieves a message to be displayed while an object is loading.
*/
@@ -7531,7 +7630,7 @@
* Sets or retrieves the MIME type of the object.
*/
type: string;
- typemustmatch: boolean;
+ typeMustMatch: boolean;
/**
* Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
*/
@@ -7558,6 +7657,7 @@
* Returns whether a form will validate when it is submitted, without having to submit it.
*/
checkValidity(): boolean;
+ getSVGDocument(): Document | null;
reportValidity(): boolean;
/**
* Sets a custom error message that is displayed when a form is submitted.
@@ -7575,6 +7675,7 @@
new(): HTMLObjectElement;
};
+/** The HTMLOptGroupElement interface provides special properties and methods (beyond the regular HTMLElement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements. */
interface HTMLOptGroupElement extends HTMLElement {
disabled: boolean;
/**
@@ -7596,6 +7697,7 @@
new(): HTMLOptGroupElement;
};
+/** The HTMLOptionElement interface represents <option> elements and inherits all classes and methods of the HTMLElement interface. */
interface HTMLOptionElement extends HTMLElement {
/**
* Sets or retrieves the status of an option.
@@ -7637,6 +7739,7 @@
new(): HTMLOptionElement;
};
+/** HTMLOptionsCollection is an interface representing a collection of HTML option elements (in document order) and offers methods and properties for traversing the list as well as optionally altering its items. This type is returned solely by the "options" property of select. */
interface HTMLOptionsCollection extends HTMLCollectionOf<HTMLOptionElement> {
/**
* Returns the number of elements in the collection.
@@ -7672,12 +7775,13 @@
interface HTMLOrSVGElement {
readonly dataset: DOMStringMap;
- nonce: string;
+ nonce?: string;
tabIndex: number;
blur(): void;
focus(options?: FocusOptions): void;
}
+/** The HTMLOutputElement interface provides properties and methods (beyond those inherited from HTMLElement) for manipulating the layout and presentation of <output> elements. */
interface HTMLOutputElement extends HTMLElement {
defaultValue: string;
readonly form: HTMLFormElement | null;
@@ -7703,6 +7807,7 @@
new(): HTMLOutputElement;
};
+/** The HTMLParagraphElement interface provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <p> elements. */
interface HTMLParagraphElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
@@ -7720,6 +7825,7 @@
new(): HTMLParagraphElement;
};
+/** The HTMLParamElement interface provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. */
interface HTMLParamElement extends HTMLElement {
/**
* Sets or retrieves the name of an input parameter for an element.
@@ -7750,6 +7856,7 @@
new(): HTMLParamElement;
};
+/** The HTMLPictureElement interface represents a <picture> HTML element. It doesn't implement specific properties or methods. */
interface HTMLPictureElement extends HTMLElement {
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -7762,6 +7869,7 @@
new(): HTMLPictureElement;
};
+/** The HTMLPreElement interface expose specific properties and methods (beyond those defined by regular HTMLElement interface it also has available to it by inheritance) for manipulating block of preformatted text. */
interface HTMLPreElement extends HTMLElement {
/**
* Sets or gets a value that you can use to implement your own width functionality for the object.
@@ -7779,6 +7887,7 @@
new(): HTMLPreElement;
};
+/** The HTMLProgressElement interface provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements. */
interface HTMLProgressElement extends HTMLElement {
readonly labels: NodeListOf<HTMLLabelElement>;
/**
@@ -7804,6 +7913,7 @@
new(): HTMLProgressElement;
};
+/** The HTMLQuoteElement interface provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element. */
interface HTMLQuoteElement extends HTMLElement {
/**
* Sets or retrieves reference information about the object.
@@ -7820,6 +7930,7 @@
new(): HTMLQuoteElement;
};
+/** HTML <script> elements expose the HTMLScriptElement interface, which provides special properties and methods for manipulating the behavior and execution of <script> elements (beyond the inherited HTMLElement interface). */
interface HTMLScriptElement extends HTMLElement {
async: boolean;
/**
@@ -7868,6 +7979,7 @@
new(): HTMLScriptElement;
};
+/** The HTMLSelectElement interface represents a <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface. */
interface HTMLSelectElement extends HTMLElement {
autocomplete: string;
/**
@@ -7986,6 +8098,7 @@
new(): HTMLSlotElement;
};
+/** The HTMLSourceElement interface provides special properties (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating <source> elements. */
interface HTMLSourceElement extends HTMLElement {
/**
* Gets or sets the intended media type of the media source.
@@ -8012,6 +8125,7 @@
new(): HTMLSourceElement;
};
+/** The HTMLSpanElement interface represents a <span> element and derives from the HTMLElement interface, but without implementing any additional properties or methods. */
interface HTMLSpanElement extends HTMLElement {
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -8024,6 +8138,7 @@
new(): HTMLSpanElement;
};
+/** The HTMLStyleElement interface represents a <style> element. It inherits properties and methods from its parent, HTMLElement, and from LinkStyle. */
interface HTMLStyleElement extends HTMLElement, LinkStyle {
/**
* Sets or retrieves the media type.
@@ -8045,6 +8160,7 @@
new(): HTMLStyleElement;
};
+/** The HTMLTableCaptionElement interface special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating table caption elements. */
interface HTMLTableCaptionElement extends HTMLElement {
/**
* Sets or retrieves the alignment of the caption or legend.
@@ -8062,6 +8178,7 @@
new(): HTMLTableCaptionElement;
};
+/** The HTMLTableCellElement interface provides special properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an HTML document. */
interface HTMLTableCellElement extends HTMLElement {
/**
* Sets or retrieves abbreviated text for the object.
@@ -8131,6 +8248,7 @@
new(): HTMLTableCellElement;
};
+/** The HTMLTableColElement interface provides special properties (beyond the HTMLElement interface it also has available to it inheritance) for manipulating single or grouped table column elements. */
interface HTMLTableColElement extends HTMLElement {
/**
* Sets or retrieves the alignment of the object relative to the display or table.
@@ -8175,6 +8293,7 @@
new(): HTMLTableDataCellElement;
};
+/** The HTMLTableElement interface provides special properties and methods (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an HTML document. */
interface HTMLTableElement extends HTMLElement {
/**
* Sets or retrieves a value that indicates the table alignment.
@@ -8300,6 +8419,7 @@
new(): HTMLTableHeaderCellElement;
};
+/** The HTMLTableRowElement interface provides special properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an HTML table. */
interface HTMLTableRowElement extends HTMLElement {
/**
* Sets or retrieves how the object is aligned with adjacent text.
@@ -8347,6 +8467,7 @@
new(): HTMLTableRowElement;
};
+/** The HTMLTableSectionElement interface provides special properties and methods (beyond the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an HTML table. */
interface HTMLTableSectionElement extends HTMLElement {
/**
* Sets or retrieves a value that indicates the table alignment.
@@ -8384,6 +8505,7 @@
new(): HTMLTableSectionElement;
};
+/** The HTMLTemplateElement interface enables access to the contents of an HTML <template> element. */
interface HTMLTemplateElement extends HTMLElement {
readonly content: DocumentFragment;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -8397,6 +8519,7 @@
new(): HTMLTemplateElement;
};
+/** The HTMLTextAreaElement interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements. */
interface HTMLTextAreaElement extends HTMLElement {
autocomplete: string;
/**
@@ -8511,6 +8634,7 @@
new(): HTMLTextAreaElement;
};
+/** The HTMLTimeElement interface provides special properties (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <time> elements. */
interface HTMLTimeElement extends HTMLElement {
dateTime: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -8524,6 +8648,7 @@
new(): HTMLTimeElement;
};
+/** The HTMLTitleElement interface contains the title for a document. This element inherits all of the properties and methods of the HTMLElement interface. */
interface HTMLTitleElement extends HTMLElement {
/**
* Retrieves or sets the text of the object as a string.
@@ -8540,6 +8665,7 @@
new(): HTMLTitleElement;
};
+/** The HTMLTrackElement */
interface HTMLTrackElement extends HTMLElement {
default: boolean;
kind: string;
@@ -8567,6 +8693,7 @@
readonly NONE: number;
};
+/** The HTMLUListElement interface provides special properties (beyond those defined on the regular HTMLElement interface it also has available to it by inheritance) for manipulating unordered list elements. */
interface HTMLUListElement extends HTMLElement {
/** @deprecated */
compact: boolean;
@@ -8583,6 +8710,7 @@
new(): HTMLUListElement;
};
+/** The HTMLUnknownElement interface represents an invalid HTML element and derives from the HTMLElement interface, but without implementing any additional properties or methods. */
interface HTMLUnknownElement extends HTMLElement {
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -8601,6 +8729,7 @@
"MSVideoOptimalLayoutChanged": Event;
}
+/** The HTMLVideoElement interface provides special properties and methods for manipulating video objects. It also inherits properties and methods of HTMLMediaElement and HTMLElement. */
interface HTMLVideoElement extends HTMLMediaElement {
/**
* Gets or sets the height of the video element.
@@ -8652,6 +8781,7 @@
new(): HTMLVideoElement;
};
+/** The HashChangeEvent event is fired when the fragment identifier of the URL has changed (the part of the URL that follows the # symbol, including the # symbol). */
interface HashChangeEvent extends Event {
readonly newURL: string;
readonly oldURL: string;
@@ -8662,6 +8792,7 @@
new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;
};
+/** The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
interface Headers {
append(name: string, value: string): void;
delete(name: string): void;
@@ -8676,6 +8807,7 @@
new(init?: HeadersInit): Headers;
};
+/** The History interface allows manipulation of the browser session history, that is the pages visited in the tab or frame that the current page is loaded in. */
interface History {
readonly length: number;
scrollRestoration: ScrollRestoration;
@@ -8701,6 +8833,7 @@
interface IDBArrayKey extends Array<IDBValidKey> {
}
+/** The IDBCursor interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database. */
interface IDBCursor {
/**
* Returns the direction ("next", "nextunique", "prev" or "prevunique")
@@ -8711,12 +8844,12 @@
* Returns the key of the cursor.
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
*/
- readonly key: IDBValidKey | IDBKeyRange;
+ readonly key: IDBValidKey;
/**
* Returns the effective key of the cursor.
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
*/
- readonly primaryKey: IDBValidKey | IDBKeyRange;
+ readonly primaryKey: IDBValidKey;
/**
* Returns the IDBObjectStore or IDBIndex the cursor was opened from.
*/
@@ -8730,12 +8863,12 @@
* Advances the cursor to the next record in range matching or
* after key.
*/
- continue(key?: IDBValidKey | IDBKeyRange): void;
+ continue(key?: IDBValidKey): void;
/**
* Advances the cursor to the next record in range matching
* or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
*/
- continuePrimaryKey(key: IDBValidKey | IDBKeyRange, primaryKey: IDBValidKey | IDBKeyRange): void;
+ continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;
/**
* Delete the record pointed at by the cursor with a new value.
* If successful, request's result will be undefined.
@@ -8754,6 +8887,7 @@
new(): IDBCursor;
};
+/** The IDBCursorWithValue interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */
interface IDBCursorWithValue extends IDBCursor {
/**
* Returns the cursor's current value.
@@ -8773,6 +8907,7 @@
"versionchange": IDBVersionChangeEvent;
}
+/** The IDBDatabase interface of the IndexedDB API provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */
interface IDBDatabase extends EventTarget {
/**
* Returns the name of the database.
@@ -8824,6 +8959,7 @@
readonly indexedDB: IDBFactory;
}
+/** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */
interface IDBFactory {
/**
* Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if
@@ -8853,6 +8989,7 @@
new(): IDBFactory;
};
+/** IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data. */
interface IDBIndex {
readonly keyPath: string | string[];
readonly multiEntry: boolean;
@@ -8913,6 +9050,7 @@
new(): IDBIndex;
};
+/** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */
interface IDBKeyRange {
/**
* Returns lower bound, or undefined if none.
@@ -8961,6 +9099,7 @@
upperBound(upper: any, open?: boolean): IDBKeyRange;
};
+/** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */
interface IDBObjectStore {
/**
* Returns true if the store has a key generator, and false otherwise.
@@ -8984,7 +9123,7 @@
* Returns the associated transaction.
*/
readonly transaction: IDBTransaction;
- add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey>;
+ add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
/**
* Deletes all records in store.
* If successful, request's result will
@@ -9057,7 +9196,7 @@
* null if there were no matching records.
*/
openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
- put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey>;
+ put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
}
declare var IDBObjectStore: {
@@ -9070,6 +9209,7 @@
"upgradeneeded": IDBVersionChangeEvent;
}
+/** Also inherits methods from its parents IDBRequest and EventTarget. */
interface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {
onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;
onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;
@@ -9089,6 +9229,7 @@
"success": Event;
}
+/** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */
interface IDBRequest<T = any> extends EventTarget {
/**
* When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws
@@ -9180,6 +9321,7 @@
new(): IDBTransaction;
};
+/** The IDBVersionChangeEvent interface of the IndexedDB API indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. */
interface IDBVersionChangeEvent extends Event {
readonly newVersion: number | null;
readonly oldVersion: number;
@@ -9190,6 +9332,7 @@
new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;
};
+/** The IIRFilterNode interface of the Web Audio API is a AudioNode processor which implements a general infinite impulse response (IIR)  filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed. */
interface IIRFilterNode extends AudioNode {
getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
}
@@ -9248,6 +9391,7 @@
new(): ImageBitmapRenderingContext;
};
+/** The ImageData interface represents the underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
/**
* Returns the one-dimensional array containing the data in RGBA order, as integers in the
@@ -9268,6 +9412,7 @@
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
};
+/** The IntersectionObserver interface of the Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. */
interface IntersectionObserver {
readonly root: Element | null;
readonly rootMargin: string;
@@ -9283,6 +9428,7 @@
new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;
};
+/** The IntersectionObserverEntry interface of the Intersection Observer API describes the intersection between the target element and its root container at a specific moment of transition. */
interface IntersectionObserverEntry {
readonly boundingClientRect: ClientRect | DOMRect;
readonly intersectionRatio: number;
@@ -9298,6 +9444,7 @@
new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;
};
+/** KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. */
interface KeyboardEvent extends UIEvent {
readonly altKey: boolean;
/** @deprecated */
@@ -9365,6 +9512,7 @@
new(): ListeningStateChangedEvent;
};
+/** The Location interface represents the location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. */
interface Location {
/**
* Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing
@@ -9505,6 +9653,7 @@
new(): MSGesture;
};
+/** The MSGestureEvent is a proprietary interface specific to Internet Explorer and Microsoft Edge which represents events that occur due to touch gestures. Events using this interface include MSGestureStart, MSGestureEnd, MSGestureTap, MSGestureHold, MSGestureChange, and MSInertiaStart. */
interface MSGestureEvent extends UIEvent {
readonly clientX: number;
readonly clientY: number;
@@ -9541,6 +9690,7 @@
readonly MSGESTURE_FLAG_NONE: number;
};
+/** The msGraphicsTrust() constructor returns an object that provides properties for info on protected video playback. */
interface MSGraphicsTrust {
readonly constrictionActive: boolean;
readonly status: string;
@@ -9688,6 +9838,7 @@
new(): MSStream;
};
+/** The MediaDevicesInfo interface contains information that describes a single media input or output device. */
interface MediaDeviceInfo {
readonly deviceId: string;
readonly groupId: string;
@@ -9704,6 +9855,7 @@
"devicechange": Event;
}
+/** The MediaDevices interface provides access to connected media input devices like cameras and microphones, as well as screen sharing. In essence, it lets you obtain access to any hardware source of media data. */
interface MediaDevices extends EventTarget {
ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;
enumerateDevices(): Promise<MediaDeviceInfo[]>;
@@ -9720,6 +9872,7 @@
new(): MediaDevices;
};
+/** A MediaElementSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaElementSource method. The amount of channels in the output equals the number of channels of the audio referenced by the HTMLMediaElement used in the creation of the node, or is 1 if the HTMLMediaElement has no audio. */
interface MediaElementAudioSourceNode extends AudioNode {
readonly mediaElement: HTMLMediaElement;
}
@@ -9739,6 +9892,7 @@
new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;
};
+/** The MediaError interface represents an error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as <audio> or <video>. */
interface MediaError {
readonly code: number;
readonly message: string;
@@ -9760,6 +9914,7 @@
readonly MS_MEDIA_ERR_ENCRYPTED: number;
};
+/** The MediaKeyMessageEvent interface of the EncryptedMediaExtensions API contains the content and related data when the content decryption module generates a message for the session. */
interface MediaKeyMessageEvent extends Event {
readonly message: ArrayBuffer;
readonly messageType: MediaKeyMessageType;
@@ -9767,19 +9922,31 @@
declare var MediaKeyMessageEvent: {
prototype: MediaKeyMessageEvent;
- new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;
+ new(type: string, eventInitDict: MediaKeyMessageEventInit): MediaKeyMessageEvent;
};
+interface MediaKeySessionEventMap {
+ "keystatuseschange": Event;
+ "message": MessageEvent;
+}
+
+/** The MediaKeySession interface of the EncryptedMediaExtensions API represents a context for message exchange with a content decryption module (CDM). */
interface MediaKeySession extends EventTarget {
readonly closed: Promise<void>;
readonly expiration: number;
readonly keyStatuses: MediaKeyStatusMap;
+ onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
+ onmessage: ((this: MediaKeySession, ev: MessageEvent) => any) | null;
readonly sessionId: string;
close(): Promise<void>;
- generateRequest(initDataType: string, initData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise<void>;
+ generateRequest(initDataType: string, initData: BufferSource): Promise<void>;
load(sessionId: string): Promise<boolean>;
remove(): Promise<void>;
- update(response: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise<void>;
+ update(response: BufferSource): Promise<void>;
+ addEventListener<K extends keyof MediaKeySessionEventMap>(type: K, listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof MediaKeySessionEventMap>(type: K, listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MediaKeySession: {
@@ -9787,11 +9954,12 @@
new(): MediaKeySession;
};
+/** The MediaKeyStatusMap interface of the EncryptedMediaExtensions API is a read-only map of media key statuses by key IDs. */
interface MediaKeyStatusMap {
readonly size: number;
- forEach(callback: Function, thisArg?: any): void;
- get(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): MediaKeyStatus;
- has(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): boolean;
+ get(keyId: BufferSource): any;
+ has(keyId: BufferSource): boolean;
+ forEach(callbackfn: (value: MediaKeyStatus, key: BufferSource, parent: MediaKeyStatusMap) => void, thisArg?: any): void;
}
declare var MediaKeyStatusMap: {
@@ -9799,6 +9967,7 @@
new(): MediaKeyStatusMap;
};
+/** The MediaKeySystemAccess interface of the EncryptedMediaExtensions API provides access to a Key System for decryption and/or a content protection provider. You can request an instance of this object using the Navigator.requestMediaKeySystemAccess method. */
interface MediaKeySystemAccess {
readonly keySystem: string;
createMediaKeys(): Promise<MediaKeys>;
@@ -9810,9 +9979,10 @@
new(): MediaKeySystemAccess;
};
+/** The MediaKeys interface of EncryptedMediaExtensions API the represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. */
interface MediaKeys {
createSession(sessionType?: MediaKeySessionType): MediaKeySession;
- setServerCertificate(serverCertificate: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise<void>;
+ setServerCertificate(serverCertificate: BufferSource): Promise<boolean>;
}
declare var MediaKeys: {
@@ -9839,6 +10009,7 @@
"change": MediaQueryListEvent;
}
+/** A MediaQueryList object stores information on a media query applied to a document, and handles sending notifications to listeners when the media query state change (i.e. when the media query test starts or stops evaluating to true). */
interface MediaQueryList extends EventTarget {
readonly matches: boolean;
readonly media: string;
@@ -9868,14 +10039,30 @@
new(type: string, eventInitDict?: MediaQueryListEventInit): MediaQueryListEvent;
};
+interface MediaSourceEventMap {
+ "sourceclose": Event;
+ "sourceended": Event;
+ "sourceopen": Event;
+}
+
+/** The MediaSource interface of the Media Source Extensions API represents a source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent. */
interface MediaSource extends EventTarget {
readonly activeSourceBuffers: SourceBufferList;
duration: number;
+ onsourceclose: ((this: MediaSource, ev: Event) => any) | null;
+ onsourceended: ((this: MediaSource, ev: Event) => any) | null;
+ onsourceopen: ((this: MediaSource, ev: Event) => any) | null;
readonly readyState: ReadyState;
readonly sourceBuffers: SourceBufferList;
addSourceBuffer(type: string): SourceBuffer;
+ clearLiveSeekableRange(): void;
endOfStream(error?: EndOfStreamError): void;
removeSourceBuffer(sourceBuffer: SourceBuffer): void;
+ setLiveSeekableRange(start: number, end: number): void;
+ addEventListener<K extends keyof MediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof MediaSourceEventMap>(type: K, listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MediaSource: {
@@ -9891,6 +10078,7 @@
"removetrack": MediaStreamTrackEvent;
}
+/** The MediaStream interface represents a stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack. */
interface MediaStream extends EventTarget {
readonly active: boolean;
readonly id: string;
@@ -9928,6 +10116,7 @@
new(context: AudioContext, options?: AudioNodeOptions): MediaStreamAudioDestinationNode;
};
+/** A MediaStreamAudioSourceNode has no inputs and exactly one output, and is created using the AudioContext.createMediaStreamSource method. The number of channels in the output equals the number of channels in AudioMediaStreamTrack. If there is no valid media stream, then the number of output channels will be one silent channel. */
interface MediaStreamAudioSourceNode extends AudioNode {
readonly mediaStream: MediaStream;
}
@@ -9957,6 +10146,7 @@
new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;
};
+/** The MediaStreamEvent interface represents events that occurs in relation to a MediaStream. Two events of this type can be thrown: addstream and removestream. */
interface MediaStreamEvent extends Event {
readonly stream: MediaStream | null;
}
@@ -9974,6 +10164,7 @@
"unmute": Event;
}
+/** The MediaStreamTrack interface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well. */
interface MediaStreamTrack extends EventTarget {
enabled: boolean;
readonly id: string;
@@ -10014,6 +10205,7 @@
new(context: AudioContext, options: MediaStreamTrackAudioSourceOptions): MediaStreamTrackAudioSourceNode;
};
+/** The MediaStreamTrackEvent interface represents events which indicate that a MediaStream has had tracks added to or removed from the stream through calls to Media Stream API methods. These events are sent to the stream when these changes occur. */
interface MediaStreamTrackEvent extends Event {
readonly track: MediaStreamTrack;
}
@@ -10023,6 +10215,7 @@
new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;
};
+/** The MessageChannel interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties. */
interface MessageChannel {
readonly port1: MessagePort;
readonly port2: MessagePort;
@@ -10033,6 +10226,7 @@
new(): MessageChannel;
};
+/** The MessageEvent interface represents a message received by a target object. */
interface MessageEvent extends Event {
/**
* Returns the data of the message.
@@ -10071,6 +10265,7 @@
"messageerror": MessageEvent;
}
+/** The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */
interface MessagePort extends EventTarget {
onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;
onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;
@@ -10101,6 +10296,7 @@
new(): MessagePort;
};
+/** The MimeType interface provides contains information about a MIME type associated with a particular plugin. NavigatorPlugins.mimeTypes returns an array of this object. */
interface MimeType {
readonly description: string;
readonly enabledPlugin: Plugin;
@@ -10113,6 +10309,7 @@
new(): MimeType;
};
+/** The MimeTypeArray interface returns an array of MimeType instances, each of which contains information about a supported browser plugins. This object is returned by NavigatorPlugins.mimeTypes. */
interface MimeTypeArray {
readonly length: number;
item(index: number): Plugin;
@@ -10125,6 +10322,7 @@
new(): MimeTypeArray;
};
+/** The MouseEvent interface represents events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown. */
interface MouseEvent extends UIEvent {
readonly altKey: boolean;
readonly button: number;
@@ -10162,6 +10360,7 @@
new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;
};
+/** Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes. */
interface MutationEvent extends Event {
readonly attrChange: number;
readonly attrName: string;
@@ -10182,6 +10381,7 @@
readonly REMOVAL: number;
};
+/** The MutationObserver interface provides the ability to watch for changes being made to the DOM tree. It is designed as a replacement for the older Mutation Events feature which was part of the DOM3 Events specification. */
interface MutationObserver {
disconnect(): void;
/**
@@ -10226,6 +10426,7 @@
new(callback: MutationCallback): MutationObserver;
};
+/** A MutationRecord represents an individual DOM mutation. It is the object that is passed to MutationObserver's callback. */
interface MutationRecord {
readonly addedNodes: NodeList;
/**
@@ -10271,6 +10472,7 @@
new(): MutationRecord;
};
+/** The NamedNodeMap interface represents a collection of Attr objects. Objects inside a NamedNodeMap are not in any particular order, unlike NodeList, although they may be accessed by an index as in an array. */
interface NamedNodeMap {
readonly length: number;
getNamedItem(qualifiedName: string): Attr | null;
@@ -10300,9 +10502,11 @@
new(): NavigationPreloadManager;
};
+/** The Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */
interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation {
readonly activeVRDisplays: ReadonlyArray<VRDisplay>;
readonly authentication: WebAuthentication;
+ readonly clipboard: Clipboard;
readonly cookieEnabled: boolean;
readonly doNotTrack: string | null;
gamepadInputEmulation: GamepadInputEmulationType;
@@ -10378,6 +10582,7 @@
getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
}
+/** Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way. */
interface Node extends EventTarget {
/**
* Returns node's node document's document base URL.
@@ -10404,7 +10609,7 @@
/**
* Returns the next sibling.
*/
- readonly nextSibling: Node | null;
+ readonly nextSibling: ChildNode | null;
/**
* Returns a string appropriate for the type of node, as
* follows:
@@ -10524,6 +10729,7 @@
readonly TEXT_NODE: number;
};
+/** A NodeFilter interface represents an object used to filter the nodes in a NodeIterator or TreeWalker. They don't know anything about the DOM or how to traverse nodes; they just know how to evaluate a single node against the provided filter. */
interface NodeFilter {
acceptNode(node: Node): number;
}
@@ -10547,6 +10753,7 @@
readonly SHOW_TEXT: number;
};
+/** The NodeIterator interface represents an iterator over the members of a list of the nodes in a subtree of the DOM. The nodes will be returned in document order. */
interface NodeIterator {
readonly filter: NodeFilter | null;
readonly pointerBeforeReferenceNode: boolean;
@@ -10563,6 +10770,7 @@
new(): NodeIterator;
};
+/** NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll(). */
interface NodeList {
/**
* Returns the number of nodes in the collection.
@@ -10634,6 +10842,7 @@
"show": Event;
}
+/** The Notification interface of the Notifications API is used to configure and display desktop notifications to the user. */
interface Notification extends EventTarget {
readonly actions: ReadonlyArray<NotificationAction>;
readonly badge: string;
@@ -10669,23 +10878,29 @@
requestPermission(deprecatedCallback?: NotificationPermissionCallback): Promise<NotificationPermission>;
};
+/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
interface OES_element_index_uint {
}
+/** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */
interface OES_standard_derivatives {
readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;
}
+/** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */
interface OES_texture_float {
}
+/** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */
interface OES_texture_float_linear {
}
+/** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */
interface OES_texture_half_float {
readonly HALF_FLOAT_OES: GLenum;
}
+/** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */
interface OES_texture_half_float_linear {
}
@@ -10697,6 +10912,7 @@
readonly VERTEX_ARRAY_BINDING_OES: GLenum;
}
+/** The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an OfflineAudioContext is terminated. The complete event implements this interface. */
interface OfflineAudioCompletionEvent extends Event {
readonly renderedBuffer: AudioBuffer;
}
@@ -10710,6 +10926,7 @@
"complete": OfflineAudioCompletionEvent;
}
+/** The OfflineAudioContext interface is an AudioContext interface representing an audio-processing graph built from linked together AudioNodes. In contrast with a standard AudioContext, an OfflineAudioContext doesn't render the audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an AudioBuffer. */
interface OfflineAudioContext extends BaseAudioContext {
readonly length: number;
oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;
@@ -10727,6 +10944,7 @@
new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;
};
+/** The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. */
interface OscillatorNode extends AudioScheduledSourceNode {
readonly detune: AudioParam;
readonly frequency: AudioParam;
@@ -10760,6 +10978,7 @@
readonly VERTICAL: number;
};
+/** The PageTransitionEvent is fired when a document is being loaded or unloaded. */
interface PageTransitionEvent extends Event {
readonly persisted: boolean;
}
@@ -10769,6 +10988,7 @@
new(): PageTransitionEvent;
};
+/** A PannerNode always has exactly one input and one output: the input can be mono or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels! */
interface PannerNode extends AudioNode {
coneInnerAngle: number;
coneOuterAngle: number;
@@ -10839,6 +11059,7 @@
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
}
+/** The Path2D interface of the Canvas 2D API is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */
interface Path2D extends CanvasPath {
addPath(path: Path2D, transform?: DOMMatrix2DInit): void;
}
@@ -10848,6 +11069,7 @@
new(path?: Path2D | string): Path2D;
};
+/** The PaymentAddress interface of the Payment Request API is used to store shipping or payment address information. */
interface PaymentAddress {
readonly addressLine: string[];
readonly city: string;
@@ -10873,6 +11095,7 @@
"shippingoptionchange": Event;
}
+/** The PaymentRequest interface of the Payment Request API is the primary access point into the API, and lets web content and apps accept payments from the end user. */
interface PaymentRequest extends EventTarget {
readonly id: string;
onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;
@@ -10894,8 +11117,9 @@
new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest;
};
+/** The PaymentRequestUpdateEvent interface of the the Payment Request API enables a web page to update the details of a PaymentRequest in response to a user action. */
interface PaymentRequestUpdateEvent extends Event {
- updateWith(detailsPromise: Promise<PaymentDetailsUpdate>): void;
+ updateWith(detailsPromise: PaymentDetailsUpdate | Promise<PaymentDetailsUpdate>): void;
}
declare var PaymentRequestUpdateEvent: {
@@ -10903,6 +11127,7 @@
new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;
};
+/** The PaymentResponse interface of the Payment Request API is returned after a user selects a payment method and approves a payment request. */
interface PaymentResponse {
readonly details: any;
readonly methodName: string;
@@ -10954,6 +11179,7 @@
"resourcetimingbufferfull": Event;
}
+/** The Performance interface provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
interface Performance extends EventTarget {
/** @deprecated */
readonly navigation: PerformanceNavigation;
@@ -10983,6 +11209,7 @@
new(): Performance;
};
+/** The PerformanceEntry object encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */
interface PerformanceEntry {
readonly duration: number;
readonly entryType: string;
@@ -10996,6 +11223,7 @@
new(): PerformanceEntry;
};
+/** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */
interface PerformanceMark extends PerformanceEntry {
}
@@ -11004,6 +11232,7 @@
new(): PerformanceMark;
};
+/** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */
interface PerformanceMeasure extends PerformanceEntry {
}
@@ -11012,6 +11241,7 @@
new(): PerformanceMeasure;
};
+/** The legacy PerformanceNavigation interface represents information about how the navigation to the current document was done. */
interface PerformanceNavigation {
readonly redirectCount: number;
readonly type: number;
@@ -11031,6 +11261,7 @@
readonly TYPE_RESERVED: number;
};
+/** The PerformanceNavigationTiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. For example, this interface can be used to determine how much time it takes to load or unload a document. */
interface PerformanceNavigationTiming extends PerformanceResourceTiming {
readonly domComplete: number;
readonly domContentLoadedEventEnd: number;
@@ -11072,6 +11303,7 @@
new(): PerformanceObserverEntryList;
};
+/** The PerformanceResourceTiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. */
interface PerformanceResourceTiming extends PerformanceEntry {
readonly connectEnd: number;
readonly connectStart: number;
@@ -11098,6 +11330,7 @@
new(): PerformanceResourceTiming;
};
+/** The PerformanceTiming interface is a legacy interface kept for backwards compatibility and contains properties that offer performance timing information for various events which occur during the loading and use of the current page. You get a PerformanceTiming object describing your page using the window.performance.timing property. */
interface PerformanceTiming {
readonly connectEnd: number;
readonly connectStart: number;
@@ -11128,6 +11361,7 @@
new(): PerformanceTiming;
};
+/** PeriodicWave has no inputs or outputs; it is used to define custom oscillators when calling OscillatorNode.setPeriodicWave(). The PeriodicWave itself is created/returned by AudioContext.createPeriodicWave(). */
interface PeriodicWave {
}
@@ -11155,6 +11389,7 @@
new(): PermissionRequestedEvent;
};
+/** The Plugin interface provides information about a browser plugin. */
interface Plugin {
readonly description: string;
readonly filename: string;
@@ -11171,6 +11406,7 @@
new(): Plugin;
};
+/** The PluginArray interface is used to store a list of Plugin objects describing the available plugins; it's returned by the window.navigator.plugins property. The PluginArray is not a JavaScript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and namedItem("name") methods. */
interface PluginArray {
readonly length: number;
item(index: number): Plugin;
@@ -11184,6 +11420,7 @@
new(): PluginArray;
};
+/** The PointerEvent interface represents the state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc. */
interface PointerEvent extends MouseEvent {
readonly height: number;
readonly isPrimary: boolean;
@@ -11202,6 +11439,7 @@
new(type: string, eventInitDict?: PointerEventInit): PointerEvent;
};
+/** An event handler for the popstate event on the window. */
interface PopStateEvent extends Event {
readonly state: any;
}
@@ -11211,11 +11449,13 @@
new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent;
};
+/** The Position interface represents the position of the concerned device at a given time. The position, represented by a Coordinates object, comprehends the 2D position of the device, on a spheroid representing the Earth, but also its altitude and its speed. */
interface Position {
readonly coords: Coordinates;
readonly timestamp: number;
}
+/** The PositionError interface represents the reason of an error occurring when using the geolocating device. */
interface PositionError {
readonly code: number;
readonly message: string;
@@ -11224,6 +11464,7 @@
readonly TIMEOUT: number;
}
+/** A processing instruction embeds application-specific instructions in XML which can be ignored by other applications that don't recognize them. */
interface ProcessingInstruction extends CharacterData {
readonly target: string;
}
@@ -11233,6 +11474,7 @@
new(): ProcessingInstruction;
};
+/** The ProgressEvent interface represents events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */
interface ProgressEvent extends Event {
readonly lengthComputable: boolean;
readonly loaded: number;
@@ -11254,6 +11496,7 @@
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
};
+/** The PushManager interface of the Push API provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
interface PushManager {
getSubscription(): Promise<PushSubscription | null>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
@@ -11266,6 +11509,7 @@
readonly supportedContentEncodings: ReadonlyArray<string>;
};
+/** The PushSubscription interface of the Push API provides a subcription's URL endpoint and allows unsubscription from a push service. */
interface PushSubscription {
readonly endpoint: string;
readonly expirationTime: number | null;
@@ -11321,6 +11565,7 @@
new(): RTCDTMFSender;
};
+/** The RTCDTMFToneChangeEvent interface represents events sent to indicate that DTMF tones have started or finished playing. This interface is used by the tonechange event. */
interface RTCDTMFToneChangeEvent extends Event {
readonly tone: string;
}
@@ -11460,6 +11705,7 @@
new(type: string, eventInitDict: RTCErrorEventInit): RTCErrorEvent;
};
+/** The RTCIceCandidate interface—part of the WebRTC API—represents a candidate Internet Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection. */
interface RTCIceCandidate {
readonly candidate: string;
readonly component: RTCIceComponent | null;
@@ -11530,6 +11776,7 @@
"statechange": Event;
}
+/** The RTCIceTransport interface provides access to information about the ICE transport layer over which the data is being sent and received. */
interface RTCIceTransport extends EventTarget {
readonly component: RTCIceComponent;
readonly gatheringState: RTCIceGathererState;
@@ -11586,6 +11833,7 @@
"track": RTCTrackEvent;
}
+/** The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. */
interface RTCPeerConnection extends EventTarget {
readonly canTrickleIceCandidates: boolean | null;
readonly connectionState: RTCPeerConnectionState;
@@ -11655,6 +11903,7 @@
new(type: string, eventInitDict: RTCPeerConnectionIceErrorEventInit): RTCPeerConnectionIceErrorEvent;
};
+/** The RTCPeerConnectionIceEvent interface represents events that occurs in relation to ICE candidates with the target, usually an RTCPeerConnection. Only one event is of this type: icecandidate. */
interface RTCPeerConnectionIceEvent extends Event {
readonly candidate: RTCIceCandidate | null;
readonly url: string | null;
@@ -11665,6 +11914,7 @@
new(type: string, eventInitDict?: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;
};
+/** The RTCRtpReceiver interface of the the WebRTC API manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection. */
interface RTCRtpReceiver {
readonly rtcpTransport: RTCDtlsTransport | null;
readonly track: MediaStreamTrack;
@@ -11681,6 +11931,7 @@
getCapabilities(kind: string): RTCRtpCapabilities | null;
};
+/** The RTCRtpSender interface provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer. */
interface RTCRtpSender {
readonly dtmf: RTCDTMFSender | null;
readonly rtcpTransport: RTCDtlsTransport | null;
@@ -11736,6 +11987,7 @@
new(): RTCSctpTransport;
};
+/** The RTCSessionDescription interface describes one end of a connection—or potential connection—and how it's configured. Each RTCSessionDescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session. */
interface RTCSessionDescription {
readonly sdp: string;
readonly type: RTCSdpType;
@@ -11833,6 +12085,7 @@
new(): RandomSource;
};
+/** The Range interface represents a fragment of a document that can contain nodes and parts of text nodes. */
interface Range extends AbstractRange {
/**
* Returns the node, furthest away from
@@ -11892,6 +12145,7 @@
error(error?: any): void;
}
+/** The ReadableStream interface of the Streams API represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> {
readonly locked: boolean;
cancel(reason?: any): Promise<void>;
@@ -11956,6 +12210,7 @@
new(): ReadableStreamReader;
};
+/** The Request interface of the Fetch API represents a resource request. */
interface Request extends Body {
/**
* Returns the cache mode associated with request, which is a string indicating
@@ -12041,6 +12296,7 @@
new(input: RequestInfo, init?: RequestInit): Request;
};
+/** The Response interface of the Fetch API represents the response to a request. */
interface Response extends Body {
readonly headers: Headers;
readonly ok: boolean;
@@ -12060,6 +12316,7 @@
redirect(url: string, status?: number): Response;
};
+/** The SVGAElement interface provides access to the properties of <a> element, as well as methods to manipulate them. */
interface SVGAElement extends SVGGraphicsElement, SVGURIReference {
readonly target: SVGAnimatedString;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12073,6 +12330,7 @@
new(): SVGAElement;
};
+/** The SVGAngle interface is used to represent a value that can be an <angle> or <number> value. An SVGAngle reflected through the animVal attribute is always read only. */
interface SVGAngle {
readonly unitType: number;
value: number;
@@ -12133,6 +12391,7 @@
new(): SVGAnimateTransformElement;
};
+/** The SVGAnimatedAngle interface is used for attributes of basic type <angle> which can be animated. */
interface SVGAnimatedAngle {
readonly animVal: SVGAngle;
readonly baseVal: SVGAngle;
@@ -12143,6 +12402,7 @@
new(): SVGAnimatedAngle;
};
+/** The SVGAnimatedBoolean interface is used for attributes of type boolean which can be animated. */
interface SVGAnimatedBoolean {
readonly animVal: boolean;
baseVal: boolean;
@@ -12153,6 +12413,7 @@
new(): SVGAnimatedBoolean;
};
+/** The SVGAnimatedEnumeration interface is used for attributes whose value must be a constant from a particular enumeration and which can be animated. */
interface SVGAnimatedEnumeration {
readonly animVal: number;
baseVal: number;
@@ -12163,6 +12424,7 @@
new(): SVGAnimatedEnumeration;
};
+/** The SVGAnimatedInteger interface is used for attributes of basic type <integer> which can be animated. */
interface SVGAnimatedInteger {
readonly animVal: number;
baseVal: number;
@@ -12173,6 +12435,7 @@
new(): SVGAnimatedInteger;
};
+/** The SVGAnimatedLength interface is used for attributes of basic type <length> which can be animated. */
interface SVGAnimatedLength {
readonly animVal: SVGLength;
readonly baseVal: SVGLength;
@@ -12183,6 +12446,7 @@
new(): SVGAnimatedLength;
};
+/** The SVGAnimatedLengthList interface is used for attributes of type SVGLengthList which can be animated. */
interface SVGAnimatedLengthList {
readonly animVal: SVGLengthList;
readonly baseVal: SVGLengthList;
@@ -12193,6 +12457,7 @@
new(): SVGAnimatedLengthList;
};
+/** The SVGAnimatedNumber interface is used for attributes of basic type <Number> which can be animated. */
interface SVGAnimatedNumber {
readonly animVal: number;
baseVal: number;
@@ -12203,6 +12468,7 @@
new(): SVGAnimatedNumber;
};
+/** The SVGAnimatedNumber interface is used for attributes which take a list of numbers and which can be animated. */
interface SVGAnimatedNumberList {
readonly animVal: SVGNumberList;
readonly baseVal: SVGNumberList;
@@ -12218,6 +12484,7 @@
readonly points: SVGPointList;
}
+/** The SVGAnimatedPreserveAspectRatio interface is used for attributes of type SVGPreserveAspectRatio which can be animated. */
interface SVGAnimatedPreserveAspectRatio {
readonly animVal: SVGPreserveAspectRatio;
readonly baseVal: SVGPreserveAspectRatio;
@@ -12228,6 +12495,7 @@
new(): SVGAnimatedPreserveAspectRatio;
};
+/** The SVGAnimatedRect interface is used for attributes of basic SVGRect which can be animated. */
interface SVGAnimatedRect {
readonly animVal: DOMRectReadOnly;
readonly baseVal: DOMRect;
@@ -12238,6 +12506,7 @@
new(): SVGAnimatedRect;
};
+/** The SVGAnimatedString interface represents string attributes which can be animated from each SVG declaration. You need to create SVG attribute before doing anything else, everything should be declared inside this. */
interface SVGAnimatedString {
readonly animVal: string;
baseVal: string;
@@ -12248,6 +12517,7 @@
new(): SVGAnimatedString;
};
+/** The SVGAnimatedTransformList interface is used for attributes which take a list of numbers and which can be animated. */
interface SVGAnimatedTransformList {
readonly animVal: SVGTransformList;
readonly baseVal: SVGTransformList;
@@ -12274,6 +12544,7 @@
new(): SVGAnimationElement;
};
+/** The SVGCircleElement interface is an interface for the <circle> element. The circle element is defined by the cx and cy attributes that denote the coordinates of the centre of the circle. */
interface SVGCircleElement extends SVGGraphicsElement {
readonly cx: SVGAnimatedLength;
readonly cy: SVGAnimatedLength;
@@ -12289,6 +12560,7 @@
new(): SVGCircleElement;
};
+/** The SVGClipPathElement interface provides access to the properties of <clipPath> elements, as well as methods to manipulate them. */
interface SVGClipPathElement extends SVGGraphicsElement {
readonly clipPathUnits: SVGAnimatedEnumeration;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12302,6 +12574,7 @@
new(): SVGClipPathElement;
};
+/** The SVGComponentTransferFunctionElement interface defines a base interface used by the component transfer function interfaces. */
interface SVGComponentTransferFunctionElement extends SVGElement {
readonly amplitude: SVGAnimatedNumber;
readonly exponent: SVGAnimatedNumber;
@@ -12347,6 +12620,7 @@
new(): SVGCursorElement;
};
+/** The SVGDefsElement interface corresponds to the <defs> element. */
interface SVGDefsElement extends SVGGraphicsElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12359,6 +12633,7 @@
new(): SVGDefsElement;
};
+/** The SVGDescElement interface corresponds to the <desc> element. */
interface SVGDescElement extends SVGElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12374,6 +12649,7 @@
interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {
}
+/** All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface. */
interface SVGElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle {
/** @deprecated */
readonly className: any;
@@ -12412,6 +12688,7 @@
new(): SVGElementInstanceList;
};
+/** The SVGEllipseElement interface provides access to the properties of <ellipse> elements. */
interface SVGEllipseElement extends SVGGraphicsElement {
readonly cx: SVGAnimatedLength;
readonly cy: SVGAnimatedLength;
@@ -12428,6 +12705,7 @@
new(): SVGEllipseElement;
};
+/** The SVGFEBlendElement interface corresponds to the <feBlend> element. */
interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly in2: SVGAnimatedString;
@@ -12477,6 +12755,7 @@
readonly SVG_FEBLEND_MODE_UNKNOWN: number;
};
+/** The SVGFEColorMatrixElement interface corresponds to the <feColorMatrix> element. */
interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly type: SVGAnimatedEnumeration;
@@ -12502,6 +12781,7 @@
readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;
};
+/** The SVGFEComponentTransferElement interface corresponds to the <feComponentTransfer> element. */
interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12515,6 +12795,7 @@
new(): SVGFEComponentTransferElement;
};
+/** The SVGFECompositeElement interface corresponds to the <feComposite> element. */
interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly in2: SVGAnimatedString;
@@ -12548,6 +12829,7 @@
readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;
};
+/** The SVGFEConvolveMatrixElement interface corresponds to the <feConvolveMatrix> element. */
interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly bias: SVGAnimatedNumber;
readonly divisor: SVGAnimatedNumber;
@@ -12580,6 +12862,7 @@
readonly SVG_EDGEMODE_WRAP: number;
};
+/** The SVGFEDiffuseLightingElement interface corresponds to the <feDiffuseLighting> element. */
interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly diffuseConstant: SVGAnimatedNumber;
readonly in1: SVGAnimatedString;
@@ -12597,6 +12880,7 @@
new(): SVGFEDiffuseLightingElement;
};
+/** The SVGFEDisplacementMapElement interface corresponds to the <feDisplacementMap> element. */
interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly in2: SVGAnimatedString;
@@ -12624,6 +12908,7 @@
readonly SVG_CHANNEL_UNKNOWN: number;
};
+/** The SVGFEDistantLightElement interface corresponds to the <feDistantLight> element. */
interface SVGFEDistantLightElement extends SVGElement {
readonly azimuth: SVGAnimatedNumber;
readonly elevation: SVGAnimatedNumber;
@@ -12638,6 +12923,7 @@
new(): SVGFEDistantLightElement;
};
+/** The SVGFEFloodElement interface corresponds to the <feFlood> element. */
interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12650,6 +12936,7 @@
new(): SVGFEFloodElement;
};
+/** The SVGFEFuncAElement interface corresponds to the <feFuncA> element. */
interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12662,6 +12949,7 @@
new(): SVGFEFuncAElement;
};
+/** The SVGFEFuncBElement interface corresponds to the <feFuncB> element. */
interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12674,6 +12962,7 @@
new(): SVGFEFuncBElement;
};
+/** The SVGFEFuncGElement interface corresponds to the <feFuncG> element. */
interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12686,6 +12975,7 @@
new(): SVGFEFuncGElement;
};
+/** The SVGFEFuncRElement interface corresponds to the <feFuncR> element. */
interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12698,6 +12988,7 @@
new(): SVGFEFuncRElement;
};
+/** The SVGFEGaussianBlurElement interface corresponds to the <feGaussianBlur> element. */
interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly stdDeviationX: SVGAnimatedNumber;
@@ -12714,6 +13005,7 @@
new(): SVGFEGaussianBlurElement;
};
+/** The SVGFEImageElement interface corresponds to the <feImage> element. */
interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {
readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12727,6 +13019,7 @@
new(): SVGFEImageElement;
};
+/** The SVGFEMergeElement interface corresponds to the <feMerge> element. */
interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12739,6 +13032,7 @@
new(): SVGFEMergeElement;
};
+/** The SVGFEMergeNodeElement interface corresponds to the <feMergeNode> element. */
interface SVGFEMergeNodeElement extends SVGElement {
readonly in1: SVGAnimatedString;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12752,6 +13046,7 @@
new(): SVGFEMergeNodeElement;
};
+/** The SVGFEMorphologyElement interface corresponds to the <feMorphology> element. */
interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly operator: SVGAnimatedEnumeration;
@@ -12774,6 +13069,7 @@
readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;
};
+/** The SVGFEOffsetElement interface corresponds to the <feOffset> element. */
interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly dx: SVGAnimatedNumber;
readonly dy: SVGAnimatedNumber;
@@ -12789,6 +13085,7 @@
new(): SVGFEOffsetElement;
};
+/** The SVGFEPointLightElement interface corresponds to the <fePointLight> element. */
interface SVGFEPointLightElement extends SVGElement {
readonly x: SVGAnimatedNumber;
readonly y: SVGAnimatedNumber;
@@ -12804,6 +13101,7 @@
new(): SVGFEPointLightElement;
};
+/** The SVGFESpecularLightingElement interface corresponds to the <feSpecularLighting> element. */
interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
readonly kernelUnitLengthX: SVGAnimatedNumber;
@@ -12822,6 +13120,7 @@
new(): SVGFESpecularLightingElement;
};
+/** The SVGFESpotLightElement interface corresponds to the <feSpotLight> element. */
interface SVGFESpotLightElement extends SVGElement {
readonly limitingConeAngle: SVGAnimatedNumber;
readonly pointsAtX: SVGAnimatedNumber;
@@ -12842,6 +13141,7 @@
new(): SVGFESpotLightElement;
};
+/** The SVGFETileElement interface corresponds to the <feTile> element. */
interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly in1: SVGAnimatedString;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -12855,6 +13155,7 @@
new(): SVGFETileElement;
};
+/** The SVGFETurbulenceElement interface corresponds to the <feTurbulence> element. */
interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
readonly baseFrequencyX: SVGAnimatedNumber;
readonly baseFrequencyY: SVGAnimatedNumber;
@@ -12885,6 +13186,7 @@
readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;
};
+/** The SVGFilterElement interface provides access to the properties of <filter> elements, as well as methods to manipulate them. */
interface SVGFilterElement extends SVGElement, SVGURIReference {
/** @deprecated */
readonly filterResX: SVGAnimatedInteger;
@@ -12922,6 +13224,7 @@
readonly viewBox: SVGAnimatedRect;
}
+/** The SVGForeignObjectElement interface provides access to the properties of <foreignObject> elements, as well as methods to manipulate them. */
interface SVGForeignObjectElement extends SVGGraphicsElement {
readonly height: SVGAnimatedLength;
readonly width: SVGAnimatedLength;
@@ -12938,6 +13241,7 @@
new(): SVGForeignObjectElement;
};
+/** The SVGGElement interface corresponds to the <g> element. */
interface SVGGElement extends SVGGraphicsElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -12967,6 +13271,7 @@
new(): SVGGeometryElement;
};
+/** The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement. */
interface SVGGradientElement extends SVGElement, SVGURIReference {
readonly gradientTransform: SVGAnimatedTransformList;
readonly gradientUnits: SVGAnimatedEnumeration;
@@ -12990,6 +13295,7 @@
readonly SVG_SPREADMETHOD_UNKNOWN: number;
};
+/** The SVGGraphicsElement interface represents SVG elements whose primary purpose is to directly render graphics into a group. */
interface SVGGraphicsElement extends SVGElement, SVGTests {
readonly transform: SVGAnimatedTransformList;
getBBox(options?: SVGBoundingBoxOptions): DOMRect;
@@ -13006,6 +13312,7 @@
new(): SVGGraphicsElement;
};
+/** The SVGImageElement interface corresponds to the <image> element. */
interface SVGImageElement extends SVGGraphicsElement, SVGURIReference {
readonly height: SVGAnimatedLength;
readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
@@ -13023,6 +13330,7 @@
new(): SVGImageElement;
};
+/** The SVGLength interface correspond to the <length> basic data type. */
interface SVGLength {
readonly unitType: number;
value: number;
@@ -13059,6 +13367,7 @@
readonly SVG_LENGTHTYPE_UNKNOWN: number;
};
+/** The SVGLengthList defines a list of SVGLength objects. */
interface SVGLengthList {
readonly length: number;
readonly numberOfItems: number;
@@ -13077,6 +13386,7 @@
new(): SVGLengthList;
};
+/** The SVGLineElement interface provides access to the properties of <line> elements, as well as methods to manipulate them. */
interface SVGLineElement extends SVGGraphicsElement {
readonly x1: SVGAnimatedLength;
readonly x2: SVGAnimatedLength;
@@ -13093,6 +13403,7 @@
new(): SVGLineElement;
};
+/** The SVGLinearGradientElement interface corresponds to the <linearGradient> element. */
interface SVGLinearGradientElement extends SVGGradientElement {
readonly x1: SVGAnimatedLength;
readonly x2: SVGAnimatedLength;
@@ -13142,6 +13453,7 @@
readonly SVG_MARKER_ORIENT_UNKNOWN: number;
};
+/** The SVGMaskElement interface provides access to the properties of <mask> elements, as well as methods to manipulate them. */
interface SVGMaskElement extends SVGElement, SVGTests {
readonly height: SVGAnimatedLength;
readonly maskContentUnits: SVGAnimatedEnumeration;
@@ -13160,6 +13472,7 @@
new(): SVGMaskElement;
};
+/** The SVGMetadataElement interface corresponds to the <metadata> element. */
interface SVGMetadataElement extends SVGElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13172,6 +13485,7 @@
new(): SVGMetadataElement;
};
+/** The SVGNumber interface corresponds to the <number> basic data type. */
interface SVGNumber {
value: number;
}
@@ -13181,6 +13495,7 @@
new(): SVGNumber;
};
+/** The SVGNumberList defines a list of SVGNumber objects. */
interface SVGNumberList {
readonly length: number;
readonly numberOfItems: number;
@@ -13199,6 +13514,7 @@
new(): SVGNumberList;
};
+/** The SVGPathElement interface corresponds to the <path> element. */
interface SVGPathElement extends SVGGraphicsElement {
/** @deprecated */
readonly pathSegList: SVGPathSegList;
@@ -13531,6 +13847,7 @@
new(): SVGPathSegMovetoRel;
};
+/** The SVGPatternElement interface corresponds to the <pattern> element. */
interface SVGPatternElement extends SVGElement, SVGTests, SVGFitToViewBox, SVGURIReference {
readonly height: SVGAnimatedLength;
readonly patternContentUnits: SVGAnimatedEnumeration;
@@ -13566,6 +13883,7 @@
new(): SVGPointList;
};
+/** The SVGPolygonElement interface provides access to the properties of <polygon> elements, as well as methods to manipulate them. */
interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13578,6 +13896,7 @@
new(): SVGPolygonElement;
};
+/** The SVGPolylineElement interface provides access to the properties of <polyline> elements, as well as methods to manipulate them. */
interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13590,6 +13909,7 @@
new(): SVGPolylineElement;
};
+/** The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio attribute, which is available for some of SVG's elements. */
interface SVGPreserveAspectRatio {
align: number;
meetOrSlice: number;
@@ -13628,6 +13948,7 @@
readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;
};
+/** The SVGRadialGradientElement interface corresponds to the <RadialGradient> element. */
interface SVGRadialGradientElement extends SVGGradientElement {
readonly cx: SVGAnimatedLength;
readonly cy: SVGAnimatedLength;
@@ -13645,6 +13966,7 @@
new(): SVGRadialGradientElement;
};
+/** The SVGRectElement interface provides access to the properties of <rect> elements, as well as methods to manipulate them. */
interface SVGRectElement extends SVGGraphicsElement {
readonly height: SVGAnimatedLength;
readonly rx: SVGAnimatedLength;
@@ -13668,6 +13990,7 @@
"SVGZoom": SVGZoomEvent;
}
+/** The SVGSVGElement interface provides access to the properties of <svg> elements, as well as methods to manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices. */
interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {
/** @deprecated */
contentScriptType: string;
@@ -13736,6 +14059,7 @@
readonly SVG_ZOOMANDPAN_UNKNOWN: number;
};
+/** The SVGScriptElement interface corresponds to the SVG <script> element. */
interface SVGScriptElement extends SVGElement, SVGURIReference {
type: string;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -13749,6 +14073,7 @@
new(): SVGScriptElement;
};
+/** The SVGStopElement interface corresponds to the <stop> element. */
interface SVGStopElement extends SVGElement {
readonly offset: SVGAnimatedNumber;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -13762,6 +14087,7 @@
new(): SVGStopElement;
};
+/** The SVGStringList defines a list of DOMString objects. */
interface SVGStringList {
readonly length: number;
readonly numberOfItems: number;
@@ -13780,6 +14106,7 @@
new(): SVGStringList;
};
+/** The SVGStyleElement interface corresponds to the SVG <style> element. */
interface SVGStyleElement extends SVGElement {
disabled: boolean;
media: string;
@@ -13796,6 +14123,7 @@
new(): SVGStyleElement;
};
+/** The SVGSwitchElement interface corresponds to the <switch> element. */
interface SVGSwitchElement extends SVGGraphicsElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13808,6 +14136,7 @@
new(): SVGSwitchElement;
};
+/** The SVGSymbolElement interface corresponds to the <symbol> element. */
interface SVGSymbolElement extends SVGElement, SVGFitToViewBox {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13820,6 +14149,7 @@
new(): SVGSymbolElement;
};
+/** The SVGTSpanElement interface represents a <tspan> element. */
interface SVGTSpanElement extends SVGTextPositioningElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13837,6 +14167,7 @@
readonly systemLanguage: SVGStringList;
}
+/** The SVGTextContentElement interface is implemented by elements that support rendering child text content. It is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement. */
interface SVGTextContentElement extends SVGGraphicsElement {
readonly lengthAdjust: SVGAnimatedEnumeration;
readonly textLength: SVGAnimatedLength;
@@ -13866,6 +14197,7 @@
readonly LENGTHADJUST_UNKNOWN: number;
};
+/** The SVGTextElement interface corresponds to the <text> elements. */
interface SVGTextElement extends SVGTextPositioningElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13878,6 +14210,7 @@
new(): SVGTextElement;
};
+/** The SVGTextPathElement interface corresponds to the <textPath> element. */
interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {
readonly method: SVGAnimatedEnumeration;
readonly spacing: SVGAnimatedEnumeration;
@@ -13905,6 +14238,7 @@
readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;
};
+/** The SVGTextPositioningElement interface is implemented by elements that support attributes that position individual text glyphs. It is inherited by SVGTextElement, SVGTSpanElement, SVGTRefElement and SVGAltGlyphElement. */
interface SVGTextPositioningElement extends SVGTextContentElement {
readonly dx: SVGAnimatedLengthList;
readonly dy: SVGAnimatedLengthList;
@@ -13922,6 +14256,7 @@
new(): SVGTextPositioningElement;
};
+/** The SVGTitleElement interface corresponds to the <title> element. */
interface SVGTitleElement extends SVGElement {
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -13934,6 +14269,7 @@
new(): SVGTitleElement;
};
+/** SVGTransform is the interface for one of the component transformations within an SVGTransformList; thus, an SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute. */
interface SVGTransform {
readonly angle: number;
readonly matrix: SVGMatrix;
@@ -13965,6 +14301,7 @@
readonly SVG_TRANSFORM_UNKNOWN: number;
};
+/** The SVGTransformList defines a list of SVGTransform objects. */
interface SVGTransformList {
readonly numberOfItems: number;
appendItem(newItem: SVGTransform): SVGTransform;
@@ -13987,6 +14324,7 @@
readonly href: SVGAnimatedString;
}
+/** The SVGUnitTypes interface defines a commonly used set of constants used for reflecting gradientUnits, patternContentUnits and other similar attributes. */
interface SVGUnitTypes {
readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;
readonly SVG_UNIT_TYPE_UNKNOWN: number;
@@ -14001,6 +14339,7 @@
readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;
};
+/** The SVGUseElement interface corresponds to the <use> element. */
interface SVGUseElement extends SVGGraphicsElement, SVGURIReference {
readonly animatedInstanceRoot: SVGElementInstance | null;
readonly height: SVGAnimatedLength;
@@ -14019,6 +14358,7 @@
new(): SVGUseElement;
};
+/** The SVGViewElement interface provides access to the properties of <view> elements, as well as methods to manipulate them. */
interface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan {
/** @deprecated */
readonly viewTarget: SVGStringList;
@@ -14036,6 +14376,7 @@
readonly SVG_ZOOMANDPAN_UNKNOWN: number;
};
+/** The SVGZoomAndPan interface is used to reflect the zoomAndPan attribute, and is mixed in to other interfaces for elements that support this attribute. */
interface SVGZoomAndPan {
readonly zoomAndPan: number;
}
@@ -14079,6 +14420,7 @@
new(): ScopedCredentialInfo;
};
+/** The Screen interface represents a screen, usually the one on which the current window is being rendered, and is obtained using window.screen. */
interface Screen {
readonly availHeight: number;
readonly availWidth: number;
@@ -14119,6 +14461,7 @@
"audioprocess": AudioProcessingEvent;
}
+/** The ScriptProcessorNode interface allows the generation, processing, or analyzing of audio using JavaScript. */
interface ScriptProcessorNode extends AudioNode {
/** @deprecated */
readonly bufferSize: number;
@@ -14135,6 +14478,7 @@
new(): ScriptProcessorNode;
};
+/** The SecurityPolicyViolationEvent interface inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. */
interface SecurityPolicyViolationEvent extends Event {
readonly blockedURI: string;
readonly columnNumber: number;
@@ -14153,33 +14497,29 @@
new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;
};
+/** A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection(). */
interface Selection {
- readonly anchorNode: Node;
+ readonly anchorNode: Node | null;
readonly anchorOffset: number;
- readonly baseNode: Node;
- readonly baseOffset: number;
- readonly extentNode: Node;
- readonly extentOffset: number;
- readonly focusNode: Node;
+ readonly focusNode: Node | null;
readonly focusOffset: number;
readonly isCollapsed: boolean;
readonly rangeCount: number;
readonly type: string;
addRange(range: Range): void;
- collapse(parentNode: Node, offset: number): void;
+ collapse(node: Node | null, offset?: number): void;
collapseToEnd(): void;
collapseToStart(): void;
- containsNode(node: Node, partlyContained: boolean): boolean;
+ containsNode(node: Node, allowPartialContainment?: boolean): boolean;
deleteFromDocument(): void;
empty(): void;
- extend(newNode: Node, offset: number): void;
+ extend(node: Node, offset?: number): void;
getRangeAt(index: number): Range;
removeAllRanges(): void;
removeRange(range: Range): void;
- selectAllChildren(parentNode: Node): void;
- setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;
- setPosition(parentNode: Node, offset: number): void;
- toString(): string;
+ selectAllChildren(node: Node): void;
+ setBaseAndExtent(anchorNode: Node, anchorOffset: number, focusNode: Node, focusOffset: number): void;
+ setPosition(node: Node | null, offset?: number): void;
}
declare var Selection: {
@@ -14197,6 +14537,7 @@
"statechange": Event;
}
+/** The ServiceWorker interface of the ServiceWorker API provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */
interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
readonly scriptURL: string;
@@ -14219,6 +14560,7 @@
"messageerror": MessageEvent;
}
+/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */
interface ServiceWorkerContainer extends EventTarget {
readonly controller: ServiceWorker | null;
oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
@@ -14240,6 +14582,7 @@
new(): ServiceWorkerContainer;
};
+/** The ServiceWorkerMessageEvent interface of the ServiceWorker API contains information about an event sent to a ServiceWorkerContainer target. This extends the default message event to allow setting a ServiceWorker object as the source of a message. The event object is accessed via the handler function of a message event, when fired by a message received from a service worker. */
interface ServiceWorkerMessageEvent extends Event {
readonly data: any;
readonly lastEventId: string;
@@ -14257,6 +14600,7 @@
"updatefound": Event;
}
+/** The ServiceWorkerRegistration interface of the ServiceWorker API represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */
interface ServiceWorkerRegistration extends EventTarget {
readonly active: ServiceWorker | null;
readonly installing: ServiceWorker | null;
@@ -14282,35 +14626,52 @@
new(): ServiceWorkerRegistration;
};
-interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment, DocumentOrShadowRoot {
+interface ShadowRoot extends DocumentFragment, DocumentOrShadowRoot {
readonly host: Element;
innerHTML: string;
readonly mode: ShadowRootMode;
}
-interface ShadowRootInit {
- delegatesFocus?: boolean;
- mode: "open" | "closed";
-}
+declare var ShadowRoot: {
+ prototype: ShadowRoot;
+ new(): ShadowRoot;
+};
interface Slotable {
readonly assignedSlot: HTMLSlotElement | null;
}
+interface SourceBufferEventMap {
+ "abort": Event;
+ "error": Event;
+ "update": Event;
+ "updateend": Event;
+ "updatestart": Event;
+}
+
+/** The SourceBuffer interface represents a chunk of media to be passed into an HTMLMediaElement and played, via a MediaSource object. This can be made up of one or several media segments. */
interface SourceBuffer extends EventTarget {
appendWindowEnd: number;
appendWindowStart: number;
readonly audioTracks: AudioTrackList;
readonly buffered: TimeRanges;
mode: AppendMode;
+ onabort: ((this: SourceBuffer, ev: Event) => any) | null;
+ onerror: ((this: SourceBuffer, ev: Event) => any) | null;
+ onupdate: ((this: SourceBuffer, ev: Event) => any) | null;
+ onupdateend: ((this: SourceBuffer, ev: Event) => any) | null;
+ onupdatestart: ((this: SourceBuffer, ev: Event) => any) | null;
readonly textTracks: TextTrackList;
timestampOffset: number;
readonly updating: boolean;
readonly videoTracks: VideoTrackList;
abort(): void;
- appendBuffer(data: ArrayBuffer | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;
- appendStream(stream: MSStream, maxSize?: number): void;
+ appendBuffer(data: BufferSource): void;
remove(start: number, end: number): void;
+ addEventListener<K extends keyof SourceBufferEventMap>(type: K, listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof SourceBufferEventMap>(type: K, listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var SourceBuffer: {
@@ -14318,9 +14679,20 @@
new(): SourceBuffer;
};
+interface SourceBufferListEventMap {
+ "addsourcebuffer": Event;
+ "removesourcebuffer": Event;
+}
+
+/** The SourceBufferList interface represents a simple container list for multiple SourceBuffer objects. */
interface SourceBufferList extends EventTarget {
readonly length: number;
- item(index: number): SourceBuffer;
+ onaddsourcebuffer: ((this: SourceBufferList, ev: Event) => any) | null;
+ onremovesourcebuffer: ((this: SourceBufferList, ev: Event) => any) | null;
+ addEventListener<K extends keyof SourceBufferListEventMap>(type: K, listener: (this: SourceBufferList, ev: SourceBufferListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof SourceBufferListEventMap>(type: K, listener: (this: SourceBufferList, ev: SourceBufferListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
[index: number]: SourceBuffer;
}
@@ -14457,6 +14829,7 @@
"voiceschanged": Event;
}
+/** The SpeechSynthesis interface of the Web Speech API is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides. */
interface SpeechSynthesis extends EventTarget {
onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;
readonly paused: boolean;
@@ -14487,6 +14860,7 @@
new(): SpeechSynthesisErrorEvent;
};
+/** The SpeechSynthesisEvent interface of the Web Speech API contains information about the current state of SpeechSynthesisUtterance objects that have been processed in the speech service. */
interface SpeechSynthesisEvent extends Event {
readonly charIndex: number;
readonly elapsedTime: number;
@@ -14509,6 +14883,7 @@
"start": SpeechSynthesisEvent;
}
+/** The SpeechSynthesisUtterance interface of the Web Speech API represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.) */
interface SpeechSynthesisUtterance extends EventTarget {
lang: string;
onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;
@@ -14535,6 +14910,7 @@
new(text: string): SpeechSynthesisUtterance;
};
+/** The SpeechSynthesisVoice interface of the Web Speech API represents a voice that the system supports. Every SpeechSynthesisVoice has its own relative speech service including information about language, name and URI. */
interface SpeechSynthesisVoice {
readonly default: boolean;
readonly lang: string;
@@ -14556,6 +14932,7 @@
new(): StaticRange;
};
+/** The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode. */
interface StereoPannerNode extends AudioNode {
readonly pan: AudioParam;
}
@@ -14565,6 +14942,7 @@
new(context: BaseAudioContext, options?: StereoPannerOptions): StereoPannerNode;
};
+/** The Storage interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items. */
interface Storage {
/**
* Returns the number of key/value pairs currently present in the list associated with the
@@ -14600,6 +14978,7 @@
new(): Storage;
};
+/** A StorageEvent is sent to a window when a storage area it has access to is changed within the context of another document. */
interface StorageEvent extends Event {
/**
* Returns the key of the storage item being changed.
@@ -14649,6 +15028,7 @@
new(): StyleMedia;
};
+/** An object implementing the StyleSheet interface represents a single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface. */
interface StyleSheet {
disabled: boolean;
readonly href: string | null;
@@ -14664,6 +15044,7 @@
new(): StyleSheet;
};
+/** The StyleSheetList interface represents a list of StyleSheet. */
interface StyleSheetList {
readonly length: number;
item(index: number): StyleSheet | null;
@@ -14675,6 +15056,7 @@
new(): StyleSheetList;
};
+/** The SubtleCrypto interface represents a set of cryptographic primitives. It is available via the Crypto.subtle properties available in a window context (via Window.crypto). */
interface SubtleCrypto {
decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike<ArrayBuffer>;
deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike<ArrayBuffer>;
@@ -14701,6 +15083,7 @@
new(): SubtleCrypto;
};
+/** The SyncManager interface of the the ServiceWorker API provides an interface for registering and listing sync registrations. */
interface SyncManager {
getTags(): Promise<string[]>;
register(tag: string): Promise<void>;
@@ -14711,6 +15094,7 @@
new(): SyncManager;
};
+/** The Text interface represents the textual content of Element or Attr.  If an element has no markup within its content, it has a single child implementing Text that contains the element's text.  However, if the element contains markup, it is parsed into information items and Text nodes that form its children. */
interface Text extends CharacterData, Slotable {
readonly assignedSlot: HTMLSlotElement | null;
/**
@@ -14728,6 +15112,7 @@
new(data?: string): Text;
};
+/** The TextDecoder interface represents a decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
interface TextDecoder {
/**
* Returns encoding's name, lowercased.
@@ -14763,6 +15148,7 @@
new(label?: string, options?: TextDecoderOptions): TextDecoder;
};
+/** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
interface TextEncoder {
/**
* Returns "utf-8".
@@ -14809,6 +15195,7 @@
readonly DOM_INPUT_METHOD_VOICE: number;
};
+/** The TextMetrics interface represents the dimension of a text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */
interface TextMetrics {
readonly actualBoundingBoxAscent: number;
readonly actualBoundingBoxDescent: number;
@@ -14838,6 +15225,7 @@
"load": Event;
}
+/** This interface also inherits properties from EventTarget. */
interface TextTrack extends EventTarget {
readonly activeCues: TextTrackCueList;
readonly cues: TextTrackCueList;
@@ -14850,6 +15238,7 @@
onerror: ((this: TextTrack, ev: Event) => any) | null;
onload: ((this: TextTrack, ev: Event) => any) | null;
readonly readyState: number;
+ readonly sourceBuffer: SourceBuffer | null;
addCue(cue: TextTrackCue): void;
removeCue(cue: TextTrackCue): void;
readonly DISABLED: number;
@@ -14882,6 +15271,7 @@
"exit": Event;
}
+/** TextTrackCues represent a string of text that will be displayed for some duration of time on a TextTrack. This includes the start and end times that the cue will be displayed. A TextTrackCue cannot be used directly, instead one of the derived types (e.g. VTTCue) must be used. */
interface TextTrackCue extends EventTarget {
endTime: number;
id: string;
@@ -14935,6 +15325,7 @@
new(): TextTrackList;
};
+/** The TimeRanges interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements. */
interface TimeRanges {
readonly length: number;
end(index: number): number;
@@ -14946,6 +15337,7 @@
new(): TimeRanges;
};
+/** The Touch interface represents a single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. */
interface Touch {
readonly altitudeAngle: number;
readonly azimuthAngle: number;
@@ -14969,6 +15361,7 @@
new(touchInitDict: TouchInit): Touch;
};
+/** The TouchEvent interface represents an event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. */
interface TouchEvent extends UIEvent {
readonly altKey: boolean;
readonly changedTouches: TouchList;
@@ -14984,6 +15377,7 @@
new(type: string, eventInitDict?: TouchEventInit): TouchEvent;
};
+/** The TouchList interface represents a list of contact points with a touch surface; for example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding TouchList object would have one Touch object for each finger, for a total of three entries. */
interface TouchList {
readonly length: number;
item(index: number): Touch | null;
@@ -14995,6 +15389,7 @@
new(): TouchList;
};
+/** The TrackEvent interface, part of the HTML DOM specification, is used for events which represent changes to the set of available tracks on an HTML media element; these events are addtrack and removetrack. */
interface TrackEvent extends Event {
readonly track: VideoTrack | AudioTrack | TextTrack | null;
}
@@ -15021,6 +15416,7 @@
terminate(): void;
}
+/** The TransitionEvent interface represents events providing information related to transitions. */
interface TransitionEvent extends Event {
readonly elapsedTime: number;
readonly propertyName: string;
@@ -15032,6 +15428,7 @@
new(type: string, transitionEventInitDict?: TransitionEventInit): TransitionEvent;
};
+/** The TreeWalker object represents the nodes of a document subtree and a position within them. */
interface TreeWalker {
currentNode: Node;
readonly filter: NodeFilter | null;
@@ -15051,6 +15448,7 @@
new(): TreeWalker;
};
+/** The UIEvent interface represents simple user interface events. */
interface UIEvent extends Event {
readonly detail: number;
readonly view: Window;
@@ -15062,6 +15460,7 @@
new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;
};
+/** The URL interface represents an object providing static methods used for creating object URLs. */
interface URL {
hash: string;
host: string;
@@ -15122,6 +15521,7 @@
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
};
+/** The VRDisplay interface of the WebVR API represents any VR device supported by this API. It includes generic information such as device IDs and descriptions, as well as methods for starting to present a VR scene, retrieving eye parameters and display capabilities, and other important functionality. */
interface VRDisplay extends EventTarget {
readonly capabilities: VRDisplayCapabilities;
depthFar: number;
@@ -15149,6 +15549,7 @@
new(): VRDisplay;
};
+/** The VRDisplayCapabilities interface of the WebVR API describes the capabilities of a VRDisplay — its features can be used to perform VR device capability tests, for example can it return position information. */
interface VRDisplayCapabilities {
readonly canPresent: boolean;
readonly hasExternalDisplay: boolean;
@@ -15162,6 +15563,7 @@
new(): VRDisplayCapabilities;
};
+/** The VRDisplayEvent interface of the WebVR API represents represents the event object of WebVR-related events (see the list of WebVR window extensions). */
interface VRDisplayEvent extends Event {
readonly display: VRDisplay;
readonly reason: VRDisplayEventReason | null;
@@ -15172,6 +15574,7 @@
new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent;
};
+/** The VREyeParameters interface of the WebVR API represents all the information required to correctly render a scene for a given eye, including field of view information. */
interface VREyeParameters {
/** @deprecated */
readonly fieldOfView: VRFieldOfView;
@@ -15185,6 +15588,7 @@
new(): VREyeParameters;
};
+/** The VRFieldOfView interface of the WebVR API represents a field of view defined by 4 different degree values describing the view from a center point. */
interface VRFieldOfView {
readonly downDegrees: number;
readonly leftDegrees: number;
@@ -15197,6 +15601,7 @@
new(): VRFieldOfView;
};
+/** The VRFrameData interface of the WebVR API represents all the information needed to render a single frame of a VR scene; constructed by VRDisplay.getFrameData(). */
interface VRFrameData {
readonly leftProjectionMatrix: Float32Array;
readonly leftViewMatrix: Float32Array;
@@ -15211,6 +15616,7 @@
new(): VRFrameData;
};
+/** The VRPose interface of the WebVR API represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information.) */
interface VRPose {
readonly angularAcceleration: Float32Array | null;
readonly angularVelocity: Float32Array | null;
@@ -15265,6 +15671,7 @@
new(): VTTRegion;
};
+/** The ValidityState interface represents the validity states that an element can be in, with respect to constraint validation. Together, they help explain why an element's value fails to validate, if it's not valid. */
interface ValidityState {
readonly badInput: boolean;
readonly customError: boolean;
@@ -15284,6 +15691,7 @@
new(): ValidityState;
};
+/** A VideoPlaybackQuality object is returned by the HTMLVideoElement.getVideoPlaybackQuality() method and contains metrics that can be used to determine the playback quality of a video. */
interface VideoPlaybackQuality {
readonly corruptedVideoFrames: number;
readonly creationTime: number;
@@ -15297,13 +15705,14 @@
new(): VideoPlaybackQuality;
};
+/** The VideoTrack interface represents a single video track from a <video> element. */
interface VideoTrack {
readonly id: string;
kind: string;
readonly label: string;
language: string;
selected: boolean;
- readonly sourceBuffer: SourceBuffer;
+ readonly sourceBuffer: SourceBuffer | null;
}
declare var VideoTrack: {
@@ -15317,6 +15726,7 @@
"removetrack": TrackEvent;
}
+/** The VideoTrackList interface is used to represent a list of the video tracks contained within a <video> element, with each track represented by a separate VideoTrack object in the list. */
interface VideoTrackList extends EventTarget {
readonly length: number;
onaddtrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;
@@ -15375,6 +15785,7 @@
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;
}
+/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
interface WEBGL_compressed_texture_s3tc {
readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;
readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;
@@ -15389,6 +15800,7 @@
readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;
}
+/** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */
interface WEBGL_debug_renderer_info {
readonly UNMASKED_RENDERER_WEBGL: GLenum;
readonly UNMASKED_VENDOR_WEBGL: GLenum;
@@ -15398,6 +15810,7 @@
getTranslatedShaderSource(shader: WebGLShader): string;
}
+/** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */
interface WEBGL_depth_texture {
readonly UNSIGNED_INT_24_8_WEBGL: GLenum;
}
@@ -15445,6 +15858,7 @@
restoreContext(): void;
}
+/** A WaveShaperNode always has exactly one input and one output. */
interface WaveShaperNode extends AudioNode {
curve: Float32Array | null;
oversample: OverSampleType;
@@ -15477,6 +15891,7 @@
new(): WebAuthnAssertion;
};
+/** The WebGLActiveInfo interface is part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */
interface WebGLActiveInfo {
readonly name: string;
readonly size: GLint;
@@ -15488,6 +15903,7 @@
new(): WebGLActiveInfo;
};
+/** The WebGLBuffer interface is part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
interface WebGLBuffer extends WebGLObject {
}
@@ -15496,6 +15912,7 @@
new(): WebGLBuffer;
};
+/** The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. */
interface WebGLContextEvent extends Event {
readonly statusMessage: string;
}
@@ -15505,6 +15922,7 @@
new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;
};
+/** The WebGLFramebuffer interface is part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
interface WebGLFramebuffer extends WebGLObject {
}
@@ -15521,6 +15939,7 @@
new(): WebGLObject;
};
+/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
interface WebGLProgram extends WebGLObject {
}
@@ -15529,6 +15948,7 @@
new(): WebGLProgram;
};
+/** The WebGLRenderbuffer interface is part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
interface WebGLRenderbuffer extends WebGLObject {
}
@@ -15537,6 +15957,7 @@
new(): WebGLRenderbuffer;
};
+/** The WebGLRenderingContext interface provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */
interface WebGLRenderingContext extends WebGLRenderingContextBase {
}
@@ -15956,7 +16377,7 @@
isTexture(texture: WebGLTexture | null): GLboolean;
lineWidth(width: GLfloat): void;
linkProgram(program: WebGLProgram): void;
- pixelStorei(pname: GLenum, param: GLint): void;
+ pixelStorei(pname: GLenum, param: GLint | GLboolean): void;
polygonOffset(factor: GLfloat, units: GLfloat): void;
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
@@ -16304,6 +16725,7 @@
readonly ZERO: GLenum;
}
+/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
interface WebGLShader extends WebGLObject {
}
@@ -16312,6 +16734,7 @@
new(): WebGLShader;
};
+/** The WebGLShaderPrecisionFormat interface is part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */
interface WebGLShaderPrecisionFormat {
readonly precision: GLint;
readonly rangeMax: GLint;
@@ -16323,6 +16746,7 @@
new(): WebGLShaderPrecisionFormat;
};
+/** The WebGLTexture interface is part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
interface WebGLTexture extends WebGLObject {
}
@@ -16331,6 +16755,7 @@
new(): WebGLTexture;
};
+/** The WebGLUniformLocation interface is part of the WebGL API and represents the location of a uniform variable in a shader program. */
interface WebGLUniformLocation {
}
@@ -16359,6 +16784,7 @@
"open": Event;
}
+/** The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */
interface WebSocket extends EventTarget {
binaryType: BinaryType;
readonly bufferedAmount: number;
@@ -16391,6 +16817,7 @@
readonly OPEN: number;
};
+/** The WheelEvent interface represents events that occur due to the user moving a mouse wheel or similar input device. */
interface WheelEvent extends MouseEvent {
readonly deltaMode: number;
readonly deltaX: number;
@@ -16487,10 +16914,10 @@
"readystatechange": ProgressEvent;
"reset": Event;
"resize": UIEvent;
- "scroll": UIEvent;
+ "scroll": Event;
"seeked": Event;
"seeking": Event;
- "select": UIEvent;
+ "select": Event;
"stalled": Event;
"storage": StorageEvent;
"submit": Event;
@@ -16510,6 +16937,7 @@
"waiting": Event;
}
+/** The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window. */
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch, WindowOrWorkerGlobalScope, WindowEventHandlers {
Blob: typeof Blob;
URL: typeof URL;
@@ -16524,6 +16952,7 @@
readonly devicePixelRatio: number;
readonly doNotTrack: string;
readonly document: Document;
+ /** @deprecated */
readonly event: Event | undefined;
/** @deprecated */
readonly external: External;
@@ -16610,7 +17039,7 @@
focus(): void;
getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;
getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;
- getSelection(): Selection;
+ getSelection(): Selection | null;
matchMedia(query: string): MediaQueryList;
moveBy(x: number, y: number): void;
moveTo(x: number, y: number): void;
@@ -16730,6 +17159,7 @@
"message": MessageEvent;
}
+/** The Worker interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */
interface Worker extends EventTarget, AbstractWorker {
onmessage: ((this: Worker, ev: MessageEvent) => any) | null;
postMessage(message: any, transfer?: Transferable[]): void;
@@ -16742,7 +17172,7 @@
declare var Worker: {
prototype: Worker;
- new(stringUrl: string, options?: WorkerOptions): Worker;
+ new(stringUrl: string | URL, options?: WorkerOptions): Worker;
};
interface Worklet {
@@ -16754,6 +17184,7 @@
new(): Worklet;
};
+/** The WritableStream interface of the the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
interface WritableStream<W = any> {
readonly locked: boolean;
abort(reason?: any): Promise<void>;
@@ -16765,10 +17196,12 @@
new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
};
+/** The WritableStreamDefaultController interface of the the Streams API represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
interface WritableStreamDefaultController {
error(error?: any): void;
}
+/** The WritableStreamDefaultWriter interface of the the Streams API is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */
interface WritableStreamDefaultWriter<W = any> {
readonly closed: Promise<void>;
readonly desiredSize: number | null;
@@ -16779,6 +17212,7 @@
write(chunk: W): Promise<void>;
}
+/** The XMLDocument interface represent an XML document. It inherits from the generic Document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. */
interface XMLDocument extends Document {
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -16795,6 +17229,7 @@
"readystatechange": Event;
}
+/** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */
interface XMLHttpRequest extends XMLHttpRequestEventTarget {
onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
/**
@@ -16874,7 +17309,8 @@
*/
overrideMimeType(mime: string): void;
/**
- * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.
+ * Initiates the request. The body argument provides the request body, if any,
+ * and is ignored if the request method is GET or HEAD.
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
*/
send(body?: Document | BodyInit | null): void;
@@ -16947,6 +17383,7 @@
new(): XMLHttpRequestUpload;
};
+/** The XMLSerializer interface provides the serializeToString() method to construct an XML string representing a DOM tree. */
interface XMLSerializer {
serializeToString(root: Node): string;
}
@@ -16967,6 +17404,7 @@
new(): XPathEvaluator;
};
+/** An XPathExpression is a compiled XPath query returned from document.createExpression(). It has a method evaluate() which can be used to execute the compiled XPath. */
interface XPathExpression {
evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;
}
@@ -16985,6 +17423,7 @@
new(): XPathNSResolver;
};
+/** The XPathResult interface represents the results generated by evaluating an XPath 1.0 expression within the context of a given node. */
interface XPathResult {
readonly booleanValue: boolean;
readonly invalidIteratorState: boolean;
@@ -17022,6 +17461,7 @@
readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;
};
+/** An XSLTProcessor applies an XSLT stylesheet transformation to an XML document to produce a new XML document as output. It has methods to load the XSLT stylesheet, to manipulate <xsl:param> parameter values, and to apply the transformation to documents. */
interface XSLTProcessor {
clearParameters(): void;
getParameter(namespaceURI: string, localName: string): any;
@@ -17064,10 +17504,6 @@
(decodedData: AudioBuffer): void;
}
-interface ErrorEventHandler {
- (event: Event | string, source?: string, fileno?: number, columnNumber?: number, error?: Error): void;
-}
-
interface EventHandlerNonNull {
(event: Event): any;
}
@@ -17113,7 +17549,7 @@
}
interface OnErrorEventHandlerNonNull {
- (event: Event | string, source?: string, lineno?: number, colno?: number, error?: any): any;
+ (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any;
}
interface PerformanceObserverCallback {
@@ -17196,6 +17632,7 @@
"b": HTMLElement;
"base": HTMLBaseElement;
"basefont": HTMLBaseFontElement;
+ "bdi": HTMLElement;
"bdo": HTMLElement;
"blockquote": HTMLQuoteElement;
"body": HTMLBodyElement;
@@ -17249,6 +17686,7 @@
"legend": HTMLLegendElement;
"li": HTMLLIElement;
"link": HTMLLinkElement;
+ "main": HTMLElement;
"map": HTMLMapElement;
"mark": HTMLElement;
"marquee": HTMLMarqueeElement;
@@ -17268,6 +17706,7 @@
"pre": HTMLPreElement;
"progress": HTMLProgressElement;
"q": HTMLQuoteElement;
+ "rp": HTMLElement;
"rt": HTMLElement;
"ruby": HTMLElement;
"s": HTMLElement;
@@ -17282,6 +17721,7 @@
"strong": HTMLElement;
"style": HTMLStyleElement;
"sub": HTMLElement;
+ "summary": HTMLElement;
"sup": HTMLElement;
"table": HTMLTableElement;
"tbody": HTMLTableSectionElement;
@@ -17388,6 +17828,7 @@
declare var devicePixelRatio: number;
declare var doNotTrack: string;
declare var document: Document;
+/** @deprecated */
declare var event: Event | undefined;
/** @deprecated */
declare var external: External;
@@ -17474,7 +17915,7 @@
declare function focus(): void;
declare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;
declare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;
-declare function getSelection(): Selection;
+declare function getSelection(): Selection | null;
declare function matchMedia(query: string): MediaQueryList;
declare function moveBy(x: number, y: number): void;
declare function moveTo(x: number, y: number): void;
@@ -17603,7 +18044,7 @@
* Fires when an error occurs during object loading.
* @param ev The event.
*/
-declare var onerror: ErrorEventHandler;
+declare var onerror: OnErrorEventHandler;
/**
* Fires when the object receives focus.
* @param ev The event.
@@ -17719,7 +18160,7 @@
* Fires when the user repositions the scroll box in the scroll bar on the object.
* @param ev The event.
*/
-declare var onscroll: ((this: Window, ev: UIEvent) => any) | null;
+declare var onscroll: ((this: Window, ev: Event) => any) | null;
declare var onsecuritypolicyviolation: ((this: Window, ev: SecurityPolicyViolationEvent) => any) | null;
/**
* Occurs when the seek operation ends.
@@ -17735,7 +18176,9 @@
* Fires when the current selection changes.
* @param ev The event.
*/
-declare var onselect: ((this: Window, ev: UIEvent) => any) | null;
+declare var onselect: ((this: Window, ev: Event) => any) | null;
+declare var onselectionchange: ((this: Window, ev: Event) => any) | null;
+declare var onselectstart: ((this: Window, ev: Event) => any) | null;
/**
* Occurs when the download has stopped.
* @param ev The event.
@@ -17892,6 +18335,7 @@
type EndOfStreamError = "network" | "decode";
type EndingType = "transparent" | "native";
type FillMode = "none" | "forwards" | "backwards" | "both" | "auto";
+type FullscreenNavigationUI = "auto" | "show" | "hide";
type GamepadHand = "" | "left" | "right";
type GamepadHapticActuatorType = "vibration";
type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad";
@@ -17912,8 +18356,8 @@
type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications";
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request";
-type MediaKeySessionType = "temporary" | "persistent-license" | "persistent-release-message";
-type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error";
+type MediaKeySessionType = "temporary" | "persistent-license";
+type MediaKeyStatus = "usable" | "expired" | "released" | "output-restricted" | "output-downscaled" | "status-pending" | "internal-error";
type MediaKeysRequirement = "required" | "optional" | "not-allowed";
type MediaStreamTrackState = "live" | "ended";
type NavigationReason = "up" | "down" | "left" | "right";
@@ -17961,7 +18405,7 @@
type RTCStatsIceCandidateType = "host" | "serverreflexive" | "peerreflexive" | "relayed";
type RTCStatsType = "inboundrtp" | "outboundrtp" | "session" | "datachannel" | "track" | "transport" | "candidatepair" | "localcandidate" | "remotecandidate";
type ReadyState = "closed" | "open" | "ended";
-type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
+type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";

lib/lib.dom.iterable.d.ts

@@ -116,6 +116,13 @@
values(): IterableIterator<string>;
}
+interface MediaKeyStatusMap {
+ [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
+ entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
+ keys(): IterableIterator<BufferSource>;
+ values(): IterableIterator<MediaKeyStatus>;
+}
+
interface MediaList {
[Symbol.iterator](): IterableIterator<string>;
}

lib/lib.es2015.collection.d.ts

@@ -30,7 +30,7 @@
interface MapConstructor {
new(): Map<any, any>;
- new<K, V>(entries?: ReadonlyArray<[K, V]> | null): Map<K, V>;
+ new<K, V>(entries?: ReadonlyArray<readonly [K, V]> | null): Map<K, V>;
readonly prototype: Map<any, any>;
}
declare var Map: MapConstructor;

lib/lib.es2015.iterable.d.ts

@@ -149,7 +149,7 @@
}
interface MapConstructor {
- new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
+ new <K, V>(iterable: Iterable<readonly [K, V]>): Map<K, V>;
}
interface WeakMap<K extends object, V> { }

lib/lib.es2017.sharedmemory.d.ts

@@ -123,7 +123,7 @@
* Wakes up sleeping agents that are waiting on the given index of the array, returning the
* number of agents that were awoken.
*/
- wake(typedArray: Int32Array, index: number, count: number): number;
+ notify(typedArray: Int32Array, index: number, count: number): number;
/**
* Stores the bitwise XOR of a value with the value at the given position in the array,

lib/lib.es2018.asynciterable.d.ts

@@ -0,0 +1,44 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+/// <reference lib="es2015.symbol" />
+/// <reference lib="es2015.iterable" />
+
+interface SymbolConstructor {
+ /**
+ * A method that returns the default async iterator for an object. Called by the semantics of
+ * the for-await-of statement.
+ */
+ readonly asyncIterator: symbol;
+}
+
+interface AsyncIterator<T> {
+ next(value?: any): Promise<IteratorResult<T>>;
+ return?(value?: any): Promise<IteratorResult<T>>;
+ throw?(e?: any): Promise<IteratorResult<T>>;
+}
+
+interface AsyncIterable<T> {
+ [Symbol.asyncIterator](): AsyncIterator<T>;
+}
+
+interface AsyncIterableIterator<T> extends AsyncIterator<T> {
+ [Symbol.asyncIterator](): AsyncIterableIterator<T>;
+}
\ No newline at end of file

lib/lib.es2018.d.ts

@@ -19,6 +19,7 @@
/// <reference lib="es2017" />
+/// <reference lib="es2018.asynciterable" />
/// <reference lib="es2018.promise" />
/// <reference lib="es2018.regexp" />
/// <reference lib="es2018.intl" />

lib/lib.es2019.array.d.ts

@@ -0,0 +1,223 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+interface ReadonlyArray<T> {
+
+ /**
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
+ * a new array.
+ * This is identical to a map followed by flat with depth 1.
+ *
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
+ * callback function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
+ * thisArg is omitted, undefined is used as the this value.
+ */
+ flatMap<U, This = undefined> (
+ callback: (this: This, value: T, index: number, array: T[]) => U|ReadonlyArray<U>,
+ thisArg?: This
+ ): U[]
+
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this:
+ ReadonlyArray<U[][][][]> |
+
+ ReadonlyArray<ReadonlyArray<U[][][]>> |
+ ReadonlyArray<ReadonlyArray<U[][]>[]> |
+ ReadonlyArray<ReadonlyArray<U[]>[][]> |
+ ReadonlyArray<ReadonlyArray<U>[][][]> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U[][]>>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[][]>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[][]> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>[]> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>[]> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>[]>> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>[]> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>>,
+ depth: 4): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this:
+ ReadonlyArray<U[][][]> |
+
+ ReadonlyArray<ReadonlyArray<U>[][]> |
+ ReadonlyArray<ReadonlyArray<U[]>[]> |
+ ReadonlyArray<ReadonlyArray<U[][]>> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>> |
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>,
+ depth: 3): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this:
+ ReadonlyArray<U[][]> |
+
+ ReadonlyArray<ReadonlyArray<U[]>> |
+ ReadonlyArray<ReadonlyArray<U>[]> |
+
+ ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>,
+ depth: 2): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this:
+ ReadonlyArray<U[]> |
+ ReadonlyArray<ReadonlyArray<U>>,
+ depth?: 1
+ ): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this:
+ ReadonlyArray<U>,
+ depth: 0
+ ): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth. If no depth is provided, flat method defaults to the depth of 1.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(depth?: number): any[];
+ }
+
+interface Array<T> {
+
+ /**
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
+ * a new array.
+ * This is identical to a map followed by flat with depth 1.
+ *
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
+ * callback function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
+ * thisArg is omitted, undefined is used as the this value.
+ */
+ flatMap<U, This = undefined> (
+ callback: (this: This, value: T, index: number, array: T[]) => U|ReadonlyArray<U>,
+ thisArg?: This
+ ): U[]
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][][][][][][], depth: 7): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][][][][][], depth: 6): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][][][][], depth: 5): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][][][], depth: 4): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][][], depth: 3): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][][], depth: 2): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[][], depth?: 1): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(this: U[], depth: 0): U[];
+
+ /**
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
+ * specified depth. If no depth is provided, flat method defaults to the depth of 1.
+ *
+ * @param depth The maximum recursion depth
+ */
+ flat<U>(depth?: number): any[];
+}

lib/lib.es2019.d.ts

@@ -0,0 +1,24 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+/// <reference lib="es2018" />
+/// <reference lib="es2019.array" />
+/// <reference lib="es2019.string" />
+/// <reference lib="es2019.symbol" />

lib/lib.es2019.full.d.ts

@@ -0,0 +1,25 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+/// <reference lib="es2019" />
+/// <reference lib="dom" />
+/// <reference lib="webworker.importscripts" />
+/// <reference lib="scripthost" />
+/// <reference lib="dom.iterable" />

lib/lib.es2019.string.d.ts

@@ -0,0 +1,33 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+interface String {
+ /** Removes the trailing white space and line terminator characters from a string. */
+ trimEnd(): string;
+
+ /** Removes the leading white space and line terminator characters from a string. */
+ trimStart(): string;
+
+ /** Removes the trailing white space and line terminator characters from a string. */
+ trimLeft(): string;
+
+ /** Removes the leading white space and line terminator characters from a string. */
+ trimRight(): string;
+}

lib/lib.es2019.symbol.d.ts

@@ -0,0 +1,26 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+
+/// <reference no-default-lib="true"/>
+
+
+interface Symbol {
+ /**
+ * expose the [[Description]] internal slot of a symbol directly
+ */
+ readonly description: string;
+}

lib/lib.es5.d.ts

@@ -22,8 +22,8 @@
/// ECMAScript APIs
/////////////////////////////
-declare const NaN: number;
-declare const Infinity: number;
+declare var NaN: number;
+declare var Infinity: number;
/**
* Evaluates JavaScript code and executes it.
@@ -264,7 +264,7 @@
/**
* Provides functionality common to all JavaScript objects.
*/
-declare const Object: ObjectConstructor;
+declare var Object: ObjectConstructor;
/**
* Creates a new function.
@@ -313,7 +313,7 @@
readonly prototype: Function;
}
-declare const Function: FunctionConstructor;
+declare var Function: FunctionConstructor;
/**
* Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
@@ -524,7 +524,7 @@
/**
* Allows manipulation and formatting of text strings and determination and location of substrings within strings.
*/
-declare const String: StringConstructor;
+declare var String: StringConstructor;
interface Boolean {
/** Returns the primitive value of the specified object. */
@@ -537,7 +537,7 @@
readonly prototype: Boolean;
}
-declare const Boolean: BooleanConstructor;
+declare var Boolean: BooleanConstructor;
interface Number {
/**
@@ -599,7 +599,7 @@
}
/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
-declare const Number: NumberConstructor;
+declare var Number: NumberConstructor;
interface TemplateStringsArray extends ReadonlyArray<string> {
readonly raw: ReadonlyArray<string>;
@@ -723,7 +723,7 @@
tan(x: number): number;
}
/** An intrinsic object that provides basic mathematics functionality and constants. */
-declare const Math: Math;
+declare var Math: Math;
/** Enables basic storage and retrieval of dates and times. */
interface Date {
@@ -904,7 +904,7 @@
now(): number;
}
-declare const Date: DateConstructor;
+declare var Date: DateConstructor;
interface RegExpMatchArray extends Array<string> {
index?: number;
@@ -967,7 +967,7 @@
lastMatch: string;
}
-declare const RegExp: RegExpConstructor;
+declare var RegExp: RegExpConstructor;
interface Error {
name: string;
@@ -981,7 +981,7 @@
readonly prototype: Error;
}
-declare const Error: ErrorConstructor;
+declare var Error: ErrorConstructor;
interface EvalError extends Error {
}
@@ -992,7 +992,7 @@
readonly prototype: EvalError;
}
-declare const EvalError: EvalErrorConstructor;
+declare var EvalError: EvalErrorConstructor;
interface RangeError extends Error {
}
@@ -1003,7 +1003,7 @@
readonly prototype: RangeError;
}
-declare const RangeError: RangeErrorConstructor;
+declare var RangeError: RangeErrorConstructor;
interface ReferenceError extends Error {
}
@@ -1014,7 +1014,7 @@
readonly prototype: ReferenceError;
}
-declare const ReferenceError: ReferenceErrorConstructor;
+declare var ReferenceError: ReferenceErrorConstructor;
interface SyntaxError extends Error {
}
@@ -1025,7 +1025,7 @@
readonly prototype: SyntaxError;
}
-declare const SyntaxError: SyntaxErrorConstructor;
+declare var SyntaxError: SyntaxErrorConstructor;
interface TypeError extends Error {
}
@@ -1036,7 +1036,7 @@
readonly prototype: TypeError;
}
-declare const TypeError: TypeErrorConstructor;
+declare var TypeError: TypeErrorConstructor;
interface URIError extends Error {
}
@@ -1047,7 +1047,7 @@
readonly prototype: URIError;
}
-declare const URIError: URIErrorConstructor;
+declare var URIError: URIErrorConstructor;
interface JSON {
/**
@@ -1056,14 +1056,14 @@
* @param reviver A function that transforms the results. This function is called for each member of the object.
* If a member contains nested objects, the nested objects are transformed before the parent object is.
*/
- parse(text: string, reviver?: (key: any, value: any) => any): any;
+ parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
/**
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
* @param value A JavaScript value, usually an object or array, to be converted.
* @param replacer A function that transforms the results.
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
*/
- stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
+ stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
/**
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
* @param value A JavaScript value, usually an object or array, to be converted.
@@ -1076,7 +1076,7 @@
/**
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
*/
-declare const JSON: JSON;
+declare var JSON: JSON;
/////////////////////////////
@@ -1134,13 +1134,13 @@
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
- every(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg?: any): boolean;
+ every(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): boolean;
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
- some(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg?: any): boolean;
+ some(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): boolean;
/**
* Performs the specified action for each element in an array.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
@@ -1164,7 +1164,7 @@
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
- filter(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => any, thisArg?: any): T[];
+ filter(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => unknown, thisArg?: any): T[];
/**
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
@@ -1365,7 +1365,7 @@
readonly prototype: Array<any>;
}
-declare const Array: ArrayConstructor;
+declare var Array: ArrayConstructor;
interface TypedPropertyDescriptor<T> {
enumerable?: boolean;
@@ -1471,22 +1471,22 @@
/**
* Obtain the parameters of a function type in a tuple
*/
-type Parameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;
+type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
/**
* Obtain the parameters of a constructor function type in a tuple
*/
-type ConstructorParameters<T extends new (...args: any[]) => any> = T extends new (...args: infer P) => any ? P : never;
+type ConstructorParameters<T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never;
/**
* Obtain the return type of a function type
*/
-type ReturnType<T extends (...args: any[]) => any> = T extends (...args: any[]) => infer R ? R : any;
+type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
/**
* Obtain the return type of a constructor function type
*/
-type InstanceType<T extends new (...args: any[]) => any> = T extends new (...args: any[]) => infer R ? R : any;
+type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
/**
* Marker for contextual 'this' type
@@ -1524,7 +1524,7 @@
new(byteLength: number): ArrayBuffer;
isView(arg: any): arg is ArrayBufferView;
}
-declare const ArrayBuffer: ArrayBufferConstructor;
+declare var ArrayBuffer: ArrayBufferConstructor;
interface ArrayBufferView {
/**
@@ -1674,7 +1674,7 @@
interface DataViewConstructor {
new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
}
-declare const DataView: DataViewConstructor;
+declare var DataView: DataViewConstructor;
/**
* A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
@@ -1949,7 +1949,7 @@
}
-declare const Int8Array: Int8ArrayConstructor;
+declare var Int8Array: Int8ArrayConstructor;
/**
* A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
@@ -2224,7 +2224,7 @@
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
}
-declare const Uint8Array: Uint8ArrayConstructor;
+declare var Uint8Array: Uint8ArrayConstructor;
/**
* A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
@@ -2498,7 +2498,7 @@
*/
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
}
-declare const Uint8ClampedArray: Uint8ClampedArrayConstructor;
+declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
/**
* A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
@@ -2773,7 +2773,7 @@
}
-declare const Int16Array: Int16ArrayConstructor;
+declare var Int16Array: Int16ArrayConstructor;
/**
* A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
@@ -3049,7 +3049,7 @@
}
-declare const Uint16Array: Uint16ArrayConstructor;
+declare var Uint16Array: Uint16ArrayConstructor;
/**
* A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
* requested number of bytes could not be allocated an exception is raised.
@@ -3323,7 +3323,7 @@
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
}
-declare const Int32Array: Int32ArrayConstructor;
+declare var Int32Array: Int32ArrayConstructor;
/**
* A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
@@ -3597,7 +3597,7 @@
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
}
-declare const Uint32Array: Uint32ArrayConstructor;
+declare var Uint32Array: Uint32ArrayConstructor;
/**
* A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
@@ -3873,7 +3873,7 @@
}
-declare const Float32Array: Float32ArrayConstructor;
+declare var Float32Array: Float32ArrayConstructor;
/**
* A typed array of 64-bit float values. The contents are initialized to 0. If the requested
@@ -4148,7 +4148,7 @@
from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
}
-declare const Float64Array: Float64ArrayConstructor;
+declare var Float64Array: Float64ArrayConstructor;
/////////////////////////////
/// ECMAScript Internationalization API

lib/lib.esnext.bigint.d.ts

@@ -54,7 +54,7 @@
asUintN(bits: number, int: bigint): bigint;
}
-declare const BigInt: BigIntConstructor;
+declare var BigInt: BigIntConstructor;
/**
* A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
@@ -323,7 +323,7 @@
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array;
}
-declare const BigInt64Array: BigInt64ArrayConstructor;
+declare var BigInt64Array: BigInt64ArrayConstructor;
/**
* A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
@@ -592,7 +592,7 @@
from<U>(arrayLike: ArrayLike<U>, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array;
}
-declare const BigUint64Array: BigUint64ArrayConstructor;
+declare var BigUint64Array: BigUint64ArrayConstructor;
interface DataView {
/**

lib/lib.esnext.d.ts

@@ -18,9 +18,6 @@
/// <reference no-default-lib="true"/>
-/// <reference lib="es2018" />
-/// <reference lib="esnext.asynciterable" />
-/// <reference lib="esnext.array" />
+/// <reference lib="es2019" />
/// <reference lib="esnext.bigint" />
-/// <reference lib="esnext.symbol" />
/// <reference lib="esnext.intl" />

lib/lib.webworker.d.ts

@@ -174,6 +174,10 @@
capture?: boolean;
}
+interface EventSourceInit {
+ withCredentials?: boolean;
+}
+
interface ExtendableEventInit extends EventInit {
}
@@ -475,6 +479,7 @@
(evt: Event): void;
}
+/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */
interface ANGLE_instanced_arrays {
drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;
drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;
@@ -482,6 +487,7 @@
readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;
}
+/** The AbortController interface represents a controller object that allows you to abort one or more DOM requests as and when desired. */
interface AbortController {
/**
* Returns the AbortSignal object associated with this object.
@@ -500,16 +506,17 @@
};
interface AbortSignalEventMap {
- "abort": ProgressEvent;
+ "abort": Event;
}
+/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
interface AbortSignal extends EventTarget {
/**
* Returns true if this AbortSignal's AbortController has signaled to abort, and false
* otherwise.
*/
readonly aborted: boolean;
- onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null;
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -541,6 +548,7 @@
length: number;
}
+/** A Blob object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */
interface Blob {
readonly size: number;
readonly type: string;
@@ -598,6 +606,7 @@
messageerror: MessageEvent;
}
+/** The ByteLengthQueuingStrategy interface of the the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. */
interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
highWaterMark: number;
size(chunk: ArrayBufferView): number;
@@ -608,6 +617,7 @@
new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
};
+/** The Cache interface provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
interface Cache {
add(request: RequestInfo): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
@@ -623,6 +633,7 @@
new(): Cache;
};
+/** The CacheStorage interface represents the storage for Cache objects. */
interface CacheStorage {
delete(cacheName: string): Promise<boolean>;
has(cacheName: string): Promise<boolean>;
@@ -636,6 +647,7 @@
new(): CacheStorage;
};
+/** The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
interface CanvasGradient {
/**
* Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset
@@ -664,6 +676,7 @@
rect(x: number, y: number, w: number, h: number): void;
}
+/** The CanvasPattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
interface CanvasPattern {
/**
* Sets the transformation matrix that will be used when rendering the pattern during a fill or
@@ -677,6 +690,7 @@
new(): CanvasPattern;
};
+/** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */
interface Client {
readonly id: string;
readonly type: ClientTypes;
@@ -689,6 +703,7 @@
new(): Client;
};
+/** The Clients interface provides access to Client objects. Access it via self.clients within a service worker. */
interface Clients {
claim(): Promise<void>;
get(id: string): Promise<any>;
@@ -701,6 +716,7 @@
new(): Clients;
};
+/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
interface CloseEvent extends Event {
readonly code: number;
readonly reason: string;
@@ -723,6 +739,7 @@
publicInfo?: Uint8Array;
}
+/** The Console object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. */
interface Console {
memory: any;
assert(condition?: boolean, message?: string, ...data: any[]): void;
@@ -756,6 +773,7 @@
new(): Console;
};
+/** The CountQueuingStrategy interface of the the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. */
interface CountQueuingStrategy extends QueuingStrategy {
highWaterMark: number;
size(chunk: any): 1;
@@ -766,6 +784,7 @@
new(options: { highWaterMark: number }): CountQueuingStrategy;
};
+/** The Crypto interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
interface Crypto {
readonly subtle: SubtleCrypto;
getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T;
@@ -776,6 +795,7 @@
new(): Crypto;
};
+/** The CryptoKey interface represents a cryptographic key derived from a specific key algorithm. */
interface CryptoKey {
readonly algorithm: KeyAlgorithm;
readonly extractable: boolean;
@@ -802,6 +822,7 @@
new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
};
+/** The DOMException interface represents an abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */
interface DOMException {
readonly code: number;
readonly message: string;
@@ -941,6 +962,8 @@
rotateFromVector(x?: number, y?: number): DOMMatrix;
scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
+ /** @deprecated */
+ scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
skewX(sx?: number): DOMMatrix;
skewY(sy?: number): DOMMatrix;
toFloat32Array(): Float32Array;
@@ -1033,6 +1056,7 @@
fromRect(other?: DOMRectInit): DOMRectReadOnly;
};
+/** A type returned by some APIs which contains a list of DOMString (strings). */
interface DOMStringList {
/**
* Returns the number of strings in strings.
@@ -1059,6 +1083,7 @@
"message": MessageEvent;
}
+/** The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. */
interface DedicatedWorkerGlobalScope extends WorkerGlobalScope {
onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
close(): void;
@@ -1098,6 +1123,7 @@
readonly MIN_EXT: GLenum;
}
+/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */
interface EXT_frag_depth {
}
@@ -1111,11 +1137,13 @@
interface EXT_shader_texture_lod {
}
+/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */
interface EXT_texture_filter_anisotropic {
readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;
}
+/** The ErrorEvent interface represents events providing information related to errors in scripts or in files. */
interface ErrorEvent extends Event {
readonly colno: number;
readonly error: any;
@@ -1129,6 +1157,7 @@
new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
};
+/** The Event interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). While events are usually triggered by such "external" sources, they can also be triggered programmatically, such as by calling the HTMLElement.click() method of an element, or by defining the event, then sending it to a specified target using EventTarget.dispatchEvent(). There are many types of events, some of which use other interfaces based on the main Event interface. Event itself contains the properties and methods which are common to all events. */
interface Event {
/**
* Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
@@ -1153,6 +1182,8 @@
*/
readonly isTrusted: boolean;
returnValue: boolean;
+ /** @deprecated */
+ readonly srcElement: EventTarget | null;
/**
* Returns the object to which event is dispatched (its target).
*/
@@ -1200,28 +1231,50 @@
handleEvent(evt: Event): void;
}
+interface EventSourceEventMap {
+ "error": Event;
+ "message": MessageEvent;
+ "open": Event;
+}
+
interface EventSource extends EventTarget {
- readonly CLOSED: number;
- readonly CONNECTING: number;
- readonly OPEN: number;
- onerror: (evt: MessageEvent) => any;
- onmessage: (evt: MessageEvent) => any;
- onopen: (evt: MessageEvent) => any;
+ onerror: ((this: EventSource, ev: Event) => any) | null;
+ onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
+ onopen: ((this: EventSource, ev: Event) => any) | null;
+ /**
+ * Returns the state of this EventSource object's connection. It can have the
+ * values described below.
+ */
readonly readyState: number;
+ /**
+ * Returns the URL providing the event stream.
+ */
readonly url: string;
+ /**
+ * Returns true if the credentials mode
+ * for connection requests to the URL providing the
+ * event stream is set to "include", and false otherwise.
+ */
readonly withCredentials: boolean;
close(): void;
+ readonly CLOSED: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
+ addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
+ removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var EventSource: {
prototype: EventSource;
new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;
+ readonly CLOSED: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
};
-interface EventSourceInit {
- readonly withCredentials: boolean;
-}
-
+/** EventTarget is an interface implemented by objects that can receive events and may have listeners for them. */
interface EventTarget {
/**
* Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
@@ -1250,8 +1303,9 @@
new(): EventTarget;
};
+/** The ExtendableEvent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
interface ExtendableEvent extends Event {
- waitUntil(f: Promise<any>): void;
+ waitUntil(f: any): void;
}
declare var ExtendableEvent: {
@@ -1259,6 +1313,7 @@
new(type: string, eventInitDict?: ExtendableEventInit): ExtendableEvent;
};
+/** The ExtendableMessageEvent interface of the ServiceWorker API represents the event object of a message event fired on a service worker (when a channel message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events. */
interface ExtendableMessageEvent extends ExtendableEvent {
readonly data: any;
readonly lastEventId: string;
@@ -1272,13 +1327,14 @@
new(type: string, eventInitDict?: ExtendableMessageEventInit): ExtendableMessageEvent;
};
+/** This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch. */
interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly preloadResponse: Promise<any>;
readonly request: Request;
readonly resultingClientId: string;
readonly targetClientId: string;
- respondWith(r: Promise<Response>): void;
+ respondWith(r: Response | Promise<Response>): void;
}
declare var FetchEvent: {
@@ -1286,6 +1342,7 @@
new(type: string, eventInitDict: FetchEventInit): FetchEvent;
};
+/** The File interface provides information about files and allows JavaScript in a web page to access their content. */
interface File extends Blob {
readonly lastModified: number;
readonly name: string;
@@ -1296,6 +1353,7 @@
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
};
+/** An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type="file"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */
interface FileList {
readonly length: number;
item(index: number): File | null;
@@ -1316,6 +1374,7 @@
"progress": ProgressEvent;
}
+/** The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */
interface FileReader extends EventTarget {
readonly error: DOMException | null;
onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;
@@ -1348,6 +1407,7 @@
readonly LOADING: number;
};
+/** The FileReaderSync interface allows to read File or Blob objects in a synchronous way. */
interface FileReaderSync {
readAsArrayBuffer(blob: Blob): ArrayBuffer;
readAsBinaryString(blob: Blob): string;
@@ -1360,6 +1420,7 @@
new(): FileReaderSync;
};
+/** The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */
interface FormData {
append(name: string, value: string | Blob, fileName?: string): void;
delete(name: string): void;
@@ -1379,6 +1440,7 @@
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
}
+/** The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.  You can add to this using methods like append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte sequence. */
interface Headers {
append(name: string, value: string): void;
delete(name: string): void;
@@ -1402,6 +1464,7 @@
interface IDBArrayKey extends Array<IDBValidKey> {
}
+/** The IDBCursor interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database. */
interface IDBCursor {
/**
* Returns the direction ("next", "nextunique", "prev" or "prevunique")
@@ -1412,12 +1475,12 @@
* Returns the key of the cursor.
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
*/
- readonly key: IDBValidKey | IDBKeyRange;
+ readonly key: IDBValidKey;
/**
* Returns the effective key of the cursor.
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
*/
- readonly primaryKey: IDBValidKey | IDBKeyRange;
+ readonly primaryKey: IDBValidKey;
/**
* Returns the IDBObjectStore or IDBIndex the cursor was opened from.
*/
@@ -1431,12 +1494,12 @@
* Advances the cursor to the next record in range matching or
* after key.
*/
- continue(key?: IDBValidKey | IDBKeyRange): void;
+ continue(key?: IDBValidKey): void;
/**
* Advances the cursor to the next record in range matching
* or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
*/
- continuePrimaryKey(key: IDBValidKey | IDBKeyRange, primaryKey: IDBValidKey | IDBKeyRange): void;
+ continuePrimaryKey(key: IDBValidKey, primaryKey: IDBValidKey): void;
/**
* Delete the record pointed at by the cursor with a new value.
* If successful, request's result will be undefined.
@@ -1455,6 +1518,7 @@
new(): IDBCursor;
};
+/** The IDBCursorWithValue interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */
interface IDBCursorWithValue extends IDBCursor {
/**
* Returns the cursor's current value.
@@ -1474,6 +1538,7 @@
"versionchange": IDBVersionChangeEvent;
}
+/** The IDBDatabase interface of the IndexedDB API provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */
interface IDBDatabase extends EventTarget {
/**
* Returns the name of the database.
@@ -1521,6 +1586,7 @@
new(): IDBDatabase;
};
+/** In the following code snippet, we make a request to open a database, and include handlers for the success and error cases. For a full working example, see our To-do Notifications app (view example live.) */
interface IDBFactory {
/**
* Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if
@@ -1550,6 +1616,7 @@
new(): IDBFactory;
};
+/** IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data. */
interface IDBIndex {
readonly keyPath: string | string[];
readonly multiEntry: boolean;
@@ -1610,6 +1677,7 @@
new(): IDBIndex;
};
+/** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */
interface IDBKeyRange {
/**
* Returns lower bound, or undefined if none.
@@ -1658,6 +1726,7 @@
upperBound(upper: any, open?: boolean): IDBKeyRange;
};
+/** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */
interface IDBObjectStore {
/**
* Returns true if the store has a key generator, and false otherwise.
@@ -1681,7 +1750,7 @@
* Returns the associated transaction.
*/
readonly transaction: IDBTransaction;
- add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey>;
+ add(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
/**
* Deletes all records in store.
* If successful, request's result will
@@ -1754,7 +1823,7 @@
* null if there were no matching records.
*/
openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
- put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey>;
+ put(value: any, key?: IDBValidKey): IDBRequest<IDBValidKey>;
}
declare var IDBObjectStore: {
@@ -1767,6 +1836,7 @@
"upgradeneeded": IDBVersionChangeEvent;
}
+/** Also inherits methods from its parents IDBRequest and EventTarget. */
interface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {
onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;
onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;
@@ -1786,6 +1856,7 @@
"success": Event;
}
+/** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */
interface IDBRequest<T = any> extends EventTarget {
/**
* When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws
@@ -1877,6 +1948,7 @@
new(): IDBTransaction;
};
+/** The IDBVersionChangeEvent interface of the IndexedDB API indicates that the version of the database has changed, as the result of an IDBOpenDBRequest.onupgradeneeded event handler function. */
interface IDBVersionChangeEvent extends Event {
readonly newVersion: number | null;
readonly oldVersion: number;
@@ -1918,6 +1990,7 @@
resizeWidth?: number;
}
+/** The ImageData interface represents the underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
/**
* Returns the one-dimensional array containing the data in RGBA order, as integers in the
@@ -1938,6 +2011,7 @@
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
};
+/** The MessageChannel interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties. */
interface MessageChannel {
readonly port1: MessagePort;
readonly port2: MessagePort;
@@ -1948,6 +2022,7 @@
new(): MessageChannel;
};
+/** The MessageEvent interface represents a message received by a target object. */
interface MessageEvent extends Event {
/**
* Returns the data of the message.
@@ -1986,6 +2061,7 @@
"messageerror": MessageEvent;
}
+/** The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */
interface MessagePort extends EventTarget {
onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;
onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;
@@ -2063,6 +2139,7 @@
"show": Event;
}
+/** The Notification interface of the Notifications API is used to configure and display desktop notifications to the user. */
interface Notification extends EventTarget {
readonly actions: ReadonlyArray<NotificationAction>;
readonly badge: string;
@@ -2097,6 +2174,7 @@
readonly permission: NotificationPermission;
};
+/** The parameter passed into the onnotificationclick handler, the NotificationEvent interface represents a notification click event that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. */
interface NotificationEvent extends ExtendableEvent {
readonly action: string;
readonly notification: Notification;
@@ -2107,23 +2185,29 @@
new(type: string, eventInitDict: NotificationEventInit): NotificationEvent;
};
+/** The OES_element_index_uint extension is part of the WebGL API and adds support for gl.UNSIGNED_INT types to WebGLRenderingContext.drawElements(). */
interface OES_element_index_uint {
}
+/** The OES_standard_derivatives extension is part of the WebGL API and adds the GLSL derivative functions dFdx, dFdy, and fwidth. */
interface OES_standard_derivatives {
readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;
}
+/** The OES_texture_float extension is part of the WebGL API and exposes floating-point pixel types for textures. */
interface OES_texture_float {
}
+/** The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures. */
interface OES_texture_float_linear {
}
+/** The OES_texture_half_float extension is part of the WebGL API and adds texture formats with 16- (aka half float) and 32-bit floating-point components. */
interface OES_texture_half_float {
readonly HALF_FLOAT_OES: GLenum;
}
+/** The OES_texture_half_float_linear extension is part of the WebGL API and allows linear filtering with half floating-point pixel types for textures. */
interface OES_texture_half_float_linear {
}
@@ -2135,6 +2219,7 @@
readonly VERTEX_ARRAY_BINDING_OES: GLenum;
}
+/** The Path2D interface of the Canvas 2D API is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */
interface Path2D extends CanvasPath {
addPath(path: Path2D, transform?: DOMMatrix2DInit): void;
}
@@ -2148,6 +2233,7 @@
"resourcetimingbufferfull": Event;
}
+/** The Performance interface provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
interface Performance extends EventTarget {
onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
readonly timeOrigin: number;
@@ -2173,6 +2259,7 @@
new(): Performance;
};
+/** The PerformanceEntry object encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image). */
interface PerformanceEntry {
readonly duration: number;
readonly entryType: string;
@@ -2186,6 +2273,7 @@
new(): PerformanceEntry;
};
+/** PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline. */
interface PerformanceMark extends PerformanceEntry {
}
@@ -2194,6 +2282,7 @@
new(): PerformanceMark;
};
+/** PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline. */
interface PerformanceMeasure extends PerformanceEntry {
}
@@ -2224,6 +2313,7 @@
new(): PerformanceObserverEntryList;
};
+/** The PerformanceResourceTiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script. */
interface PerformanceResourceTiming extends PerformanceEntry {
readonly connectEnd: number;
readonly connectStart: number;
@@ -2250,6 +2340,7 @@
new(): PerformanceResourceTiming;
};
+/** The ProgressEvent interface represents events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */
interface ProgressEvent extends Event {
readonly lengthComputable: boolean;
readonly loaded: number;
@@ -2271,6 +2362,7 @@
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
};
+/** The PushEvent interface of the Push API represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. */
interface PushEvent extends ExtendableEvent {
readonly data: PushMessageData | null;
}
@@ -2280,6 +2372,7 @@
new(type: string, eventInitDict?: PushEventInit): PushEvent;
};
+/** The PushManager interface of the Push API provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
interface PushManager {
getSubscription(): Promise<PushSubscription | null>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
@@ -2292,6 +2385,7 @@
readonly supportedContentEncodings: ReadonlyArray<string>;
};
+/** The PushMessageData interface of the Push API provides methods which let you retrieve the push data sent by a server in various formats. */
interface PushMessageData {
arrayBuffer(): ArrayBuffer;
blob(): Blob;
@@ -2304,6 +2398,7 @@
new(): PushMessageData;
};
+/** The PushSubscription interface of the Push API provides a subcription's URL endpoint and allows unsubscription from a push service. */
interface PushSubscription {
readonly endpoint: string;
readonly expirationTime: number | null;
@@ -2346,6 +2441,7 @@
error(error?: any): void;
}
+/** The ReadableStream interface of the Streams API represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> {
readonly locked: boolean;
cancel(reason?: any): Promise<void>;
@@ -2410,6 +2506,7 @@
new(): ReadableStreamReader;
};
+/** The Request interface of the Fetch API represents a resource request. */
interface Request extends Body {
/**
* Returns the cache mode associated with request, which is a string indicating
@@ -2495,6 +2592,7 @@
new(input: RequestInfo, init?: RequestInit): Request;
};
+/** The Response interface of the Fetch API represents the response to a request. */
interface Response extends Body {
readonly headers: Headers;
readonly ok: boolean;
@@ -2518,6 +2616,7 @@
"statechange": Event;
}
+/** The ServiceWorker interface of the ServiceWorker API provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */
interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
readonly scriptURL: string;
@@ -2540,6 +2639,7 @@
"messageerror": MessageEvent;
}
+/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */
interface ServiceWorkerContainer extends EventTarget {
readonly controller: ServiceWorker | null;
oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
@@ -2574,6 +2674,7 @@
"sync": SyncEvent;
}
+/** The ServiceWorkerGlobalScope interface of the ServiceWorker API represents the global execution context of a service worker. */
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
readonly clients: Clients;
onactivate: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;
@@ -2603,6 +2704,7 @@
"updatefound": Event;
}
+/** The ServiceWorkerRegistration interface of the ServiceWorker API represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */
interface ServiceWorkerRegistration extends EventTarget {
readonly active: ServiceWorker | null;
readonly installing: ServiceWorker | null;
@@ -2638,6 +2740,7 @@
new(): StorageManager;
};
+/** The SubtleCrypto interface represents a set of cryptographic primitives. It is available via the Crypto.subtle properties available in a window context (via Window.crypto). */
interface SubtleCrypto {
decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike<ArrayBuffer>;
deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike<ArrayBuffer>;
@@ -2664,6 +2767,7 @@
new(): SubtleCrypto;
};
+/** The SyncEvent interface represents a sync action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.  */
interface SyncEvent extends ExtendableEvent {
readonly lastChance: boolean;
readonly tag: string;
@@ -2674,6 +2778,7 @@
new(type: string, init: SyncEventInit): SyncEvent;
};
+/** The SyncManager interface of the the ServiceWorker API provides an interface for registering and listing sync registrations. */
interface SyncManager {
getTags(): Promise<string[]>;
register(tag: string): Promise<void>;
@@ -2684,6 +2789,7 @@
new(): SyncManager;
};
+/** The TextDecoder interface represents a decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
interface TextDecoder {
/**
* Returns encoding's name, lowercased.
@@ -2719,6 +2825,7 @@
new(label?: string, options?: TextDecoderOptions): TextDecoder;
};
+/** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */
interface TextEncoder {
/**
* Returns "utf-8".
@@ -2735,6 +2842,7 @@
new(): TextEncoder;
};
+/** The TextMetrics interface represents the dimension of a text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */
interface TextMetrics {
readonly actualBoundingBoxAscent: number;
readonly actualBoundingBoxDescent: number;
@@ -2775,6 +2883,7 @@
terminate(): void;
}
+/** The URL interface represents an object providing static methods used for creating object URLs. */
interface URL {
hash: string;
host: string;
@@ -2870,6 +2979,7 @@
readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;
}
+/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
interface WEBGL_compressed_texture_s3tc {
readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;
readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;
@@ -2884,6 +2994,7 @@
readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;
}
+/** The WEBGL_debug_renderer_info extension is part of the WebGL API and exposes two constants with information about the graphics driver for debugging purposes. */
interface WEBGL_debug_renderer_info {
readonly UNMASKED_RENDERER_WEBGL: GLenum;
readonly UNMASKED_VENDOR_WEBGL: GLenum;
@@ -2893,6 +3004,7 @@
getTranslatedShaderSource(shader: WebGLShader): string;
}
+/** The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures. */
interface WEBGL_depth_texture {
readonly UNSIGNED_INT_24_8_WEBGL: GLenum;
}
@@ -2940,6 +3052,7 @@
restoreContext(): void;
}
+/** The WebGLActiveInfo interface is part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getActiveAttrib() and WebGLRenderingContext.getActiveUniform() methods. */
interface WebGLActiveInfo {
readonly name: string;
readonly size: GLint;
@@ -2951,6 +3064,7 @@
new(): WebGLActiveInfo;
};
+/** The WebGLBuffer interface is part of the WebGL API and represents an opaque buffer object storing data such as vertices or colors. */
interface WebGLBuffer extends WebGLObject {
}
@@ -2959,6 +3073,7 @@
new(): WebGLBuffer;
};
+/** The WebContextEvent interface is part of the WebGL API and is an interface for an event that is generated in response to a status change to the WebGL rendering context. */
interface WebGLContextEvent extends Event {
readonly statusMessage: string;
}
@@ -2968,6 +3083,7 @@
new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;
};
+/** The WebGLFramebuffer interface is part of the WebGL API and represents a collection of buffers that serve as a rendering destination. */
interface WebGLFramebuffer extends WebGLObject {
}
@@ -2984,6 +3100,7 @@
new(): WebGLObject;
};
+/** The WebGLProgram is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). */
interface WebGLProgram extends WebGLObject {
}
@@ -2992,6 +3109,7 @@
new(): WebGLProgram;
};
+/** The WebGLRenderbuffer interface is part of the WebGL API and represents a buffer that can contain an image, or can be source or target of an rendering operation. */
interface WebGLRenderbuffer extends WebGLObject {
}
@@ -3000,6 +3118,7 @@
new(): WebGLRenderbuffer;
};
+/** The WebGLRenderingContext interface provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element. */
interface WebGLRenderingContext extends WebGLRenderingContextBase {
}
@@ -3418,7 +3537,7 @@
isTexture(texture: WebGLTexture | null): GLboolean;
lineWidth(width: GLfloat): void;
linkProgram(program: WebGLProgram): void;
- pixelStorei(pname: GLenum, param: GLint): void;
+ pixelStorei(pname: GLenum, param: GLint | GLboolean): void;
polygonOffset(factor: GLfloat, units: GLfloat): void;
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;
renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
@@ -3766,6 +3885,7 @@
readonly ZERO: GLenum;
}
+/** The WebGLShader is part of the WebGL API and can either be a vertex or a fragment shader. A WebGLProgram requires both types of shaders. */
interface WebGLShader extends WebGLObject {
}
@@ -3774,6 +3894,7 @@
new(): WebGLShader;
};
+/** The WebGLShaderPrecisionFormat interface is part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method. */
interface WebGLShaderPrecisionFormat {
readonly precision: GLint;
readonly rangeMax: GLint;
@@ -3785,6 +3906,7 @@
new(): WebGLShaderPrecisionFormat;
};
+/** The WebGLTexture interface is part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations. */
interface WebGLTexture extends WebGLObject {
}
@@ -3793,6 +3915,7 @@
new(): WebGLTexture;
};
+/** The WebGLUniformLocation interface is part of the WebGL API and represents the location of a uniform variable in a shader program. */
interface WebGLUniformLocation {
}
@@ -3811,6 +3934,7 @@
"open": Event;
}
+/** The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. */
interface WebSocket extends EventTarget {
binaryType: BinaryType;
readonly bufferedAmount: number;
@@ -3848,6 +3972,7 @@
btoa(rawString: string): string;
}
+/** The WindowClient interface of the ServiceWorker API represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
interface WindowClient extends Client {
readonly ancestorOrigins: ReadonlyArray<string>;
readonly focused: boolean;
@@ -3887,6 +4012,7 @@
"message": MessageEvent;
}
+/** The Worker interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */
interface Worker extends EventTarget, AbstractWorker {
onmessage: ((this: Worker, ev: MessageEvent) => any) | null;
postMessage(message: any, transfer?: Transferable[]): void;
@@ -3899,13 +4025,14 @@
declare var Worker: {
prototype: Worker;
- new(stringUrl: string, options?: WorkerOptions): Worker;
+ new(stringUrl: string | URL, options?: WorkerOptions): Worker;
};
interface WorkerGlobalScopeEventMap {
"error": ErrorEvent;
}
+/** The WorkerGlobalScope interface of the Web Workers API is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */
interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch, WindowOrWorkerGlobalScope {
readonly caches: CacheStorage;
readonly isSecureContext: boolean;
@@ -3925,6 +4052,7 @@
new(): WorkerGlobalScope;
};
+/** The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location. */
interface WorkerLocation {
readonly hash: string;
readonly host: string;
@@ -3943,6 +4071,7 @@
new(): WorkerLocation;
};
+/** The WorkerNavigator interface represents a subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
interface WorkerNavigator extends NavigatorID, NavigatorOnLine, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorStorage {
readonly serviceWorker: ServiceWorkerContainer;
}
@@ -3959,6 +4088,7 @@
importScripts(...urls: string[]): void;
}
+/** The WritableStream interface of the the Streams API provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
interface WritableStream<W = any> {
readonly locked: boolean;
abort(reason?: any): Promise<void>;
@@ -3970,10 +4100,12 @@
new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
};
+/** The WritableStreamDefaultController interface of the the Streams API represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
interface WritableStreamDefaultController {
error(error?: any): void;
}
+/** The WritableStreamDefaultWriter interface of the the Streams API is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */
interface WritableStreamDefaultWriter<W = any> {
readonly closed: Promise<void>;
readonly desiredSize: number | null;
@@ -3988,6 +4120,7 @@
"readystatechange": Event;
}
+/** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */
interface XMLHttpRequest extends XMLHttpRequestEventTarget {
onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
/**
@@ -4062,7 +4195,8 @@
*/
overrideMimeType(mime: string): void;
/**
- * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.
+ * Initiates the request. The body argument provides the request body, if any,
+ * and is ignored if the request method is GET or HEAD.
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
*/
send(body?: BodyInit | null): void;
@@ -4279,7 +4413,7 @@
type NotificationPermission = "default" | "denied" | "granted";
type PushEncryptionKeyName = "p256dh" | "auth";
type PushPermissionState = "denied" | "granted" | "prompt";
-type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
+type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";

lib/protocol.d.ts

@@ -49,6 +49,7 @@
OpenExternalProject = "openExternalProject",
OpenExternalProjects = "openExternalProjects",
CloseExternalProject = "closeExternalProject",
+ UpdateOpen = "updateOpen",
GetOutliningSpans = "getOutliningSpans",
TodoComments = "todoComments",
Indentation = "indentation",
@@ -1118,6 +1119,30 @@
interface CloseExternalProjectResponse extends Response {
}
/**
+ * Request to synchronize list of open files with the client
+ */
+ interface UpdateOpenRequest extends Request {
+ command: CommandTypes.UpdateOpen;
+ arguments: UpdateOpenRequestArgs;
+ }
+ /**
+ * Arguments to UpdateOpenRequest
+ */
+ interface UpdateOpenRequestArgs {
+ /**
+ * List of newly open files
+ */
+ openFiles?: OpenRequestArgs[];
+ /**
+ * List of open files files that were changes
+ */
+ changedFiles?: FileCodeEdits[];
+ /**
+ * List of files that were closed
+ */
+ closedFiles?: string[];
+ }
+ /**
* Request to set compiler options for inferred projects.
* External projects are opened / closed explicitly.
* Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders.

lib/README.md

@@ -2,4 +2,4 @@
**These files are not meant to be edited by hand.**
If you need to make modifications, the respective files should be changed within the repository's top-level `src` directory.
-Running `jake LKG` will then appropriately update the files in this directory.
+Running `gulp LKG` will then appropriately update the files in this directory.

lib/tsc.js

@@ -15,7 +15,6 @@
"use strict";
-"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -60,8 +59,8 @@
};
var ts;
(function (ts) {
- ts.versionMajorMinor = "3.3";
- ts.version = ts.versionMajorMinor + ".4000";
+ ts.versionMajorMinor = "3.4";
+ ts.version = ts.versionMajorMinor + ".1";
})(ts || (ts = {}));
(function (ts) {
ts.emptyArray = [];
@@ -97,19 +96,24 @@
ts.MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap();
function shimMap() {
var MapIterator = (function () {
- function MapIterator(data, selector) {
- this.index = 0;
- this.data = data;
+ function MapIterator(currentEntry, selector) {
+ this.currentEntry = currentEntry;
this.selector = selector;
- this.keys = Object.keys(data);
}
MapIterator.prototype.next = function () {
- var index = this.index;
- if (index < this.keys.length) {
- this.index++;
- return { value: this.selector(this.data, this.keys[index]), done: false };
+ while (this.currentEntry) {
+ var skipNext = !!this.currentEntry.skipNext;
+ this.currentEntry = this.currentEntry.nextEntry;
+ if (!skipNext) {
+ break;
+ }
+ }
+ if (this.currentEntry) {
+ return { value: this.selector(this.currentEntry.key, this.currentEntry.value), done: false };
}
+ else {
return { value: undefined, done: true };
+ }
};
return MapIterator;
}());
@@ -117,15 +121,29 @@
function class_1() {
this.data = createDictionaryObject();
this.size = 0;
+ this.firstEntry = {};
+ this.lastEntry = this.firstEntry;
}
class_1.prototype.get = function (key) {
- return this.data[key];
+ var entry = this.data[key];
+ return entry && entry.value;
};
class_1.prototype.set = function (key, value) {
if (!this.has(key)) {
this.size++;
+ var newEntry = {
+ key: key,
+ value: value
+ };
+ this.data[key] = newEntry;
+ var previousLastEntry = this.lastEntry;
+ previousLastEntry.nextEntry = newEntry;
+ newEntry.previousEntry = previousLastEntry;
+ this.lastEntry = newEntry;
+ }
+ else {
+ this.data[key].value = value;
}
- this.data[key] = value;
return this;
};
class_1.prototype.has = function (key) {
@@ -134,7 +152,19 @@
class_1.prototype.delete = function (key) {
if (this.has(key)) {
this.size--;
+ var entry = this.data[key];
delete this.data[key];
+ var previousEntry = entry.previousEntry;
+ previousEntry.nextEntry = entry.nextEntry;
+ if (entry.nextEntry) {
+ entry.nextEntry.previousEntry = previousEntry;
+ }
+ if (this.lastEntry === entry) {
+ this.lastEntry = previousEntry;
+ }
+ entry.previousEntry = undefined;
+ entry.nextEntry = previousEntry;
+ entry.skipNext = true;
return true;
}
return false;
@@ -142,24 +172,41 @@
class_1.prototype.clear = function () {
this.data = createDictionaryObject();
this.size = 0;
+ var firstEntry = this.firstEntry;
+ var currentEntry = firstEntry.nextEntry;
+ while (currentEntry) {
+ var nextEntry = currentEntry.nextEntry;
+ currentEntry.previousEntry = undefined;
+ currentEntry.nextEntry = firstEntry;
+ currentEntry.skipNext = true;
+ currentEntry = nextEntry;
+ }
+ firstEntry.nextEntry = undefined;
+ this.lastEntry = firstEntry;
};
class_1.prototype.keys = function () {
- return new MapIterator(this.data, function (_data, key) { return key; });
+ return new MapIterator(this.firstEntry, function (key) { return key; });
};
class_1.prototype.values = function () {
- return new MapIterator(this.data, function (data, key) { return data[key]; });
+ return new MapIterator(this.firstEntry, function (_key, value) { return value; });
};
class_1.prototype.entries = function () {
- return new MapIterator(this.data, function (data, key) { return [key, data[key]]; });
+ return new MapIterator(this.firstEntry, function (key, value) { return [key, value]; });
};
class_1.prototype.forEach = function (action) {
- for (var key in this.data) {
- action(this.data[key], key);
+ var iterator = this.entries();
+ while (true) {
+ var _a = iterator.next(), entry = _a.value, done = _a.done;
+ if (done) {
+ break;
+ }
+ action(entry[1], entry[0]);
}
};
return class_1;
}());
}
+ ts.shimMap = shimMap;
function length(array) {
return array ? array.length : 0;
}
@@ -855,6 +902,21 @@
} };
}
ts.arrayIterator = arrayIterator;
+ function arrayReverseIterator(array) {
+ var i = array.length;
+ return {
+ next: function () {
+ if (i === 0) {
+ return { value: undefined, done: true };
+ }
+ else {
+ i--;
+ return { value: array[i], done: false };
+ }
+ }
+ };
+ }
+ ts.arrayReverseIterator = arrayReverseIterator;
function stableSort(array, comparer) {
var indices = array.map(function (_, i) { return i; });
stableSortIndices(array, indices, comparer);
@@ -1013,6 +1075,8 @@
}
for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
var arg = args_1[_a];
+ if (arg === undefined)
+ continue;
for (var p in arg) {
if (hasProperty(arg, p)) {
t[p] = arg[p];
@@ -1176,6 +1240,8 @@
ts.returnFalse = returnFalse;
function returnTrue() { return true; }
ts.returnTrue = returnTrue;
+ function returnUndefined() { return undefined; }
+ ts.returnUndefined = returnUndefined;
function identity(x) { return x; }
ts.identity = identity;
function toLowerCase(x) { return x.toLowerCase(); }
@@ -1312,7 +1378,7 @@
Debug.assertEachDefined = assertEachDefined;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
- var detail = "kind" in member && "pos" in member ? "SyntaxKind: " + Debug.showSyntaxKind(member) : JSON.stringify(member);
+ var detail = typeof member === "object" && "kind" in member && "pos" in member ? "SyntaxKind: " + Debug.showSyntaxKind(member) : JSON.stringify(member);
return fail(message + " " + detail, stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
@@ -2177,8 +2243,11 @@
var ts;
(function (ts) {
function generateDjb2Hash(data) {
- var chars = data.split("").map(function (str) { return str.charCodeAt(0); });
- return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381);
+ var acc = 5381;
+ for (var i = 0; i < data.length; i++) {
+ acc = ((acc << 5) + acc) + data.charCodeAt(i);
+ }
+ return acc.toString();
}
ts.generateDjb2Hash = generateDjb2Hash;
function setStackTraceLimit() {
@@ -2408,6 +2477,7 @@
: FileWatcherEventKind.Changed;
}
ts.getFileWatcherEventKind = getFileWatcherEventKind;
+ ts.ignoredPaths = ["/node_modules/.", "/.git"];
function createRecursiveDirectoryWatcher(host) {
var cache = ts.createMap();
var callbackCache = ts.createMultiMap();
@@ -2423,6 +2493,8 @@
else {
directoryWatcher = {
watcher: host.watchDirectory(dirName, function (fileName) {
+ if (isIgnoredPath(fileName))
+ return;
callbackCache.forEach(function (callbacks, rootDirName) {
if (rootDirName === dirPath || (ts.startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === ts.directorySeparator)) {
callbacks.forEach(function (callback) { return callback(fileName); });
@@ -2464,7 +2536,7 @@
var newChildWatches;
ts.enumerateInsertsAndDeletes(host.directoryExists(parentDir) ? ts.mapDefined(host.getAccessibleSortedChildDirectories(parentDir), function (child) {
var childFullName = ts.getNormalizedAbsolutePath(child, parentDir);
- return filePathComparer(childFullName, ts.normalizePath(host.realpath(childFullName))) === 0 ? childFullName : undefined;
+ return !isIgnoredPath(childFullName) && filePathComparer(childFullName, ts.normalizePath(host.realpath(childFullName))) === 0 ? childFullName : undefined;
}) : ts.emptyArray, existingChildWatches, function (child, childWatcher) { return filePathComparer(child, childWatcher.dirName); }, createAndAddChildDirectoryWatcher, ts.closeFileWatcher, addChildDirectoryWatcher);
return newChildWatches || ts.emptyArray;
function createAndAddChildDirectoryWatcher(childName) {
@@ -2475,6 +2547,16 @@
(newChildWatches || (newChildWatches = [])).push(childWatcher);
}
}
+ function isIgnoredPath(path) {
+ return ts.some(ts.ignoredPaths, function (searchPath) { return isInPath(path, searchPath); });
+ }
+ function isInPath(path, searchPath) {
+ if (ts.stringContains(path, searchPath))
+ return true;
+ if (host.useCaseSensitiveFileNames)
+ return false;
+ return ts.stringContains(toCanonicalFilePath(path), searchPath);
+ }
}
ts.createRecursiveDirectoryWatcher = createRecursiveDirectoryWatcher;
function getNodeMajorVersion() {
@@ -2533,8 +2615,15 @@
directoryExists: directoryExists,
createDirectory: function (directoryName) {
if (!nodeSystem.directoryExists(directoryName)) {
+ try {
_fs.mkdirSync(directoryName);
}
+ catch (e) {
+ if (e.code !== "EEXIST") {
+ throw e;
+ }
+ }
+ }
},
getExecutingFilePath: function () {
return __filename;
@@ -2550,7 +2639,7 @@
getModifiedTime: getModifiedTime,
setModifiedTime: setModifiedTime,
deleteFile: deleteFile,
- createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash,
+ createHash: _crypto ? createSHA256Hash : generateDjb2Hash,
createSHA256Hash: _crypto ? createSHA256Hash : undefined,
getMemoryUsage: function () {
if (global.gc) {
@@ -2875,7 +2964,7 @@
}
}
function readDirectory(path, extensions, excludes, includes, depth) {
- return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries);
+ return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
}
function fileSystemEntryExists(path, entryKind) {
try {
@@ -2931,11 +3020,6 @@
return;
}
}
- function createMD5HashUsingNativeCrypto(data) {
- var hash = _crypto.createHash("md5");
- hash.update(data);
- return hash.digest("hex");
- }
function createSHA256Hash(data) {
var hash = _crypto.createHash("sha256");
hash.update(data);
@@ -3187,7 +3271,6 @@
Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."),
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."),
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", "Cannot compile namespaces when the '--isolatedModules' flag is provided."),
- Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: diag(1209, ts.DiagnosticCategory.Error, "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209", "Ambient const enums are not allowed when the '--isolatedModules' flag is provided."),
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."),
A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."),
Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."),
@@ -3278,6 +3361,8 @@
An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, ts.DiagnosticCategory.Error, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."),
A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts.DiagnosticCategory.Error, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."),
A_bigint_literal_must_be_an_integer: diag(1353, ts.DiagnosticCategory.Error, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."),
+ readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, ts.DiagnosticCategory.Error, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."),
+ A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal: diag(1355, ts.DiagnosticCategory.Error, "A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal_1355", "A 'const' assertion can only be applied to a string, number, boolean, array, or object literal."),
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -3372,7 +3457,7 @@
Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, ts.DiagnosticCategory.Error, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."),
Multiple_constructor_implementations_are_not_allowed: diag(2392, ts.DiagnosticCategory.Error, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."),
Duplicate_function_implementation: diag(2393, ts.DiagnosticCategory.Error, "Duplicate_function_implementation_2393", "Duplicate function implementation."),
- Overload_signature_is_not_compatible_with_function_implementation: diag(2394, ts.DiagnosticCategory.Error, "Overload_signature_is_not_compatible_with_function_implementation_2394", "Overload signature is not compatible with function implementation."),
+ This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, ts.DiagnosticCategory.Error, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."),
Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, ts.DiagnosticCategory.Error, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."),
Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, ts.DiagnosticCategory.Error, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),
Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, ts.DiagnosticCategory.Error, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."),
@@ -3545,15 +3630,20 @@
No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),
Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"),
Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."),
- Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."),
_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."),
Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."),
JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."),
Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."),
+ Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."),
+ Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."),
+ Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."),
JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."),
The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."),
JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),
@@ -3660,6 +3750,12 @@
This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),
This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),
_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),
+ Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."),
+ _0_refers_to_a_value_but_is_being_used_as_a_type_here: diag(2749, ts.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_2749", "'{0}' refers to a value, but is being used as a type here."),
+ The_implementation_signature_is_declared_here: diag(2750, ts.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."),
+ Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."),
+ The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."),
+ Another_export_default_is_here: diag(2753, ts.DiagnosticCategory.Error, "Another_export_default_is_here_2753", "Another export default is here."),
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -3743,6 +3839,7 @@
Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, ts.DiagnosticCategory.Error, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."),
Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, ts.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),
Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, ts.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."),
+ Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."),
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -3791,7 +3888,7 @@
Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."),
Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."),
Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."),
- Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."),
+ Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'."),
Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."),
Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."),
Print_the_compiler_s_version: diag(6019, ts.DiagnosticCategory.Message, "Print_the_compiler_s_version_6019", "Print the compiler's version."),
@@ -4010,6 +4107,16 @@
Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."),
Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."),
Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts.DiagnosticCategory.Message, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."),
+ Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed: diag(6372, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372", "Project '{0}' is out of date because output of its dependency '{1}' has changed"),
+ Updating_output_of_project_0: diag(6373, ts.DiagnosticCategory.Message, "Updating_output_of_project_0_6373", "Updating output of project '{0}'..."),
+ A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, ts.DiagnosticCategory.Message, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"),
+ A_non_dry_build_would_update_output_of_project_0: diag(6375, ts.DiagnosticCategory.Message, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"),
+ Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, ts.DiagnosticCategory.Message, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"),
+ Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, ts.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),
+ Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, "Enable_incremental_compilation_6378", "Enable incremental compilation"),
+ Composite_projects_may_not_disable_incremental_compilation: diag(6379, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
+ Specify_file_to_store_incremental_compilation_information: diag(6380, ts.DiagnosticCategory.Message, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
+ Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -4046,7 +4153,7 @@
Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),
Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."),
If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, ts.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}`"),
- The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any: diag(7041, ts.DiagnosticCategory.Error, "The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any_7041", "The containing arrow function captures the global value of 'this' which implicitly has type 'any'."),
+ The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, ts.DiagnosticCategory.Error, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."),
Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, ts.DiagnosticCategory.Error, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),
Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, ts.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, ts.DiagnosticCategory.Suggestion, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),
@@ -4226,6 +4333,7 @@
Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"),
Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"),
Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"),
+ Convert_parameters_to_destructured_object: diag(95075, ts.DiagnosticCategory.Message, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"),
};
})(ts || (ts = {}));
var ts;
@@ -4624,19 +4732,28 @@
ts.Debug.assert(pos === 0);
return shebangTriviaRegex.test(text);
}
+ ts.isShebangTrivia = isShebangTrivia;
function scanShebangTrivia(text, pos) {
var shebang = shebangTriviaRegex.exec(text)[0];
pos = pos + shebang.length;
return pos;
}
+ ts.scanShebangTrivia = scanShebangTrivia;
function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
var pendingPos;
var pendingEnd;
var pendingKind;
var pendingHasTrailingNewLine;
var hasPendingCommentRange = false;
- var collecting = trailing || pos === 0;
+ var collecting = trailing;
var accumulator = initial;
+ if (pos === 0) {
+ collecting = true;
+ var shebang = getShebang(text);
+ if (shebang) {
+ pos = shebang.length;
+ }
+ }
scan: while (pos >= 0 && pos < text.length) {
var ch = text.charCodeAt(pos);
switch (ch) {
@@ -5798,6 +5915,7 @@
}
pos++;
}
+ tokenValue = text.substring(startPos, pos);
return firstNonWhitespace === -1 ? 12 : 11;
}
function scanJsxIdentifier() {
@@ -5876,8 +5994,8 @@
pos++;
return token = 14;
}
- if (isIdentifierStart(ch, 6)) {
- while (isIdentifierPart(text.charCodeAt(pos), 6) && pos < end) {
+ if (isIdentifierStart(ch, 7)) {
+ while (isIdentifierPart(text.charCodeAt(pos), 7) && pos < end) {
pos++;
}
tokenValue = text.substring(tokenPos, pos);
@@ -6218,7 +6336,7 @@
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 279) {
+ while (node && node.kind !== 284) {
node = node.parent;
}
return node;
@@ -6281,7 +6399,7 @@
return !nodeIsMissing(node);
}
ts.nodeIsPresent = nodeIsPresent;
- function addStatementsAfterPrologue(to, from) {
+ function insertStatementsAfterPrologue(to, from, isPrologueDirective) {
if (from === undefined || from.length === 0)
return to;
var statementIndex = 0;
@@ -6293,7 +6411,37 @@
to.splice.apply(to, [statementIndex, 0].concat(from));
return to;
}
- ts.addStatementsAfterPrologue = addStatementsAfterPrologue;
+ function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
+ if (statement === undefined)
+ return to;
+ var statementIndex = 0;
+ for (; statementIndex < to.length; ++statementIndex) {
+ if (!isPrologueDirective(to[statementIndex])) {
+ break;
+ }
+ }
+ to.splice(statementIndex, 0, statement);
+ return to;
+ }
+ function isAnyPrologueDirective(node) {
+ return isPrologueDirective(node) || !!(getEmitFlags(node) & 1048576);
+ }
+ function insertStatementsAfterStandardPrologue(to, from) {
+ return insertStatementsAfterPrologue(to, from, isPrologueDirective);
+ }
+ ts.insertStatementsAfterStandardPrologue = insertStatementsAfterStandardPrologue;
+ function insertStatementsAfterCustomPrologue(to, from) {
+ return insertStatementsAfterPrologue(to, from, isAnyPrologueDirective);
+ }
+ ts.insertStatementsAfterCustomPrologue = insertStatementsAfterCustomPrologue;
+ function insertStatementAfterStandardPrologue(to, statement) {
+ return insertStatementAfterPrologue(to, statement, isPrologueDirective);
+ }
+ ts.insertStatementAfterStandardPrologue = insertStatementAfterStandardPrologue;
+ function insertStatementAfterCustomPrologue(to, statement) {
+ return insertStatementAfterPrologue(to, statement, isAnyPrologueDirective);
+ }
+ ts.insertStatementAfterCustomPrologue = insertStatementAfterCustomPrologue;
function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
if (text.charCodeAt(commentPos + 1) === 47 &&
commentPos + 2 < commentEnd &&
@@ -6323,7 +6471,7 @@
if (includeJsDoc && ts.hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0]);
}
- if (node.kind === 306 && node._children.length > 0) {
+ if (node.kind === 311 && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
@@ -6342,7 +6490,7 @@
}
ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile;
function isJSDocTypeExpressionOrChild(node) {
- return node.kind === 283 || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
+ return node.kind === 288 || (node.parent && isJSDocTypeExpressionOrChild(node.parent));
}
function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) {
if (includeTrivia === void 0) { includeTrivia = false; }
@@ -6445,7 +6593,7 @@
return node && node.kind === 244 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 279 ||
+ return node.kind === 284 ||
node.kind === 244 ||
ts.isFunctionLike(node);
}
@@ -6460,7 +6608,7 @@
ts.isExternalModuleAugmentation = isExternalModuleAugmentation;
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 279:
+ case 284:
return ts.isExternalModule(node.parent);
case 245:
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
@@ -6478,7 +6626,7 @@
ts.isEffectiveExternalModule = isEffectiveExternalModule;
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 279:
+ case 284:
case 246:
case 274:
case 244:
@@ -6501,9 +6649,9 @@
ts.isBlockScope = isBlockScope;
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 297:
- case 304:
- case 293:
+ case 302:
+ case 309:
+ case 298:
return true;
default:
ts.assertType(node);
@@ -6519,12 +6667,12 @@
case 162:
case 165:
case 166:
- case 289:
+ case 294:
case 240:
case 209:
case 241:
case 242:
- case 303:
+ case 308:
case 239:
case 156:
case 157:
@@ -6662,7 +6810,7 @@
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
- case 279:
+ case 284:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
return ts.createTextSpan(0, 0);
@@ -6819,7 +6967,7 @@
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
case 150:
return node === parent.constraint;
- case 303:
+ case 308:
return node === parent.constraint;
case 154:
case 153:
@@ -7063,7 +7211,7 @@
}
ts.getContainingClass = getContainingClass;
function getThisContainer(node, includeArrowFunctions) {
- ts.Debug.assert(node.kind !== 279);
+ ts.Debug.assert(node.kind !== 284);
while (true) {
node = node.parent;
if (!node) {
@@ -7102,7 +7250,7 @@
case 161:
case 162:
case 243:
- case 279:
+ case 284:
return node;
}
}
@@ -7171,6 +7319,11 @@
}
}
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
+ function isSuperOrSuperProperty(node) {
+ return node.kind === 98
+ || isSuperProperty(node);
+ }
+ ts.isSuperOrSuperProperty = isSuperOrSuperProperty;
function isSuperProperty(node) {
var kind = node.kind;
return (kind === 189 || kind === 190)
@@ -7744,7 +7897,7 @@
}
ts.isJSDocConstructSignature = isJSDocConstructSignature;
function isJSDocTypeAlias(node) {
- return node.kind === 304 || node.kind === 297;
+ return node.kind === 309 || node.kind === 302;
}
ts.isJSDocTypeAlias = isJSDocTypeAlias;
function isTypeAlias(node) {
@@ -7880,7 +8033,7 @@
ts.hasRestParameter = hasRestParameter;
function isRestParameter(node) {
var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type;
- return node.dotDotDotToken !== undefined || !!type && type.kind === 290;
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 295;
}
ts.isRestParameter = isRestParameter;
function getAssignmentTargetKind(node) {
@@ -8086,13 +8239,14 @@
}
ts.exportAssignmentIsAlias = exportAssignmentIsAlias;
function getEffectiveBaseTypeNode(node) {
- if (isInJSFile(node)) {
+ var baseType = getClassExtendsHeritageElement(node);
+ if (baseType && isInJSFile(node)) {
var tag = ts.getJSDocAugmentsTag(node);
if (tag) {
return tag.class;
}
}
- return getClassExtendsHeritageElement(node);
+ return baseType;
}
ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode;
function getClassExtendsHeritageElement(node) {
@@ -8306,7 +8460,7 @@
|| kind === 158
|| kind === 159
|| kind === 244
- || kind === 279;
+ || kind === 284;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
function nodeIsSynthesized(range) {
@@ -8378,7 +8532,7 @@
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 309:
+ case 314:
return 0;
case 208:
return 1;
@@ -8679,6 +8833,9 @@
lineStart = true;
}
}
+ function getTextPosWithWriteLine() {
+ return lineStart ? output.length : (output.length + newLine.length);
+ }
reset();
return {
write: write,
@@ -8707,7 +8864,8 @@
writeStringLiteral: write,
writeSymbol: function (s, _) { return write(s); },
writeTrailingSemicolon: write,
- writeComment: write
+ writeComment: write,
+ getTextPosWithWriteLine: getTextPosWithWriteLine
};
}
ts.createTextWriter = createTextWriter;
@@ -8824,21 +8982,25 @@
function getSourceFilesToEmit(host, targetSourceFile) {
var options = host.getCompilerOptions();
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
+ var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
if (options.outFile || options.out) {
var moduleKind = ts.getEmitModuleKind(options);
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
return ts.filter(host.getSourceFiles(), function (sourceFile) {
- return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary);
+ return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
});
}
else {
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
- return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); });
+ return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
}
}
ts.getSourceFilesToEmit = getSourceFilesToEmit;
- function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) {
- return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) && !sourceFile.isDeclarationFile && !isSourceFileFromExternalLibrary(sourceFile);
+ function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
+ return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
+ !sourceFile.isDeclarationFile &&
+ !isSourceFileFromExternalLibrary(sourceFile) &&
+ !(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
}
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -8972,7 +9134,7 @@
}
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
function isNonTypeAliasTemplate(tag) {
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 291 && tag.parent.tags.some(isJSDocTypeAlias));
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 296 && tag.parent.tags.some(isJSDocTypeAlias));
}
function getEffectiveSetAccessorTypeAnnotationNode(node) {
var parameter = getSetAccessorValueParameter(node);
@@ -9737,7 +9899,7 @@
}
ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
function getObjectFlags(type) {
- return type.flags & 524288 ? type.objectFlags : 0;
+ return type.flags & 3768320 ? type.objectFlags : 0;
}
ts.getObjectFlags = getObjectFlags;
function typeHasCallOrConstructSignatures(type, checker) {
@@ -9803,25 +9965,37 @@
|| kind === 96
|| kind === 132
|| kind === 211
- || kind === 284
- || kind === 285
- || kind === 286
- || kind === 287
- || kind === 288
|| kind === 289
- || kind === 290;
+ || kind === 290
+ || kind === 291
+ || kind === 292
+ || kind === 293
+ || kind === 294
+ || kind === 295;
}
ts.isTypeNodeKind = isTypeNodeKind;
function isAccessExpression(node) {
return node.kind === 189 || node.kind === 190;
}
ts.isAccessExpression = isAccessExpression;
+ function isBundleFileTextLike(section) {
+ switch (section.kind) {
+ case "text":
+ case "internal":
+ return true;
+ default:
+ return false;
+ }
+ }
+ ts.isBundleFileTextLike = isBundleFileTextLike;
})(ts || (ts = {}));
(function (ts) {
function getDefaultLibFileName(options) {
switch (options.target) {
- case 6:
+ case 7:
return "lib.esnext.full.d.ts";
+ case 6:
+ return "lib.es2019.full.d.ts";
case 5:
return "lib.es2018.full.d.ts";
case 4:
@@ -10147,8 +10321,8 @@
switch (declaration.kind) {
case 72:
return declaration;
- case 305:
- case 299: {
+ case 310:
+ case 304: {
var name = declaration.name;
if (name.kind === 148) {
return name.right;
@@ -10172,7 +10346,7 @@
return undefined;
}
}
- case 304:
+ case 309:
return getNameOfJSDocTypedef(declaration);
case 254: {
var expression = declaration.expression;
@@ -10314,7 +10488,7 @@
return ts.emptyArray;
}
if (ts.isJSDocTypeAlias(node)) {
- ts.Debug.assert(node.parent.kind === 291);
+ ts.Debug.assert(node.parent.kind === 296);
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
}
if (node.typeParameters) {
@@ -10566,12 +10740,17 @@
return node.kind === 194;
}
ts.isTypeAssertion = isTypeAssertion;
+ function isConstTypeReference(node) {
+ return isTypeReferenceNode(node) && isIdentifier(node.typeName) &&
+ node.typeName.escapedText === "const" && !node.typeArguments;
+ }
+ ts.isConstTypeReference = isConstTypeReference;
function isParenthesizedExpression(node) {
return node.kind === 195;
}
ts.isParenthesizedExpression = isParenthesizedExpression;
function skipPartiallyEmittedExpressions(node) {
- while (node.kind === 308) {
+ while (node.kind === 313) {
node = node.expression;
}
return node;
@@ -10910,113 +11089,133 @@
}
ts.isEnumMember = isEnumMember;
function isSourceFile(node) {
- return node.kind === 279;
+ return node.kind === 284;
}
ts.isSourceFile = isSourceFile;
function isBundle(node) {
- return node.kind === 280;
+ return node.kind === 285;
}
ts.isBundle = isBundle;
function isUnparsedSource(node) {
- return node.kind === 281;
+ return node.kind === 286;
}
ts.isUnparsedSource = isUnparsedSource;
+ function isUnparsedPrepend(node) {
+ return node.kind === 280;
+ }
+ ts.isUnparsedPrepend = isUnparsedPrepend;
+ function isUnparsedTextLike(node) {
+ switch (node.kind) {
+ case 281:
+ case 282:
+ return true;
+ default:
+ return false;
+ }
+ }
+ ts.isUnparsedTextLike = isUnparsedTextLike;
+ function isUnparsedNode(node) {
+ return isUnparsedTextLike(node) ||
+ node.kind === 279 ||
+ node.kind === 283;
+ }
+ ts.isUnparsedNode = isUnparsedNode;
function isJSDocTypeExpression(node) {
- return node.kind === 283;
+ return node.kind === 288;
}
ts.isJSDocTypeExpression = isJSDocTypeExpression;
function isJSDocAllType(node) {
- return node.kind === 284;
+ return node.kind === 289;
}
ts.isJSDocAllType = isJSDocAllType;
function isJSDocUnknownType(node) {
- return node.kind === 285;
+ return node.kind === 290;
}
ts.isJSDocUnknownType = isJSDocUnknownType;
function isJSDocNullableType(node) {
- return node.kind === 286;
+ return node.kind === 291;
}
ts.isJSDocNullableType = isJSDocNullableType;
function isJSDocNonNullableType(node) {
- return node.kind === 287;
+ return node.kind === 292;
}
ts.isJSDocNonNullableType = isJSDocNonNullableType;
function isJSDocOptionalType(node) {
- return node.kind === 288;
+ return node.kind === 293;
}
ts.isJSDocOptionalType = isJSDocOptionalType;
function isJSDocFunctionType(node) {
- return node.kind === 289;
+ return node.kind === 294;
}
ts.isJSDocFunctionType = isJSDocFunctionType;
function isJSDocVariadicType(node) {
- return node.kind === 290;
+ return node.kind === 295;
}
ts.isJSDocVariadicType = isJSDocVariadicType;
function isJSDoc(node) {
- return node.kind === 291;
+ return node.kind === 296;
}
ts.isJSDoc = isJSDoc;
function isJSDocAugmentsTag(node) {
- return node.kind === 295;
+ return node.kind === 300;
}
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
function isJSDocClassTag(node) {
- return node.kind === 296;
+ return node.kind === 301;
}
ts.isJSDocClassTag = isJSDocClassTag;
function isJSDocEnumTag(node) {
- return node.kind === 298;
+ return node.kind === 303;
}
ts.isJSDocEnumTag = isJSDocEnumTag;
function isJSDocThisTag(node) {
- return node.kind === 301;
+ return node.kind === 306;
}
ts.isJSDocThisTag = isJSDocThisTag;
function isJSDocParameterTag(node) {
- return node.kind === 299;
+ return node.kind === 304;
}
ts.isJSDocParameterTag = isJSDocParameterTag;
function isJSDocReturnTag(node) {
- return node.kind === 300;
+ return node.kind === 305;
}
ts.isJSDocReturnTag = isJSDocReturnTag;
function isJSDocTypeTag(node) {
- return node.kind === 302;
+ return node.kind === 307;
}
ts.isJSDocTypeTag = isJSDocTypeTag;
function isJSDocTemplateTag(node) {
- return node.kind === 303;
+ return node.kind === 308;
}
ts.isJSDocTemplateTag = isJSDocTemplateTag;
function isJSDocTypedefTag(node) {
- return node.kind === 304;
+ return node.kind === 309;
}
ts.isJSDocTypedefTag = isJSDocTypedefTag;
function isJSDocPropertyTag(node) {
- return node.kind === 305;
+ return node.kind === 310;
}
ts.isJSDocPropertyTag = isJSDocPropertyTag;
function isJSDocPropertyLikeTag(node) {
- return node.kind === 305 || node.kind === 299;
+ return node.kind === 310 || node.kind === 304;
}
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
function isJSDocTypeLiteral(node) {
- return node.kind === 292;
+ return node.kind === 297;
}
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
function isJSDocCallbackTag(node) {
- return node.kind === 297;
+ return node.kind === 302;
}
ts.isJSDocCallbackTag = isJSDocCallbackTag;
function isJSDocSignature(node) {
- return node.kind === 293;
+ return node.kind === 298;
}
ts.isJSDocSignature = isJSDocSignature;
})(ts || (ts = {}));
(function (ts) {
function isSyntaxList(n) {
- return n.kind === 306;
+ return n.kind === 311;
}
ts.isSyntaxList = isSyntaxList;
function isNode(node) {
@@ -11146,11 +11345,11 @@
switch (kind) {
case 155:
case 160:
- case 293:
+ case 298:
case 161:
case 162:
case 165:
- case 289:
+ case 294:
case 166:
return true;
default:
@@ -11401,8 +11600,8 @@
case 208:
case 212:
case 210:
- case 309:
- case 308:
+ case 314:
+ case 313:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -11415,11 +11614,11 @@
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
- return node.kind === 308;
+ return node.kind === 313;
}
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
function isNotEmittedStatement(node) {
- return node.kind === 307;
+ return node.kind === 312;
}
ts.isNotEmittedStatement = isNotEmittedStatement;
function isNotEmittedOrPartiallyEmittedNode(node) {
@@ -11519,9 +11718,9 @@
|| kind === 242
|| kind === 150
|| kind === 237
- || kind === 304
- || kind === 297
- || kind === 305;
+ || kind === 309
+ || kind === 302
+ || kind === 310;
}
function isDeclarationStatementKind(kind) {
return kind === 239
@@ -11556,13 +11755,13 @@
|| kind === 219
|| kind === 224
|| kind === 231
- || kind === 307
- || kind === 311
- || kind === 310;
+ || kind === 312
+ || kind === 316
+ || kind === 315;
}
function isDeclaration(node) {
if (node.kind === 150) {
- return node.parent.kind !== 303 || ts.isInJSFile(node);
+ return (node.parent && node.parent.kind !== 308) || ts.isInJSFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -11640,15 +11839,15 @@
}
ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
function isJSDocNode(node) {
- return node.kind >= 283 && node.kind <= 305;
+ return node.kind >= 288 && node.kind <= 310;
}
ts.isJSDocNode = isJSDocNode;
function isJSDocCommentContainingNode(node) {
- return node.kind === 291 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+ return node.kind === 296 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
}
ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
function isJSDocTag(node) {
- return node.kind >= 294 && node.kind <= 305;
+ return node.kind >= 299 && node.kind <= 310;
}
ts.isJSDocTag = isJSDocTag;
function isSetAccessor(node) {
@@ -11950,6 +12149,10 @@
return !!(compilerOptions.declaration || compilerOptions.composite);
}
ts.getEmitDeclarations = getEmitDeclarations;
+ function isIncrementalCompilation(options) {
+ return !!(options.incremental || options.composite);
+ }
+ ts.isIncrementalCompilation = isIncrementalCompilation;
function getStrictOptionValue(compilerOptions, flag) {
return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
}
@@ -12492,7 +12695,7 @@
return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
}
ts.getRegexFromPattern = getRegexFromPattern;
- function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
+ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
path = ts.normalizePath(path);
currentDirectory = ts.normalizePath(currentDirectory);
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
@@ -12500,12 +12703,18 @@
var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];
+ var visited = ts.createMap();
+ var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
var basePath = _a[_i];
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
}
return ts.flatten(results);
function visitDirectory(path, absolutePath, depth) {
+ var canonicalPath = toCanonical(realpath(absolutePath));
+ if (visited.has(canonicalPath))
+ return;
+ visited.set(canonicalPath, true);
var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories;
var _loop_1 = function (current) {
var name = combinePaths(path, current);
@@ -12830,6 +13039,19 @@
return arr.slice(index);
}
ts.sliceAfter = sliceAfter;
+ function addRelatedInfo(diagnostic) {
+ var _a;
+ var relatedInformation = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ relatedInformation[_i - 1] = arguments[_i];
+ }
+ if (!diagnostic.relatedInformation) {
+ diagnostic.relatedInformation = [];
+ }
+ (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation);
+ return diagnostic;
+ }
+ ts.addRelatedInfo = addRelatedInfo;
function minAndMax(arr, getValue) {
Debug.assert(arr.length !== 0);
var min = getValue(arr[0]);
@@ -13003,7 +13225,7 @@
var IdentifierConstructor;
var SourceFileConstructor;
function createNode(kind, pos, end) {
- if (kind === 279) {
+ if (kind === 284) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
else if (kind === 72) {
@@ -13240,7 +13462,7 @@
case 218:
case 245:
return visitNodes(cbNode, cbNodes, node.statements);
- case 279:
+ case 284:
return visitNodes(cbNode, cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
case 219:
@@ -13389,7 +13611,7 @@
return visitNode(cbNode, node.expression);
case 258:
return visitNodes(cbNode, cbNodes, node.decorators);
- case 309:
+ case 314:
return visitNodes(cbNode, cbNodes, node.elements);
case 260:
return visitNode(cbNode, node.openingElement) ||
@@ -13418,60 +13640,60 @@
return visitNode(cbNode, node.tagName);
case 171:
case 172:
- case 283:
- case 287:
- case 286:
case 288:
- case 290:
+ case 292:
+ case 291:
+ case 293:
+ case 295:
return visitNode(cbNode, node.type);
- case 289:
+ case 294:
return visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 291:
+ case 296:
return visitNodes(cbNode, cbNodes, node.tags);
- case 299:
- case 305:
+ case 304:
+ case 310:
return visitNode(cbNode, node.tagName) ||
(node.isNameFirst
? visitNode(cbNode, node.name) ||
visitNode(cbNode, node.typeExpression)
: visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.name));
- case 295:
+ case 300:
return visitNode(cbNode, node.tagName) ||
visitNode(cbNode, node.class);
- case 303:
+ case 308:
return visitNode(cbNode, node.tagName) ||
visitNode(cbNode, node.constraint) ||
visitNodes(cbNode, cbNodes, node.typeParameters);
- case 304:
+ case 309:
return visitNode(cbNode, node.tagName) ||
(node.typeExpression &&
- node.typeExpression.kind === 283
+ node.typeExpression.kind === 288
? visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.fullName)
: visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression));
- case 297:
+ case 302:
return visitNode(cbNode, node.tagName) ||
visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
- case 300:
- case 302:
- case 301:
- case 298:
+ case 305:
+ case 307:
+ case 306:
+ case 303:
return visitNode(cbNode, node.tagName) ||
visitNode(cbNode, node.typeExpression);
- case 293:
+ case 298:
return ts.forEach(node.typeParameters, cbNode) ||
ts.forEach(node.parameters, cbNode) ||
visitNode(cbNode, node.type);
- case 292:
+ case 297:
return ts.forEach(node.jsDocPropertyTags, cbNode);
- case 294:
- case 296:
+ case 299:
+ case 301:
return visitNode(cbNode, node.tagName);
- case 308:
+ case 313:
return visitNode(cbNode, node.expression);
}
}
@@ -13524,7 +13746,7 @@
ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
var Parser;
(function (Parser) {
- var scanner = ts.createScanner(6, true);
+ var scanner = ts.createScanner(7, true);
var disallowInAndDecoratorContext = 2048 | 8192;
var NodeConstructor;
var TokenConstructor;
@@ -13722,7 +13944,7 @@
}
Parser.fixupParentReferences = fixupParentReferences;
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) {
- var sourceFile = new SourceFileConstructor(279, 0, sourceText.length);
+ var sourceFile = new SourceFileConstructor(284, 0, sourceText.length);
nodeCount++;
sourceFile.text = sourceText;
sourceFile.bindDiagnostics = [];
@@ -14669,9 +14891,9 @@
return finishNode(node);
}
function parseJSDocAllType(postFixEquals) {
- var result = createNode(284);
+ var result = createNode(289);
if (postFixEquals) {
- return createPostfixType(288, result);
+ return createPostfixType(293, result);
}
else {
nextToken();
@@ -14679,7 +14901,7 @@
return finishNode(result);
}
function parseJSDocNonNullableType() {
- var result = createNode(287);
+ var result = createNode(292);
nextToken();
result.type = parseNonArrayType();
return finishNode(result);
@@ -14693,18 +14915,18 @@
token() === 30 ||
token() === 59 ||
token() === 50) {
- var result = createNode(285, pos);
+ var result = createNode(290, pos);
return finishNode(result);
}
else {
- var result = createNode(286, pos);
+ var result = createNode(291, pos);
result.type = parseType();
return finishNode(result);
}
}
function parseJSDocFunctionType() {
if (lookAhead(nextTokenIsOpenParen)) {
- var result = createNodeWithJSDoc(289);
+ var result = createNodeWithJSDoc(294);
nextToken();
fillSignature(57, 4 | 32, result);
return finishNode(result);
@@ -14728,12 +14950,12 @@
var type = parseTypeOrTypePredicate();
scanner.setInJSDocType(false);
if (dotdotdot) {
- var variadic = createNode(290, dotdotdot.pos);
+ var variadic = createNode(295, dotdotdot.pos);
variadic.type = type;
type = finishNode(variadic);
}
if (token() === 59) {
- return createPostfixType(288, type);
+ return createPostfixType(293, type);
}
return type;
}
@@ -15027,7 +15249,7 @@
return finishNode(node);
}
var type = parseType();
- if (!(contextFlags & 2097152) && type.kind === 286 && type.pos === type.type.pos) {
+ if (!(contextFlags & 2097152) && type.kind === 291 && type.pos === type.type.pos) {
type.kind = 171;
}
return type;
@@ -15164,6 +15386,7 @@
case 135:
case 146:
case 123:
+ case 133:
case 139:
case 142:
case 106:
@@ -15210,13 +15433,13 @@
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case 52:
- type = createPostfixType(287, type);
+ type = createPostfixType(292, type);
break;
case 56:
if (!(contextFlags & 2097152) && lookAhead(nextTokenIsStartOfType)) {
return type;
}
- type = createPostfixType(286, type);
+ type = createPostfixType(291, type);
break;
case 22:
parseExpected(22);
@@ -15266,6 +15489,7 @@
switch (operator) {
case 129:
case 142:
+ case 133:
return parseTypeOperator(operator);
case 127:
return parseInferType();
@@ -15954,7 +16178,8 @@
}
function parseJsxText() {
var node = createNode(11);
- node.containsOnlyWhiteSpaces = currentToken === 12;
+ node.text = scanner.getTokenValue();
+ node.containsOnlyTriviaWhiteSpaces = currentToken === 12;
currentToken = scanner.scanJsxToken();
return finishNode(node);
}
@@ -17532,8 +17757,8 @@
var JSDocParser;
(function (JSDocParser) {
function parseJSDocTypeExpressionForTests(content, start, length) {
- initializeState(content, 6, undefined, 1);
- sourceFile = createSourceFile("file.js", 6, 1, false);
+ initializeState(content, 7, undefined, 1);
+ sourceFile = createSourceFile("file.js", 7, 1, false);
scanner.setText(content, start, length);
currentToken = scanner.scan();
var jsDocTypeExpression = parseJSDocTypeExpression();
@@ -17543,7 +17768,7 @@
}
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression(mayOmitBraces) {
- var result = createNode(283);
+ var result = createNode(288);
var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18);
result.type = doInsideOfContext(2097152, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
@@ -17554,7 +17779,7 @@
}
JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression;
function parseIsolatedJSDocComment(content, start, length) {
- initializeState(content, 6, undefined, 1);
+ initializeState(content, 7, undefined, 1);
sourceFile = { languageVariant: 0, text: content };
var jsDoc = parseJSDocCommentWorker(start, length);
var diagnostics = parseDiagnostics;
@@ -17680,7 +17905,7 @@
}
}
function createJSDocComment() {
- var result = createNode(291, start);
+ var result = createNode(296, start);
result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd);
result.comment = comments.length ? comments.join("") : undefined;
return finishNode(result, end);
@@ -17839,7 +18064,7 @@
return comments.length === 0 ? undefined : comments.join("");
}
function parseUnknownTag(start, tagName) {
- var result = createNode(294, start);
+ var result = createNode(299, start);
result.tagName = tagName;
return finishNode(result);
}
@@ -17895,8 +18120,8 @@
typeExpression = tryParseTypeExpression();
}
var result = target === 1 ?
- createNode(305, start) :
- createNode(299, start);
+ createNode(310, start) :
+ createNode(304, start);
var comment = parseTagComments(indent + scanner.getStartPos() - start);
var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target, indent);
if (nestedTypeLiteral) {
@@ -17913,18 +18138,18 @@
}
function parseNestedTypeLiteral(typeExpression, name, target, indent) {
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
- var typeLiteralExpression = createNode(283, scanner.getTokenPos());
+ var typeLiteralExpression = createNode(288, scanner.getTokenPos());
var child = void 0;
var jsdocTypeLiteral = void 0;
var start_2 = scanner.getStartPos();
var children = void 0;
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) {
- if (child.kind === 299 || child.kind === 305) {
+ if (child.kind === 304 || child.kind === 310) {
children = ts.append(children, child);
}
}
if (children) {
- jsdocTypeLiteral = createNode(292, start_2);
+ jsdocTypeLiteral = createNode(297, start_2);
jsdocTypeLiteral.jsDocPropertyTags = children;
if (typeExpression.type.kind === 169) {
jsdocTypeLiteral.isArrayType = true;
@@ -17935,25 +18160,25 @@
}
}
function parseReturnTag(start, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 300; })) {
+ if (ts.forEach(tags, function (t) { return t.kind === 305; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
- var result = createNode(300, start);
+ var result = createNode(305, start);
result.tagName = tagName;
result.typeExpression = tryParseTypeExpression();
return finishNode(result);
}
function parseTypeTag(start, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 302; })) {
+ if (ts.forEach(tags, function (t) { return t.kind === 307; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
- var result = createNode(302, start);
+ var result = createNode(307, start);
result.tagName = tagName;
result.typeExpression = parseJSDocTypeExpression(true);
return finishNode(result);
}
function parseAugmentsTag(start, tagName) {
- var result = createNode(295, start);
+ var result = createNode(300, start);
result.tagName = tagName;
result.class = parseExpressionWithTypeArgumentsForAugments();
return finishNode(result);
@@ -17980,19 +18205,19 @@
return node;
}
function parseClassTag(start, tagName) {
- var tag = createNode(296, start);
+ var tag = createNode(301, start);
tag.tagName = tagName;
return finishNode(tag);
}
function parseThisTag(start, tagName) {
- var tag = createNode(301, start);
+ var tag = createNode(306, start);
tag.tagName = tagName;
tag.typeExpression = parseJSDocTypeExpression(true);
skipWhitespace();
return finishNode(tag);
}
function parseEnumTag(start, tagName) {
- var tag = createNode(298, start);
+ var tag = createNode(303, start);
tag.tagName = tagName;
tag.typeExpression = parseJSDocTypeExpression(true);
skipWhitespace();
@@ -18001,7 +18226,7 @@
function parseTypedefTag(start, tagName, indent) {
var typeExpression = tryParseTypeExpression();
skipWhitespaceOrAsterisk();
- var typedefTag = createNode(304, start);
+ var typedefTag = createNode(309, start);
typedefTag.tagName = tagName;
typedefTag.fullName = parseJSDocTypeNameWithNamespace();
typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName);
@@ -18015,9 +18240,9 @@
var childTypeTag = void 0;
while (child = tryParse(function () { return parseChildPropertyTag(indent); })) {
if (!jsdocTypeLiteral) {
- jsdocTypeLiteral = createNode(292, start);
+ jsdocTypeLiteral = createNode(297, start);
}
- if (child.kind === 302) {
+ if (child.kind === 307) {
if (childTypeTag) {
break;
}
@@ -18062,14 +18287,14 @@
return typeNameOrNamespaceName;
}
function parseCallbackTag(start, tagName, indent) {
- var callbackTag = createNode(297, start);
+ var callbackTag = createNode(302, start);
callbackTag.tagName = tagName;
callbackTag.fullName = parseJSDocTypeNameWithNamespace();
callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName);
skipWhitespace();
callbackTag.comment = parseTagComments(indent);
var child;
- var jsdocSignature = createNode(293, start);
+ var jsdocSignature = createNode(298, start);
jsdocSignature.parameters = [];
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4, indent); })) {
jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child);
@@ -18077,7 +18302,7 @@
var returnTag = tryParse(function () {
if (parseOptionalJsdoc(58)) {
var tag = parseTag(indent);
- if (tag && tag.kind === 300) {
+ if (tag && tag.kind === 305) {
return tag;
}
}
@@ -18122,7 +18347,7 @@
case 58:
if (canParseTag) {
var child = tryParseChildTag(target, indent);
- if (child && (child.kind === 299 || child.kind === 305) &&
+ if (child && (child.kind === 304 || child.kind === 310) &&
target !== 4 &&
name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
@@ -18191,7 +18416,7 @@
skipWhitespace();
typeParameters.push(typeParameter);
} while (parseOptionalJsdoc(27));
- var result = createNode(303, start);
+ var result = createNode(308, start);
result.tagName = tagName;
result.constraint = constraint;
result.typeParameters = createNodeArray(typeParameters, typeParametersPos);
@@ -18755,6 +18980,7 @@
["es2016", "lib.es2016.d.ts"],
["es2017", "lib.es2017.d.ts"],
["es2018", "lib.es2018.d.ts"],
+ ["es2019", "lib.es2019.d.ts"],
["esnext", "lib.esnext.d.ts"],
["dom", "lib.dom.d.ts"],
["dom.iterable", "lib.dom.iterable.d.ts"],
@@ -18776,12 +19002,16 @@
["es2017.string", "lib.es2017.string.d.ts"],
["es2017.intl", "lib.es2017.intl.d.ts"],
["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"],
+ ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"],
["es2018.intl", "lib.es2018.intl.d.ts"],
["es2018.promise", "lib.es2018.promise.d.ts"],
["es2018.regexp", "lib.es2018.regexp.d.ts"],
- ["esnext.array", "lib.esnext.array.d.ts"],
- ["esnext.symbol", "lib.esnext.symbol.d.ts"],
- ["esnext.asynciterable", "lib.esnext.asynciterable.d.ts"],
+ ["es2019.array", "lib.es2019.array.d.ts"],
+ ["es2019.string", "lib.es2019.string.d.ts"],
+ ["es2019.symbol", "lib.es2019.symbol.d.ts"],
+ ["esnext.array", "lib.es2019.array.d.ts"],
+ ["esnext.symbol", "lib.es2019.symbol.d.ts"],
+ ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
["esnext.intl", "lib.esnext.intl.d.ts"],
["esnext.bigint", "lib.esnext.bigint.d.ts"]
];
@@ -18913,14 +19143,15 @@
es2016: 3,
es2017: 4,
es2018: 5,
- esnext: 6,
+ es2019: 6,
+ esnext: 7,
}),
affectsSourceFile: true,
affectsModuleResolution: true,
paramType: ts.Diagnostics.VERSION,
showInSimplifiedHelpView: true,
category: ts.Diagnostics.Basic_Options,
- description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT,
+ description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_or_ESNEXT,
},
{
name: "module",
@@ -19042,6 +19273,22 @@
description: ts.Diagnostics.Enable_project_compilation,
},
{
+ name: "incremental",
+ type: "boolean",
+ isTSConfigOnly: true,
+ category: ts.Diagnostics.Basic_Options,
+ description: ts.Diagnostics.Enable_incremental_compilation,
+ },
+ {
+ name: "tsBuildInfoFile",
+ type: "string",
+ isFilePath: true,
+ paramType: ts.Diagnostics.FILE,
+ isTSConfigOnly: true,
+ category: ts.Diagnostics.Basic_Options,
+ description: ts.Diagnostics.Specify_file_to_store_incremental_compilation_information,
+ },
+ {
name: "removeComments",
type: "boolean",
showInSimplifiedHelpView: true,
@@ -22224,7 +22471,7 @@
return "__constructor";
case 165:
case 160:
- case 293:
+ case 298:
return "__call";
case 166:
case 161:
@@ -22233,7 +22480,7 @@
return "__index";
case 255:
return "__export";
- case 279:
+ case 284:
return "export=";
case 204:
if (ts.getAssignmentDeclarationKind(node) === 2) {
@@ -22241,10 +22488,10 @@
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 289:
+ case 294:
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
case 151:
- ts.Debug.assert(node.parent.kind === 289, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ ts.Debug.assert(node.parent.kind === 294, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -22290,24 +22537,34 @@
message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations;
messageNeedsName_1 = false;
}
- if (symbol.declarations && symbol.declarations.length) {
+ var multipleDefaultExports_1 = false;
+ if (ts.length(symbol.declarations)) {
if (isDefaultExport) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName_1 = false;
+ multipleDefaultExports_1 = true;
}
else {
if (symbol.declarations && symbol.declarations.length &&
(node.kind === 254 && !node.isExportEquals)) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
messageNeedsName_1 = false;
+ multipleDefaultExports_1 = true;
}
}
}
- var addError = function (decl) {
- file.bindDiagnostics.push(createDiagnosticForNode(ts.getNameOfDeclaration(decl) || decl, message_1, messageNeedsName_1 ? getDisplayName(decl) : undefined));
- };
- ts.forEach(symbol.declarations, addError);
- addError(node);
+ var declarationName_1 = ts.getNameOfDeclaration(node) || node;
+ var relatedInformation_1 = [];
+ ts.forEach(symbol.declarations, function (declaration, index) {
+ var decl = ts.getNameOfDeclaration(declaration) || declaration;
+ var diag = createDiagnosticForNode(decl, message_1, messageNeedsName_1 ? getDisplayName(declaration) : undefined);
+ file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo(diag, createDiagnosticForNode(declarationName_1, index === 0 ? ts.Diagnostics.Another_export_default_is_here : ts.Diagnostics.and_here)) : diag);
+ if (multipleDefaultExports_1) {
+ relatedInformation_1.push(createDiagnosticForNode(decl, ts.Diagnostics.The_first_export_default_is_here));
+ }
+ });
+ var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : undefined);
+ file.bindDiagnostics.push(multipleDefaultExports_1 ? ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInformation_1)) : diag);
symbol = createSymbol(0, name);
}
}
@@ -22396,7 +22653,7 @@
if (hasExplicitReturn)
node.flags |= 256;
}
- if (node.kind === 279) {
+ if (node.kind === 284) {
node.flags |= emitFlags;
}
if (currentReturnTarget) {
@@ -22540,11 +22797,11 @@
case 191:
bindCallExpressionFlow(node);
break;
- case 304:
- case 297:
+ case 309:
+ case 302:
bindJSDocTypeAlias(node);
break;
- case 279: {
+ case 284: {
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
@@ -23184,7 +23441,7 @@
case 243:
case 188:
case 168:
- case 292:
+ case 297:
case 268:
return 1;
case 241:
@@ -23193,7 +23450,7 @@
case 242:
case 181:
return 1 | 32;
- case 279:
+ case 284:
return 1 | 4 | 32;
case 156:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
@@ -23205,8 +23462,8 @@
case 158:
case 159:
case 160:
- case 293:
- case 289:
+ case 298:
+ case 294:
case 165:
case 161:
case 162:
@@ -23240,7 +23497,7 @@
switch (container.kind) {
case 244:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 279:
+ case 284:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
case 209:
case 240:
@@ -23248,7 +23505,7 @@
case 243:
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
case 168:
- case 292:
+ case 297:
case 188:
case 241:
case 268:
@@ -23257,7 +23514,7 @@
case 166:
case 160:
case 161:
- case 293:
+ case 298:
case 162:
case 156:
case 155:
@@ -23267,9 +23524,9 @@
case 239:
case 196:
case 197:
- case 289:
- case 304:
- case 297:
+ case 294:
+ case 309:
+ case 302:
case 242:
case 181:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
@@ -23286,8 +23543,8 @@
: declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes);
}
function hasExportDeclarations(node) {
- var body = node.kind === 279 ? node : node.body;
- if (body && (body.kind === 279 || body.kind === 245)) {
+ var body = node.kind === 284 ? node : node.body;
+ if (body && (body.kind === 284 || body.kind === 245)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
if (stat.kind === 255 || stat.kind === 254) {
@@ -23397,7 +23654,7 @@
case 244:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 279:
+ case 284:
if (ts.isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -23514,7 +23771,7 @@
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
- if (blockScopeContainer.kind !== 279 &&
+ if (blockScopeContainer.kind !== 284 &&
blockScopeContainer.kind !== 244 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
@@ -23743,12 +24000,12 @@
case 159:
return bindPropertyOrMethodOrAccessor(node, 65536, 67187647);
case 165:
- case 289:
- case 293:
+ case 294:
+ case 298:
case 166:
return bindFunctionOrConstructorType(node);
case 168:
- case 292:
+ case 297:
case 181:
return bindAnonymousTypeWorker(node);
case 188:
@@ -23803,7 +24060,7 @@
return bindExportDeclaration(node);
case 254:
return bindExportAssignment(node);
- case 279:
+ case 284:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
case 218:
@@ -23812,21 +24069,21 @@
}
case 245:
return updateStrictModeStatementList(node.statements);
- case 299:
- if (node.parent.kind === 293) {
+ case 304:
+ if (node.parent.kind === 298) {
return bindParameter(node);
}
- if (node.parent.kind !== 292) {
+ if (node.parent.kind !== 297) {
break;
}
- case 305:
+ case 310:
var propTag = node;
- var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 288 ?
+ var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 293 ?
4 | 16777216 :
4;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0);
- case 304:
- case 297:
+ case 309:
+ case 302:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -23977,7 +24234,13 @@
var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members;
declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true);
break;
- case 279:
+ case 284:
+ if (thisContainer.commonJsModuleIndicator) {
+ declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 | 1048576, 0);
+ }
+ else {
+ declareSymbolAndAddToSymbolTable(node, 1, 67220414);
+ }
break;
default:
ts.Debug.fail(ts.Debug.showSyntaxKind(thisContainer));
@@ -23987,7 +24250,7 @@
if (node.expression.kind === 100) {
bindThisPropertyAssignment(node);
}
- else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 279) {
+ else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 284) {
if (ts.isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
}
@@ -24016,7 +24279,7 @@
}
function bindObjectDefinePropertyAssignment(node) {
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]);
- var isToplevel = node.parent.parent.kind === 279;
+ var isToplevel = node.parent.parent.kind === 284;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false);
bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false);
}
@@ -24072,8 +24335,8 @@
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) {
var namespaceSymbol = lookupSymbolForPropertyAccess(name);
var isToplevel = ts.isBinaryExpression(propertyAccess.parent)
- ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 279
- : propertyAccess.parent.parent.kind === 279;
+ ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 284
+ : propertyAccess.parent.parent.kind === 284;
namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty);
bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty);
}
@@ -24180,7 +24443,7 @@
}
}
function bindParameter(node) {
- if (node.kind === 299 && container.kind !== 293) {
+ if (node.kind === 304 && container.kind !== 298) {
return;
}
if (inStrictMode && !(node.flags & 4194304)) {
@@ -24411,53 +24674,50 @@
ts.computeTransformFlagsForNode = computeTransformFlagsForNode;
function computeCallExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
+ var callee = ts.skipOuterExpressions(node.expression);
var expression = node.expression;
if (node.typeArguments) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
- if (subtreeFlags & 131072
- || (expression.transformFlags & (33554432 | 67108864))) {
- transformFlags |= 192;
- if (expression.transformFlags & 67108864) {
- transformFlags |= 8192;
+ if (subtreeFlags & 4096 || ts.isSuperOrSuperProperty(callee)) {
+ transformFlags |= 128;
+ if (ts.isSuperProperty(callee)) {
+ transformFlags |= 2048;
}
}
if (expression.kind === 92) {
- transformFlags |= 16777216;
- if (subtreeFlags & 8192) {
- transformFlags |= 16384;
- }
+ transformFlags |= 524288;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637666625;
+ return transformFlags & ~536875008;
}
function computeNewExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
if (node.typeArguments) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
- if (subtreeFlags & 131072) {
- transformFlags |= 192;
+ if (subtreeFlags & 4096) {
+ transformFlags |= 128;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637666625;
+ return transformFlags & ~536875008;
}
function computeBinaryExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
if (operatorTokenKind === 59 && leftKind === 188) {
- transformFlags |= 8 | 192 | 3072;
+ transformFlags |= 16 | 128 | 512;
}
else if (operatorTokenKind === 59 && leftKind === 187) {
- transformFlags |= 192 | 3072;
+ transformFlags |= 128 | 512;
}
else if (operatorTokenKind === 41
|| operatorTokenKind === 63) {
- transformFlags |= 32;
+ transformFlags |= 64;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeParameter(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -24466,82 +24726,72 @@
var dotDotDotToken = node.dotDotDotToken;
if (node.questionToken
|| node.type
- || (subtreeFlags & 4096 && ts.some(node.decorators))
+ || (subtreeFlags & 1024 && ts.some(node.decorators))
|| ts.isThisIdentifier(name)) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
if (ts.hasModifier(node, 92)) {
- transformFlags |= 3 | 4096;
+ transformFlags |= 1 | 1024;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
- if (subtreeFlags & 2097152 || initializer || dotDotDotToken) {
- transformFlags |= 192 | 65536;
+ if (subtreeFlags & 65536 || initializer || dotDotDotToken) {
+ transformFlags |= 128;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeParenthesizedExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
var expression = node.expression;
var expressionKind = expression.kind;
- var expressionTransformFlags = expression.transformFlags;
if (expressionKind === 212
|| expressionKind === 194) {
- transformFlags |= 3;
- }
- if (expressionTransformFlags & 1024) {
- transformFlags |= 1024;
+ transformFlags |= 1;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~536872257;
+ return transformFlags & ~536870912;
}
function computeClassDeclaration(node, subtreeFlags) {
var transformFlags;
if (ts.hasModifier(node, 2)) {
- transformFlags = 3;
+ transformFlags = 1;
}
else {
- transformFlags = subtreeFlags | 192;
- if ((subtreeFlags & 4096)
+ transformFlags = subtreeFlags | 128;
+ if ((subtreeFlags & 1024)
|| node.typeParameters) {
- transformFlags |= 3;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ transformFlags |= 1;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~638121281;
+ return transformFlags & ~536888320;
}
function computeClassExpression(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
- if (subtreeFlags & 4096
+ var transformFlags = subtreeFlags | 128;
+ if (subtreeFlags & 1024
|| node.typeParameters) {
- transformFlags |= 3;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ transformFlags |= 1;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~638121281;
+ return transformFlags & ~536888320;
}
function computeHeritageClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
switch (node.token) {
case 86:
- transformFlags |= 192;
+ transformFlags |= 128;
break;
case 109:
- transformFlags |= 3;
+ transformFlags |= 1;
break;
default:
ts.Debug.fail("Unexpected token for heritage clause");
break;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeCatchClause(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -24549,52 +24799,52 @@
transformFlags |= 8;
}
else if (ts.isBindingPattern(node.variableDeclaration.name)) {
- transformFlags |= 192;
+ transformFlags |= 128;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637797697;
+ return transformFlags & ~536879104;
}
function computeExpressionWithTypeArguments(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 128;
if (node.typeArguments) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeConstructor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
if (ts.hasModifier(node, 2270)
|| !node.body) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653616449;
+ return transformFlags & ~537372672;
}
function computeMethod(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 128;
if (node.decorators
|| ts.hasModifier(node, 2270)
|| node.typeParameters
|| node.type
|| (node.name && ts.isComputedPropertyName(node.name))
|| !node.body) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
if (ts.hasModifier(node, 256)) {
- transformFlags |= node.asteriskToken ? 8 : 16;
+ transformFlags |= node.asteriskToken ? 16 : 32;
}
if (node.asteriskToken) {
- transformFlags |= 768;
+ transformFlags |= 256;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653616449;
+ return propagatePropertyNameFlags(node.name, transformFlags & ~537372672);
}
function computeAccessor(node, subtreeFlags) {
var transformFlags = subtreeFlags;
@@ -24603,198 +24853,182 @@
|| node.type
|| (node.name && ts.isComputedPropertyName(node.name))
|| !node.body) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653616449;
+ return propagatePropertyNameFlags(node.name, transformFlags & ~537372672);
}
function computePropertyDeclaration(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 3;
+ var transformFlags = subtreeFlags | 1;
if (node.initializer || ts.isComputedPropertyName(node.name)) {
- transformFlags |= 4096;
+ transformFlags |= 1024;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return propagatePropertyNameFlags(node.name, transformFlags & ~536872960);
}
function computeFunctionDeclaration(node, subtreeFlags) {
var transformFlags;
var modifierFlags = ts.getModifierFlags(node);
var body = node.body;
if (!body || (modifierFlags & 2)) {
- transformFlags = 3;
+ transformFlags = 1;
}
else {
- transformFlags = subtreeFlags | 8388608;
+ transformFlags = subtreeFlags | 262144;
if (modifierFlags & 2270
|| node.typeParameters
|| node.type) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
if (modifierFlags & 256) {
- transformFlags |= node.asteriskToken ? 8 : 16;
- }
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ transformFlags |= node.asteriskToken ? 16 : 32;
}
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
if (node.asteriskToken) {
- transformFlags |= 768;
+ transformFlags |= 256;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653620545;
+ return transformFlags & ~537373696;
}
function computeFunctionExpression(node, subtreeFlags) {
var transformFlags = subtreeFlags;
if (ts.hasModifier(node, 2270)
|| node.typeParameters
|| node.type) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
if (ts.hasModifier(node, 256)) {
- transformFlags |= node.asteriskToken ? 8 : 16;
+ transformFlags |= node.asteriskToken ? 16 : 32;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
- }
- if (subtreeFlags & 81920) {
- transformFlags |= 192;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
if (node.asteriskToken) {
- transformFlags |= 768;
+ transformFlags |= 256;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653620545;
+ return transformFlags & ~537373696;
}
function computeArrowFunction(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 192;
+ var transformFlags = subtreeFlags | 128;
if (ts.hasModifier(node, 2270)
|| node.typeParameters
|| node.type) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
if (ts.hasModifier(node, 256)) {
- transformFlags |= 16;
- }
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ transformFlags |= 32;
}
if (subtreeFlags & 8192) {
- transformFlags |= 16384;
+ transformFlags |= 16;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~653604161;
+ return transformFlags & ~537371648;
}
function computePropertyAccess(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (transformFlags & 33554432) {
- transformFlags ^= 33554432;
- transformFlags |= 67108864 | 16 | 8;
+ if (node.expression.kind === 98) {
+ transformFlags |= 32 | 16;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~570426689;
+ return transformFlags & ~536870912;
}
function computeElementAccess(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- var expression = node.expression;
- var expressionFlags = expression.transformFlags;
- if (expressionFlags & 33554432) {
- transformFlags &= ~33554432;
- transformFlags |= 67108864 | 16 | 8;
+ if (node.expression.kind === 98) {
+ transformFlags |= 32 | 16;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~570426689;
+ return transformFlags & ~536870912;
}
function computeVariableDeclaration(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- transformFlags |= 192 | 2097152;
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ transformFlags |= 128 | 65536;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
if (node.type) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeVariableStatement(node, subtreeFlags) {
var transformFlags;
var declarationListTransformFlags = node.declarationList.transformFlags;
if (ts.hasModifier(node, 2)) {
- transformFlags = 3;
+ transformFlags = 1;
}
else {
transformFlags = subtreeFlags;
- if (declarationListTransformFlags & 2097152) {
- transformFlags |= 192;
+ if (declarationListTransformFlags & 65536) {
+ transformFlags |= 128;
}
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeLabeledStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (subtreeFlags & 1048576
+ if (subtreeFlags & 32768
&& ts.isIterationStatement(node, true)) {
- transformFlags |= 192;
+ transformFlags |= 128;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeImportEquals(node, subtreeFlags) {
var transformFlags = subtreeFlags;
if (!ts.isExternalModuleImportEqualsDeclaration(node)) {
- transformFlags |= 3;
+ transformFlags |= 1;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeExpressionStatement(node, subtreeFlags) {
var transformFlags = subtreeFlags;
- if (node.expression.transformFlags & 1024) {
- transformFlags |= 192;
- }
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~637535553;
+ return transformFlags & ~536870912;
}
function computeModuleDeclaration(node, subtreeFlags) {
- var transformFlags = 3;
+ var transformFlags = 1;
var modifierFlags = ts.getModifierFlags(node);
if ((modifierFlags & 2) === 0) {
transformFlags |= subtreeFlags;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~647001409;
+ return transformFlags & ~537168896;
}
function computeVariableDeclarationList(node, subtreeFlags) {
- var transformFlags = subtreeFlags | 8388608;
- if (subtreeFlags & 2097152) {
- transformFlags |= 192;
+ var transformFlags = subtreeFlags | 262144;
+ if (subtreeFlags & 65536) {
+ transformFlags |= 128;
}
if (node.flags & 3) {
- transformFlags |= 192 | 1048576;
+ transformFlags |= 128 | 32768;
}
node.transformFlags = transformFlags | 536870912;
- return transformFlags & ~639894849;
+ return transformFlags & ~536944640;
}
function computeOther(node, kind, subtreeFlags) {
var transformFlags = subtreeFlags;
- var excludeFlags = 637535553;
+ var excludeFlags = 536870912;
switch (kind) {
case 121:
case 201:
- transformFlags |= 8 | 16;
+ transformFlags |= 16 | 32;
break;
case 194:
case 212:
- case 308:
- transformFlags |= 3;
- excludeFlags = 536872257;
+ case 313:
+ transformFlags |= 1;
+ excludeFlags = 536870912;
break;
case 115:
case 113:
@@ -24806,7 +25040,7 @@
case 278:
case 213:
case 133:
- transformFlags |= 3;
+ transformFlags |= 1;
break;
case 260:
case 261:
@@ -24820,7 +25054,7 @@
case 268:
case 269:
case 270:
- transformFlags |= 4;
+ transformFlags |= 2;
break;
case 14:
case 15:
@@ -24831,29 +25065,29 @@
case 276:
case 116:
case 214:
- transformFlags |= 192;
+ transformFlags |= 128;
break;
case 10:
if (node.hasExtendedUnicodeEscape) {
- transformFlags |= 192;
+ transformFlags |= 128;
}
break;
case 8:
if (node.numericLiteralFlags & 384) {
- transformFlags |= 192;
+ transformFlags |= 128;
}
break;
case 9:
- transformFlags |= 8;
+ transformFlags |= 4;
break;
case 227:
if (node.awaitModifier) {
- transformFlags |= 8;
+ transformFlags |= 16;
}
- transformFlags |= 192;
+ transformFlags |= 128;
break;
case 207:
- transformFlags |= 8 | 192 | 4194304;
+ transformFlags |= 16 | 128 | 131072;
break;
case 120:
case 135:
@@ -24893,120 +25127,110 @@
case 181:
case 182:
case 247:
- transformFlags = 3;
- excludeFlags = -3;
+ transformFlags = 1;
+ excludeFlags = -2;
break;
case 149:
- transformFlags |= 524288;
- if (subtreeFlags & 8192) {
- transformFlags |= 32768;
- }
+ transformFlags |= 16384;
break;
case 208:
- transformFlags |= 192 | 131072;
+ transformFlags |= 128 | 4096;
break;
case 277:
- transformFlags |= 8 | 262144;
+ transformFlags |= 16 | 8192;
break;
case 98:
- transformFlags |= 192 | 33554432;
- excludeFlags = 536872257;
+ transformFlags |= 128;
+ excludeFlags = 536870912;
break;
case 100:
- transformFlags |= 8192;
+ transformFlags |= 2048;
break;
case 184:
- transformFlags |= 192 | 2097152;
- if (subtreeFlags & 131072) {
- transformFlags |= 8 | 262144;
+ transformFlags |= 128 | 65536;
+ if (subtreeFlags & 4096) {
+ transformFlags |= 16 | 8192;
}
- excludeFlags = 637666625;
+ excludeFlags = 536875008;
break;
case 185:
- transformFlags |= 192 | 2097152;
- excludeFlags = 637666625;
+ transformFlags |= 128 | 65536;
+ excludeFlags = 536875008;
break;
case 186:
- transformFlags |= 192;
+ transformFlags |= 128;
if (node.dotDotDotToken) {
- transformFlags |= 131072;
+ transformFlags |= 4096;
}
break;
case 152:
- transformFlags |= 3 | 4096;
+ transformFlags |= 1 | 1024;
break;
case 188:
- excludeFlags = 638358849;
- if (subtreeFlags & 524288) {
- transformFlags |= 192;
- }
- if (subtreeFlags & 32768) {
- transformFlags |= 8192;
+ excludeFlags = 536896512;
+ if (subtreeFlags & 16384) {
+ transformFlags |= 128;
}
- if (subtreeFlags & 262144) {
- transformFlags |= 8;
+ if (subtreeFlags & 8192) {
+ transformFlags |= 16;
}
break;
case 187:
- case 192:
- excludeFlags = 637666625;
- if (subtreeFlags & 131072) {
- transformFlags |= 192;
- }
+ excludeFlags = 536875008;
break;
case 223:
case 224:
case 225:
case 226:
- if (subtreeFlags & 1048576) {
- transformFlags |= 192;
+ if (subtreeFlags & 32768) {
+ transformFlags |= 128;
}
break;
- case 279:
- if (subtreeFlags & 16384) {
- transformFlags |= 192;
- }
+ case 284:
break;
case 230:
- transformFlags |= 8388608 | 8;
+ transformFlags |= 262144 | 16;
break;
case 228:
case 229:
- transformFlags |= 8388608;
+ transformFlags |= 262144;
break;
}
node.transformFlags = transformFlags | 536870912;
return transformFlags & ~excludeFlags;
}
+ function propagatePropertyNameFlags(node, transformFlags) {
+ return transformFlags | (node.transformFlags & 2048);
+ }
function getTransformFlagsSubtreeExclusions(kind) {
if (kind >= 163 && kind <= 183) {
- return -3;
+ return -2;
}
switch (kind) {
case 191:
case 192:
case 187:
- return 637666625;
+ return 536875008;
case 244:
- return 647001409;
+ return 537168896;
case 151:
- return 637535553;
+ return 536870912;
case 197:
- return 653604161;
+ return 537371648;
case 196:
case 239:
- return 653620545;
+ return 537373696;
case 238:
- return 639894849;
+ return 536944640;
case 240:
case 209:
- return 638121281;
+ return 536888320;
case 157:
- return 653616449;
+ return 537372672;
case 156:
case 158:
case 159:
- return 653616449;
+ return 537372672;
case 120:
case 135:
case 146:
@@ -25024,25 +25248,25 @@
case 162:
case 241:
case 242:
- return -3;
+ return -2;
case 188:
- return 638358849;
+ return 536896512;
case 274:
- return 637797697;
+ return 536879104;
case 184:
case 185:
- return 637666625;
+ return 536875008;
case 194:
case 212:
- case 308:
+ case 313:
case 195:
case 98:
- return 536872257;
+ return 536870912;
case 189:
case 190:
- return 570426689;
+ return 536870912;
default:
- return 637535553;
+ return 536870912;
}
}
ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions;
@@ -25266,6 +25490,7 @@
var enumCount = 0;
var instantiationDepth = 0;
var constraintDepth = 0;
+ var currentNode;
var emptySymbols = ts.createSymbolTable();
var identityMapper = ts.identity;
var compilerOptions = host.getCompilerOptions();
@@ -25282,8 +25507,14 @@
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 32768;
var emitResolver = createResolver();
var nodeBuilder = createNodeBuilder();
+ var globals = ts.createSymbolTable();
var undefinedSymbol = createSymbol(4, "undefined");
undefinedSymbol.declarations = [];
+ var globalThisSymbol = createSymbol(1536, "globalThis", 8);
+ globalThisSymbol.exports = globals;
+ globalThisSymbol.valueDeclaration = ts.createNode(72);
+ globalThisSymbol.valueDeclaration.escapedText = "globalThis";
+ globals.set(globalThisSymbol.escapedName, globalThisSymbol);
var argumentsSymbol = createSymbol(4, "arguments");
var requireSymbol = createSymbol(4, "require");
var apparentArgumentCount;
@@ -25407,11 +25638,13 @@
isContextSensitive: isContextSensitive,
getFullyQualifiedName: getFullyQualifiedName,
getResolvedSignature: function (node, candidatesOutArray, agumentCount) {
- return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, false);
+ return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, 0);
},
getResolvedSignatureForSignatureHelp: function (node, candidatesOutArray, agumentCount) {
- return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, true);
+ return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, 16);
},
+ getExpandedParameters: getExpandedParameters,
+ hasEffectiveRestParameter: hasEffectiveRestParameter,
getConstantValue: function (nodeIn) {
var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
return node ? getConstantValue(node) : undefined;
@@ -25471,6 +25704,8 @@
getNeverType: function () { return neverType; },
isSymbolAccessible: isSymbolAccessible,
getObjectFlags: ts.getObjectFlags,
+ isArrayType: isArrayType,
+ isTupleType: isTupleType,
isArrayLikeType: isArrayLikeType,
isTypeInvalidDueToUnionDiscriminant: isTypeInvalidDueToUnionDiscriminant,
getAllPossiblePropertiesOfTypes: getAllPossiblePropertiesOfTypes,
@@ -25486,9 +25721,9 @@
getAccessibleSymbolChain: getAccessibleSymbolChain,
getTypePredicateOfSignature: getTypePredicateOfSignature,
resolveExternalModuleSymbol: resolveExternalModuleSymbol,
- tryGetThisTypeAt: function (node) {
+ tryGetThisTypeAt: function (node, includeGlobalThis) {
node = ts.getParseTreeNode(node);
- return node && tryGetThisTypeAt(node);
+ return node && tryGetThisTypeAt(node, includeGlobalThis);
},
getTypeArgumentConstraint: function (nodeIn) {
var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
@@ -25531,10 +25766,10 @@
},
getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,
};
- function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, isForSignatureHelp) {
+ function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
apparentArgumentCount = argumentCount;
- var res = node ? getResolvedSignature(node, candidatesOutArray, isForSignatureHelp) : undefined;
+ var res = node ? getResolvedSignature(node, candidatesOutArray, checkMode) : undefined;
apparentArgumentCount = undefined;
return res;
}
@@ -25543,6 +25778,7 @@
var intersectionTypes = ts.createMap();
var literalTypes = ts.createMap();
var indexedAccessTypes = ts.createMap();
+ var conditionalTypes = ts.createMap();
var evolvingArrayTypes = [];
var undefinedProperties = ts.createMap();
var unknownSymbol = createSymbol(4, "unknown");
@@ -25552,10 +25788,10 @@
var wildcardType = createIntrinsicType(1, "any");
var errorType = createIntrinsicType(1, "error");
var unknownType = createIntrinsicType(2, "unknown");
- var undefinedType = createIntrinsicType(32768, "undefined");
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 | 134217728, "undefined");
- var nullType = createIntrinsicType(65536, "null");
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 | 134217728, "null");
+ var undefinedType = createNullableType(32768, "undefined", 0);
+ var undefinedWideningType = strictNullChecks ? undefinedType : createNullableType(32768, "undefined", 131072);
+ var nullType = createNullableType(65536, "null", 0);
+ var nullWideningType = strictNullChecks ? nullType : createNullableType(65536, "null", 131072);
var stringType = createIntrinsicType(4, "string");
var numberType = createIntrinsicType(8, "number");
var bigintType = createIntrinsicType(64, "bigint");
@@ -25593,7 +25829,7 @@
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
emptyGenericType.instantiations = ts.createMap();
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- anyFunctionType.flags |= 536870912;
+ anyFunctionType.objectFlags |= 524288;
var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
@@ -25607,7 +25843,6 @@
var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, undefined, 0, false, false);
var enumNumberIndexInfo = createIndexInfo(stringType, true);
- var globals = ts.createSymbolTable();
var amalgamatedDuplicates;
var reverseMappedCache = ts.createMap();
var ambientModulesCache;
@@ -25762,18 +25997,6 @@
return diagnostic;
}
}
- function addRelatedInfo(diagnostic) {
- var relatedInformation = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- relatedInformation[_i - 1] = arguments[_i];
- }
- var _a;
- if (!diagnostic.relatedInformation) {
- diagnostic.relatedInformation = [];
- }
- (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation);
- return diagnostic;
- }
function error(location, message, arg0, arg1, arg2, arg3) {
var diagnostic = location
? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)
@@ -25945,7 +26168,7 @@
err.relatedInformation = err.relatedInformation || [];
if (ts.length(err.relatedInformation) >= 5)
continue;
- addRelatedInfo(err, !ts.length(err.relatedInformation) ? ts.createDiagnosticForNode(relatedNode, ts.Diagnostics._0_was_also_declared_here, symbolName) : ts.createDiagnosticForNode(relatedNode, ts.Diagnostics.and_here));
+ ts.addRelatedInfo(err, !ts.length(err.relatedInformation) ? ts.createDiagnosticForNode(relatedNode, ts.Diagnostics._0_was_also_declared_here, symbolName) : ts.createDiagnosticForNode(relatedNode, ts.Diagnostics.and_here));
}
}
function combineSymbolTables(first, second) {
@@ -26015,7 +26238,7 @@
return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 });
}
function isGlobalSourceFile(node) {
- return node.kind === 279 && !ts.isExternalOrCommonJsModule(node);
+ return node.kind === 284 && !ts.isExternalOrCommonJsModule(node);
}
function getSymbol(symbols, name, meaning) {
if (meaning) {
@@ -26145,7 +26368,7 @@
if (result = lookup(location.locals, name, meaning)) {
var useResult = true;
if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 67897832 && lastLocation.kind !== 291) {
+ if (meaning & result.flags & 67897832 && lastLocation.kind !== 296) {
useResult = result.flags & 262144
? lastLocation === location.type ||
lastLocation.kind === 151 ||
@@ -26178,13 +26401,13 @@
}
}
switch (location.kind) {
- case 279:
+ case 284:
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
case 244:
var moduleExports = getSymbolOfNode(location).exports;
- if (location.kind === 279 || ts.isAmbientModule(location)) {
+ if (location.kind === 284 || ts.isAmbientModule(location)) {
if (result = moduleExports.get("default")) {
var localSymbol = ts.getLocalSymbolForExportDefault(result);
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
@@ -26297,12 +26520,12 @@
if (location.parent && location.parent.kind === 151) {
location = location.parent;
}
- if (location.parent && ts.isClassElement(location.parent)) {
+ if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 240)) {
location = location.parent;
}
break;
- case 304:
- case 297:
+ case 309:
+ case 302:
location = ts.getJSDocHost(location);
break;
}
@@ -26317,7 +26540,7 @@
}
if (!result) {
if (lastLocation) {
- ts.Debug.assert(lastLocation.kind === 279);
+ ts.Debug.assert(lastLocation.kind === 284);
if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) {
return lastLocation.symbol;
}
@@ -26340,7 +26563,8 @@
!checkAndReportErrorForExtendingInterface(errorLocation) &&
!checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
!checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
- !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) {
+ !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
+ !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
var suggestion = void 0;
if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) {
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
@@ -26348,7 +26572,7 @@
var suggestionName = symbolToString(suggestion);
var diagnostic = error(errorLocation, suggestedNameNotFoundMessage, diagnosticName(nameArg), suggestionName);
if (suggestion.valueDeclaration) {
- addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
}
}
}
@@ -26482,6 +26706,16 @@
}
return false;
}
+ function checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning) {
+ if (meaning & (67897832 & ~1920)) {
+ var symbol = resolveSymbol(resolveName(errorLocation, name, ~67897832 & 67220415, undefined, undefined, false));
+ if (symbol && !(symbol.flags & 1920)) {
+ error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here, ts.unescapeLeadingUnderscores(name));
+ return true;
+ }
+ }
+ return false;
+ }
function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
if (meaning & (67220415 & ~1024)) {
if (name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never") {
@@ -26490,7 +26724,7 @@
}
var symbol = resolveSymbol(resolveName(errorLocation, name, 67897832 & ~67220415, undefined, undefined, false));
if (symbol && !(symbol.flags & 1024)) {
- var message = (name === "Promise" || name === "Symbol")
+ var message = isES2015OrLaterConstructorName(name)
? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later
: ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here;
error(errorLocation, message, ts.unescapeLeadingUnderscores(name));
@@ -26499,6 +26733,18 @@
}
return false;
}
+ function isES2015OrLaterConstructorName(n) {
+ switch (n) {
+ case "Promise":
+ case "Symbol":
+ case "Map":
+ case "WeakMap":
+ case "Set":
+ case "WeakSet":
+ return true;
+ }
+ return false;
+ }
function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {
if (meaning & (67220415 & ~1024 & ~67897832)) {
var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~67220415, undefined, undefined, false));
@@ -26540,7 +26786,7 @@
}
}
if (diagnosticMessage) {
- addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here, declarationName));
+ ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here, declarationName));
}
}
}
@@ -26687,7 +26933,7 @@
var suggestionName = symbolToString(suggestion);
var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
if (suggestion.valueDeclaration) {
- addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
}
}
else {
@@ -26972,21 +27218,13 @@
return undefined;
}
if (moduleNotFoundError) {
- if (ts.pathIsRelative(moduleReference)) {
- var sourceFile_1 = ts.getSourceFileOfNode(location);
- var redirects = sourceFile_1.redirectedReferences;
- if (redirects) {
- var normalizedTargetPath = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(sourceFile_1.fileName));
- for (var _i = 0, _a = [".ts", ".tsx"]; _i < _a.length; _i++) {
- var ext = _a[_i];
- var probePath = normalizedTargetPath + ext;
- if (redirects.indexOf(probePath) >= 0) {
- error(errorNode, ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, moduleReference, probePath);
+ if (resolvedModule) {
+ var redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName);
+ if (redirect) {
+ error(errorNode, ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
return undefined;
}
}
- }
- }
if (resolutionDiagnostic) {
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
}
@@ -27048,7 +27286,7 @@
function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias) {
var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol) {
- if (!(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 279)) {
+ if (!(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 284)) {
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015
? "allowSyntheticDefaultImports"
: "esModuleInterop";
@@ -27309,6 +27547,11 @@
type.intrinsicName = intrinsicName;
return type;
}
+ function createNullableType(kind, intrinsicName, objectFlags) {
+ var type = createIntrinsicType(kind, intrinsicName);
+ type.objectFlags = objectFlags;
+ return type;
+ }
function createBooleanType(trueFalseTypes) {
var type = getUnionType(trueFalseTypes);
type.flags |= 16;
@@ -27372,7 +27615,7 @@
}
}
switch (location.kind) {
- case 279:
+ case 284:
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
@@ -27560,10 +27803,10 @@
return node && getSymbolOfNode(node);
}
function hasExternalModuleSymbol(declaration) {
- return ts.isAmbientModule(declaration) || (declaration.kind === 279 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isAmbientModule(declaration) || (declaration.kind === 284 && ts.isExternalOrCommonJsModule(declaration));
}
function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
- return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 279 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 284 && ts.isExternalOrCommonJsModule(declaration));
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
var aliasesToMakeVisible;
@@ -27917,8 +28160,8 @@
context.inferTypeParameters = type.root.inferTypeParameters;
var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context);
context.inferTypeParameters = saveInferTypeParameters;
- var trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context);
- var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context);
+ var trueTypeNode = typeToTypeNodeHelper(type.trueType, context);
+ var falseTypeNode = typeToTypeNodeHelper(type.falseType, context);
context.approximateLength += 15;
return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
@@ -27996,7 +28239,7 @@
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 279 || declaration.parent.kind === 245;
+ return declaration.parent.kind === 284 || declaration.parent.kind === 245;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096) || (context.visitedTypes && context.visitedTypes.has(typeId))) &&
@@ -28035,13 +28278,14 @@
}
function typeReferenceToTypeNode(type) {
var typeArguments = type.typeArguments || ts.emptyArray;
- if (type.target === globalArrayType) {
+ if (type.target === globalArrayType || type.target === globalReadonlyArrayType) {
if (context.flags & 2) {
var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context);
- return ts.createTypeReferenceNode("Array", [typeArgumentNode]);
+ return ts.createTypeReferenceNode(type.target === globalArrayType ? "Array" : "ReadonlyArray", [typeArgumentNode]);
}
var elementType = typeToTypeNodeHelper(typeArguments[0], context);
- return ts.createArrayTypeNode(elementType);
+ var arrayType = ts.createArrayTypeNode(elementType);
+ return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(133, arrayType);
}
else if (type.target.objectFlags & 8) {
if (typeArguments.length > 0) {
@@ -28054,11 +28298,13 @@
ts.createRestTypeNode(ts.createArrayTypeNode(tupleConstituentNodes[i])) :
ts.createOptionalTypeNode(tupleConstituentNodes[i]);
}
- return ts.createTupleTypeNode(tupleConstituentNodes);
+ var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes);
+ return type.target.readonly ? ts.createTypeOperatorNode(133, tupleTypeNode) : tupleTypeNode;
}
}
if (context.encounteredError || (context.flags & 524288)) {
- return ts.createTupleTypeNode([]);
+ var tupleTypeNode = ts.createTupleTypeNode([]);
+ return type.target.readonly ? ts.createTypeOperatorNode(133, tupleTypeNode) : tupleTypeNode;
}
context.encounteredError = true;
return undefined;
@@ -28215,7 +28461,7 @@
context.approximateLength += (ts.symbolName(propertySymbol).length + 1);
context.enclosingDeclaration = saveEnclosingDeclaration;
var optionalToken = propertySymbol.flags & 16777216 ? ts.createToken(56) : undefined;
- if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length) {
+ if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
var signatures = getSignaturesOfType(propertyType, 0);
for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) {
var signature = signatures_1[_i];
@@ -28342,7 +28588,7 @@
var savedContextFlags = context.flags;
context.flags &= ~512;
var shouldUseGeneratedName = context.flags & 4 &&
- type.symbol.declarations[0] &&
+ type.symbol.declarations && type.symbol.declarations[0] &&
ts.isTypeParameterDeclaration(type.symbol.declarations[0]) &&
typeParameterShadowsNameInScope(type, context);
var name = shouldUseGeneratedName
@@ -28361,7 +28607,7 @@
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) {
var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 151);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 299);
+ parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 304);
}
var parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
@@ -28503,7 +28749,7 @@
return top;
}
function getSpecifierForModuleSymbol(symbol, context) {
- var file = ts.getDeclarationOfKind(symbol, 279);
+ var file = ts.getDeclarationOfKind(symbol, 284);
if (file && file.moduleName !== undefined) {
return file.moduleName;
}
@@ -28746,7 +28992,7 @@
ts.isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 279 || ts.isAmbientModule(location);
+ return location.kind === 284 || ts.isAmbientModule(location);
}
function getNameOfSymbolFromNameType(symbol, context) {
var nameType = symbol.nameType;
@@ -28812,8 +29058,8 @@
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 297:
- case 304:
+ case 302:
+ case 309:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
case 186:
return isDeclarationVisible(node.parent.parent);
@@ -28834,7 +29080,7 @@
}
var parent = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 248 && parent.kind !== 279 && parent.flags & 4194304)) {
+ !(node.kind !== 248 && parent.kind !== 284 && parent.flags & 4194304)) {
return isGlobalSourceFile(parent);
}
return isDeclarationVisible(parent);
@@ -28868,7 +29114,7 @@
case 253:
return false;
case 150:
- case 279:
+ case 284:
case 247:
return true;
case 254:
@@ -29024,7 +29270,7 @@
if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576), omitKeyType)
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
&& isSpreadableProperty(prop)) {
- members.set(prop.escapedName, getSpreadSymbol(prop));
+ members.set(prop.escapedName, getSpreadSymbol(prop, false));
}
}
var stringIndexInfo = getIndexInfoOfType(source, 0);
@@ -29083,13 +29329,7 @@
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
var parentType = getTypeForBindingElementParent(pattern.parent);
- if (parentType === errorType) {
- return errorType;
- }
- if (!parentType) {
- return declaration.initializer ? checkDeclarationInitializer(declaration) : parentType;
- }
- if (isTypeAny(parentType)) {
+ if (!parentType || isTypeAny(parentType)) {
return parentType;
}
if (strictNullChecks && declaration.flags & 4194304 && ts.isParameterDeclaration(declaration)) {
@@ -29161,6 +29401,11 @@
if (optional === void 0) { optional = true; }
return strictNullChecks && optional ? getOptionalType(type) : type;
}
+ function isParameterOfContextuallyTypedFunction(node) {
+ return node.kind === 151 &&
+ (node.parent.kind === 196 || node.parent.kind === 197) &&
+ !!getContextualType(node.parent);
+ }
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 226) {
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
@@ -29220,14 +29465,14 @@
return containerObjectType;
}
}
- if (declaration.initializer) {
+ if (declaration.initializer && !isParameterOfContextuallyTypedFunction(declaration)) {
var type = checkDeclarationInitializer(declaration);
return addOptionality(type, isOptional);
}
if (ts.isJsxAttribute(declaration)) {
return trueType;
}
- if (ts.isBindingPattern(declaration.name)) {
+ if (ts.isBindingPattern(declaration.name) && !isParameterOfContextuallyTypedFunction(declaration)) {
return getTypeFromBindingPattern(declaration.name, false, true);
}
return undefined;
@@ -29280,7 +29525,7 @@
definedInConstructor = true;
}
}
- var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(98304 | 134217728)); }) ? constructorTypes : types;
+ var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~98304); }) ? constructorTypes : types;
type = getUnionType(sourceTypes, 2);
}
var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));
@@ -29423,7 +29668,7 @@
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) {
var members = ts.createSymbolTable();
var stringIndexInfo;
- var objectFlags = 128;
+ var objectFlags = 128 | 262144;
ts.forEach(pattern.elements, function (e) {
var name = e.propertyName || e.name;
if (e.dotDotDotToken) {
@@ -29443,7 +29688,6 @@
members.set(symbol.escapedName, symbol);
});
var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
- result.flags |= 268435456;
result.objectFlags |= objectFlags;
if (includePatternInType) {
result.pattern = pattern;
@@ -29507,7 +29751,13 @@
}
function getTypeOfVariableOrParameterOrProperty(symbol) {
var links = getSymbolLinks(symbol);
- return links.type || (links.type = getTypeOfVariableOrParameterOrPropertyWorker(symbol));
+ if (!links.type) {
+ var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
+ if (!links.type) {
+ links.type = type;
+ }
+ }
+ return links.type;
}
function getTypeOfVariableOrParameterOrPropertyWorker(symbol) {
if (symbol.flags & 4194304) {
@@ -29536,17 +29786,17 @@
}
return type_1;
}
- if (declaration.kind === 254) {
- return widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration);
- }
if (!pushTypeResolution(symbol, 0)) {
if (symbol.flags & 512) {
return getTypeOfFuncClassEnumModule(symbol);
}
- return errorType;
+ return reportCircularityError(symbol);
}
var type;
- if (ts.isInJSFile(declaration) &&
+ if (declaration.kind === 254) {
+ type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration);
+ }
+ else if (ts.isInJSFile(declaration) &&
(ts.isCallExpression(declaration) || ts.isBinaryExpression(declaration) || ts.isPropertyAccessExpression(declaration) && ts.isBinaryExpression(declaration.parent))) {
type = getWidenedTypeFromAssignmentDeclaration(symbol);
}
@@ -29597,7 +29847,7 @@
if (symbol.flags & 512) {
return getTypeOfFuncClassEnumModule(symbol);
}
- type = reportCircularityError(symbol);
+ return reportCircularityError(symbol);
}
return type;
}
@@ -29765,11 +30015,12 @@
return links.type;
}
function reportCircularityError(symbol) {
- if (ts.getEffectiveTypeAnnotationNode(symbol.valueDeclaration)) {
+ var declaration = symbol.valueDeclaration;
+ if (ts.getEffectiveTypeAnnotationNode(declaration)) {
error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
return errorType;
}
- if (noImplicitAny) {
+ if (noImplicitAny && (declaration.kind !== 151 || declaration.initializer)) {
error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));
}
return anyType;
@@ -29842,15 +30093,15 @@
case 155:
case 165:
case 166:
- case 289:
+ case 294:
case 239:
case 156:
case 196:
case 197:
case 242:
- case 303:
- case 304:
- case 297:
+ case 308:
+ case 309:
+ case 302:
case 181:
case 175:
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
@@ -29954,7 +30205,7 @@
ctorReturn = getReturnTypeOfSignature(ctorSig[0]);
}
}
- addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString(baseConstructorType.symbol), typeToString(ctorReturn)));
}
return type.resolvedBaseConstructorType = errorType;
}
@@ -29965,7 +30216,7 @@
function getBaseTypes(type) {
if (!type.resolvedBaseTypes) {
if (type.objectFlags & 8) {
- type.resolvedBaseTypes = [createArrayType(getUnionType(type.typeParameters || ts.emptyArray))];
+ type.resolvedBaseTypes = [createArrayType(getUnionType(type.typeParameters || ts.emptyArray), type.readonly)];
}
else if (type.symbol.flags & (32 | 64)) {
if (type.symbol.flags & 32) {
@@ -30320,6 +30571,8 @@
case 156:
case 155:
case 157:
+ case 158:
+ case 159:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -30568,7 +30821,17 @@
return sig;
}
function cloneSignature(sig) {
- return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, undefined, undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes);
+ var result = createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, undefined, undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes);
+ result.target = sig.target;
+ result.mapper = sig.mapper;
+ return result;
+ }
+ function createUnionSignature(signature, unionSignatures) {
+ var result = cloneSignature(signature);
+ result.unionSignatures = unionSignatures;
+ result.target = undefined;
+ result.mapper = undefined;
+ return result;
}
function getExpandedParameters(sig) {
if (sig.hasRestParameter) {
@@ -30667,9 +30930,8 @@
var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2);
thisParameter = createSymbolWithType(signature.thisParameter, thisType);
}
- s = cloneSignature(signature);
+ s = createUnionSignature(signature, unionSignatures);
s.thisParameter = thisParameter;
- s.unionSignatures = unionSignatures;
}
(result || (result = [])).push(s);
}
@@ -30773,13 +31035,22 @@
function unionSpreadIndexInfos(info1, info2) {
return info1 && info2 && createIndexInfo(getUnionType([info1.type, info2.type]), info1.isReadonly || info2.isReadonly);
}
- function includeMixinType(type, types, index) {
+ function findMixins(types) {
+ var constructorTypeCount = ts.countWhere(types, function (t) { return getSignaturesOfType(t, 1).length > 0; });
+ var mixinFlags = ts.map(types, isMixinConstructorType);
+ if (constructorTypeCount > 0 && constructorTypeCount === ts.countWhere(mixinFlags, function (b) { return b; })) {
+ var firstMixinIndex = mixinFlags.indexOf(true);
+ mixinFlags[firstMixinIndex] = false;
+ }
+ return mixinFlags;
+ }
+ function includeMixinType(type, types, mixinFlags, index) {
var mixedTypes = [];
for (var i = 0; i < types.length; i++) {
if (i === index) {
mixedTypes.push(type);
}
- else if (isMixinConstructorType(types[i])) {
+ else if (mixinFlags[i]) {
mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType(types[i], 1)[0]));
}
}
@@ -30791,15 +31062,16 @@
var stringIndexInfo;
var numberIndexInfo;
var types = type.types;
- var mixinCount = ts.countWhere(types, isMixinConstructorType);
+ var mixinFlags = findMixins(types);
+ var mixinCount = ts.countWhere(mixinFlags, function (b) { return b; });
var _loop_6 = function (i) {
var t = type.types[i];
- if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(t)) {
+ if (!mixinFlags[i]) {
var signatures = getSignaturesOfType(t, 1);
if (signatures.length && mixinCount > 0) {
signatures = ts.map(signatures, function (s) {
var clone = cloneSignature(s);
- clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, i);
+ clone.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s), types, mixinFlags, i);
return clone;
});
}
@@ -30839,6 +31111,15 @@
var stringIndexInfo = void 0;
if (symbol.exports) {
members = getExportsOfSymbol(symbol);
+ if (symbol === globalThisSymbol) {
+ var varsOnly_1 = ts.createMap();
+ members.forEach(function (p) {
+ if (!(p.flags & 418)) {
+ varsOnly_1.set(p.escapedName, p);
+ }
+ });
+ members = varsOnly_1;
+ }
}
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined);
if (symbol.flags & 32) {
@@ -31105,7 +31386,7 @@
var nameType = property.name && getLiteralTypeFromPropertyName(property.name);
var name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined;
var expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name);
- return !!expected && isLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected);
+ return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property), expected);
});
}
function getAllPossiblePropertiesOfTypes(types) {
@@ -31137,6 +31418,9 @@
return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined;
}
function getConstraintOfIndexedAccess(type) {
+ return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : undefined;
+ }
+ function getConstraintFromIndexedAccess(type) {
var objectType = getConstraintOfType(type.objectType) || type.objectType;
if (objectType !== type.objectType) {
var constraint = getIndexedAccessType(objectType, type.indexType, undefined, errorType);
@@ -31149,18 +31433,14 @@
}
function getDefaultConstraintOfConditionalType(type) {
if (!type.resolvedDefaultConstraint) {
- var rootTrueType = type.root.trueType;
- var rootTrueConstraint = !(rootTrueType.flags & 33554432)
- ? rootTrueType
- : (rootTrueType.substitute).flags & 3
- ? rootTrueType.typeVariable
- : getIntersectionType([rootTrueType.substitute, rootTrueType.typeVariable]);
- type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
+ var trueConstraint = getInferredTrueTypeFromConditionalType(type);
+ var falseConstraint = type.falseType;
+ type.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
- if (type.root.isDistributive) {
+ if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
var simplified = getSimplifiedType(type.checkType);
var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
if (constraint && constraint !== type.checkType) {
@@ -31173,9 +31453,12 @@
}
return undefined;
}
- function getConstraintOfConditionalType(type) {
+ function getConstraintFromConditionalType(type) {
return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type);
}
+ function getConstraintOfConditionalType(type) {
+ return hasNonCircularBaseConstraint(type) ? getConstraintFromConditionalType(type) : undefined;
+ }
function getUnionConstraintOfIntersection(type, targetIsUnion) {
var constraints;
var hasDisjointDomainType = false;
@@ -31232,14 +31515,27 @@
if (!pushTypeResolution(t, 4)) {
return circularConstraintType;
}
- if (constraintDepth === 50) {
+ if (constraintDepth >= 50) {
+ error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
nonTerminating = true;
return t.immediateBaseConstraint = noConstraintType;
}
constraintDepth++;
var result = computeBaseConstraint(getSimplifiedType(t));
constraintDepth--;
- if (!popTypeResolution() || nonTerminating) {
+ if (!popTypeResolution()) {
+ if (t.flags & 262144) {
+ var errorNode = getConstraintDeclaration(t);
+ if (errorNode) {
+ var diagnostic = error(errorNode, ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t));
+ if (currentNode && !ts.isNodeDescendantOf(errorNode, currentNode) && !ts.isNodeDescendantOf(currentNode, errorNode)) {
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(currentNode, ts.Diagnostics.Circularity_originates_in_type_at_this_location));
+ }
+ }
+ }
+ result = circularConstraintType;
+ }
+ if (nonTerminating) {
result = circularConstraintType;
}
t.immediateBaseConstraint = result || noConstraintType;
@@ -31281,8 +31577,11 @@
return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined;
}
if (t.flags & 16777216) {
- var constraint = getConstraintOfConditionalType(t);
- return constraint && getBaseConstraint(constraint);
+ var constraint = getConstraintFromConditionalType(t);
+ constraintDepth++;
+ var result = constraint && getBaseConstraint(constraint);
+ constraintDepth--;
+ return result;
}
if (t.flags & 33554432) {
return getBaseConstraint(t.substitute);
@@ -31330,7 +31629,7 @@
var typeVariable = getHomomorphicTypeVariable(type);
if (typeVariable) {
var constraint = getConstraintOfTypeParameter(typeVariable);
- if (constraint && (isArrayType(constraint) || isReadonlyArrayType(constraint) || isTupleType(constraint))) {
+ if (constraint && (isArrayType(constraint) || isTupleType(constraint))) {
var mapper = makeUnaryTypeMapper(typeVariable, constraint);
return instantiateType(type, combineTypeMappers(mapper, type.mapper));
}
@@ -31343,7 +31642,7 @@
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
t.flags & 132 ? globalStringType :
t.flags & 296 ? globalNumberType :
- t.flags & 2112 ? getGlobalBigIntType(languageVersion >= 6) :
+ t.flags & 2112 ? getGlobalBigIntType(languageVersion >= 7) :
t.flags & 528 ? globalBooleanType :
t.flags & 12288 ? getGlobalESSymbolType(languageVersion >= 2) :
t.flags & 67108864 ? emptyObjectType :
@@ -31351,7 +31650,7 @@
t;
}
function createUnionOrIntersectionProperty(containingType, name) {
- var props;
+ var propSet = ts.createMap();
var indexTypes;
var isUnion = containingType.flags & 1048576;
var excludeModifiers = isUnion ? 24 : 0;
@@ -31366,7 +31665,10 @@
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
if (prop && !(modifiers & excludeModifiers)) {
commonFlags &= prop.flags;
- props = ts.appendIfUnique(props, prop);
+ var id = "" + getSymbolId(prop);
+ if (!propSet.has(id)) {
+ propSet.set(id, prop);
+ }
checkFlags |= (isReadonlySymbol(prop) ? 8 : 0) |
(!(modifiers & 24) ? 128 : 0) |
(modifiers & 16 ? 256 : 0) |
@@ -31388,9 +31690,10 @@
}
}
}
- if (!props) {
+ if (!propSet.size) {
return undefined;
}
+ var props = ts.arrayFrom(propSet.values());
if (props.length === 1 && !(checkFlags & 16) && !indexTypes) {
return props[0];
}
@@ -31535,10 +31838,10 @@
return result;
}
function isJSDocOptionalParameter(node) {
- return ts.isInJSFile(node) && (node.type && node.type.kind === 288
+ return ts.isInJSFile(node) && (node.type && node.type.kind === 293
|| ts.getJSDocParameterTags(node).some(function (_a) {
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 288;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 293;
}));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
@@ -31571,7 +31874,7 @@
return false;
}
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 288;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 293;
}
function createIdentifierTypePredicate(parameterName, parameterIndex, type) {
return { kind: 1, parameterName: parameterName, parameterIndex: parameterIndex, type: type };
@@ -31783,32 +32086,23 @@
}
}
signature.resolvedTypePredicate = type && ts.isTypePredicateNode(type) ?
- createTypePredicateFromTypePredicateNode(type, signature.declaration) :
+ createTypePredicateFromTypePredicateNode(type, signature) :
jsdocPredicate || noTypePredicate;
}
ts.Debug.assert(!!signature.resolvedTypePredicate);
}
return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate;
}
- function createTypePredicateFromTypePredicateNode(node, func) {
+ function createTypePredicateFromTypePredicateNode(node, signature) {
var parameterName = node.parameterName;
var type = getTypeFromTypeNode(node.type);
if (parameterName.kind === 72) {
- return createIdentifierTypePredicate(parameterName.escapedText, getTypePredicateParameterIndex(func.parameters, parameterName), type);
+ return createIdentifierTypePredicate(parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type);
}
else {
return createThisTypePredicate(type);
}
}
- function getTypePredicateParameterIndex(parameterList, parameter) {
- for (var i = 0; i < parameterList.length; i++) {
- var param = parameterList[i];
- if (param.name.kind === 72 && param.name.escapedText === parameter.escapedText) {
- return i;
- }
- }
- return -1;
- }
function getReturnTypeOfSignature(signature) {
if (!signature.resolvedReturnType) {
if (!pushTypeResolution(signature, 3)) {
@@ -31880,8 +32174,19 @@
}
return undefined;
}
- function getSignatureInstantiation(signature, typeArguments, isJavascript) {
- return getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript));
+ function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) {
+ var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript));
+ if (inferredTypeParameters) {
+ var returnSignature = getSingleCallSignature(getReturnTypeOfSignature(instantiatedSignature));
+ if (returnSignature) {
+ var newReturnSignature = cloneSignature(returnSignature);
+ newReturnSignature.typeParameters = inferredTypeParameters;
+ var newInstantiatedSignature = cloneSignature(instantiatedSignature);
+ newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature);
+ return newInstantiatedSignature;
+ }
+ }
+ return instantiatedSignature;
}
function getSignatureInstantiationWithoutFillingInTypeArguments(signature, typeArguments) {
var instantiations = signature.instantiations || (signature.instantiations = ts.createMap());
@@ -32048,10 +32353,10 @@
for (var _i = 0, types_5 = types; _i < types_5.length; _i++) {
var type = types_5[_i];
if (!(type.flags & excludeKinds)) {
- result |= type.flags;
+ result |= ts.getObjectFlags(type);
}
}
- return result & 939524096;
+ return result & 917504;
}
function createTypeReference(target, typeArguments) {
var id = getTypeListId(typeArguments);
@@ -32059,7 +32364,7 @@
if (!type) {
type = createObjectType(4, target.symbol);
target.instantiations.set(id, type);
- type.flags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, 0) : 0;
+ type.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments, 0) : 0;
type.target = target;
type.typeArguments = typeArguments;
}
@@ -32198,7 +32503,7 @@
}
function getTypeReferenceTypeWorker(node, symbol, typeArguments) {
if (symbol.flags & (32 | 64)) {
- if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration.parent)) {
+ if (symbol.valueDeclaration && symbol.valueDeclaration.parent && ts.isBinaryExpression(symbol.valueDeclaration.parent)) {
var jsdocType = getJSDocTypeReference(node, symbol, typeArguments);
if (jsdocType) {
return jsdocType;
@@ -32219,6 +32524,9 @@
}
}
function getSubstitutionType(typeVariable, substitute) {
+ if (substitute.flags & 3) {
+ return typeVariable;
+ }
var result = createType(33554432);
result.typeVariable = typeVariable;
result.substitute = substitute;
@@ -32234,7 +32542,7 @@
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
- while (node && !ts.isStatement(node) && node.kind !== 291) {
+ while (node && !ts.isStatement(node) && node.kind !== 296) {
var parent = node.parent;
if (parent.kind === 175 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -32456,20 +32764,20 @@
function createIterableIteratorType(iteratedType) {
return createTypeFromGenericGlobalType(getGlobalIterableIteratorType(true), [iteratedType]);
}
- function createArrayType(elementType) {
- return createTypeFromGenericGlobalType(globalArrayType, [elementType]);
- }
- function createReadonlyArrayType(elementType) {
- return createTypeFromGenericGlobalType(globalReadonlyArrayType, [elementType]);
+ function createArrayType(elementType, readonly) {
+ return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]);
}
function getTypeFromArrayTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
- links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType));
+ links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType), isReadonlyTypeOperator(node.parent));
}
return links.resolvedType;
}
- function createTupleTypeOfArity(arity, minLength, hasRestElement, associatedNames) {
+ function isReadonlyTypeOperator(node) {
+ return ts.isTypeOperatorNode(node) && node.operator === 133;
+ }
+ function createTupleTypeOfArity(arity, minLength, hasRestElement, readonly, associatedNames) {
var typeParameters;
var properties = [];
var maxLength = hasRestElement ? arity - 1 : arity;
@@ -32478,7 +32786,7 @@
for (var i = 0; i < arity; i++) {
var typeParameter = typeParameters[i] = createTypeParameter();
if (i < maxLength) {
- var property = createSymbol(4 | (i >= minLength ? 16777216 : 0), "" + i);
+ var property = createSymbol(4 | (i >= minLength ? 16777216 : 0), "" + i, readonly ? 8 : 0);
property.type = typeParameter;
properties.push(property);
}
@@ -32508,25 +32816,27 @@
type.declaredNumberIndexInfo = undefined;
type.minLength = minLength;
type.hasRestElement = hasRestElement;
+ type.readonly = readonly;
type.associatedNames = associatedNames;
return type;
}
- function getTupleTypeOfArity(arity, minLength, hasRestElement, associatedNames) {
- var key = arity + (hasRestElement ? "+" : ",") + minLength + (associatedNames && associatedNames.length ? "," + associatedNames.join(",") : "");
+ function getTupleTypeOfArity(arity, minLength, hasRestElement, readonly, associatedNames) {
+ var key = arity + (hasRestElement ? "+" : ",") + minLength + (readonly ? "R" : "") + (associatedNames && associatedNames.length ? "," + associatedNames.join(",") : "");
var type = tupleTypes.get(key);
if (!type) {
- tupleTypes.set(key, type = createTupleTypeOfArity(arity, minLength, hasRestElement, associatedNames));
+ tupleTypes.set(key, type = createTupleTypeOfArity(arity, minLength, hasRestElement, readonly, associatedNames));
}
return type;
}
- function createTupleType(elementTypes, minLength, hasRestElement, associatedNames) {
+ function createTupleType(elementTypes, minLength, hasRestElement, readonly, associatedNames) {
if (minLength === void 0) { minLength = elementTypes.length; }
if (hasRestElement === void 0) { hasRestElement = false; }
+ if (readonly === void 0) { readonly = false; }
var arity = elementTypes.length;
if (arity === 1 && hasRestElement) {
- return createArrayType(elementTypes[0]);
+ return createArrayType(elementTypes[0], readonly);
}
- var tupleType = getTupleTypeOfArity(arity, minLength, arity > 0 && hasRestElement, associatedNames);
+ var tupleType = getTupleTypeOfArity(arity, minLength, arity > 0 && hasRestElement, readonly, associatedNames);
return elementTypes.length ? createTypeReference(tupleType, elementTypes) : tupleType;
}
function getTypeFromTupleTypeNode(node) {
@@ -32539,7 +32849,7 @@
var type = getTypeFromTypeNode(n);
return n === restElement_1 && getIndexTypeOfType(type, 1) || type;
});
- links.resolvedType = createTupleType(elementTypes, minLength, !!restElement_1);
+ links.resolvedType = createTupleType(elementTypes, minLength, !!restElement_1, isReadonlyTypeOperator(node.parent));
}
return links.resolvedType;
}
@@ -32548,7 +32858,7 @@
if (tuple.hasRestElement) {
index = Math.min(index, getTypeReferenceArity(type) - 1);
}
- return createTupleType((type.typeArguments || ts.emptyArray).slice(index), Math.max(0, tuple.minLength - index), tuple.hasRestElement, tuple.associatedNames && tuple.associatedNames.slice(index));
+ return createTupleType((type.typeArguments || ts.emptyArray).slice(index), Math.max(0, tuple.minLength - index), tuple.hasRestElement, tuple.readonly, tuple.associatedNames && tuple.associatedNames.slice(index));
}
function getTypeFromOptionalTypeNode(node) {
var type = getTypeFromTypeNode(node.type);
@@ -32594,12 +32904,14 @@
return addTypesToUnion(typeSet, includes, type.types);
}
if (!(flags & 131072 || flags & 2097152 && isEmptyIntersectionType(type))) {
- includes |= flags & ~939524096;
+ includes |= flags & 1835007;
+ if (flags & 66846720)
+ includes |= 262144;
if (type === wildcardType)
- includes |= 268435456;
+ includes |= 4194304;
if (!strictNullChecks && flags & 98304) {
- if (!(flags & 134217728))
- includes |= 134217728;
+ if (!(ts.getObjectFlags(type) & 131072))
+ includes |= 2097152;
}
else {
var len = typeSet.length;
@@ -32618,17 +32930,6 @@
}
return includes;
}
- function isSubtypeOfAny(source, targets) {
- for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) {
- var target = targets_1[_i];
- if (source !== target && isTypeSubtypeOf(source, target) && (!(ts.getObjectFlags(getTargetType(source)) & 1) ||
- !(ts.getObjectFlags(getTargetType(target)) & 1) ||
- isTypeDerivedFrom(source, target))) {
- return true;
- }
- }
- return false;
- }
function isSetOfLiteralsFromSameEnum(types) {
var first = types[0];
if (first.flags & 1024) {
@@ -32643,18 +32944,38 @@
}
return false;
}
- function removeSubtypes(types) {
- if (types.length === 0 || isSetOfLiteralsFromSameEnum(types)) {
- return;
+ function removeSubtypes(types, primitivesOnly) {
+ var len = types.length;
+ if (len === 0 || isSetOfLiteralsFromSameEnum(types)) {
+ return true;
}
- var i = types.length;
+ var i = len;
+ var count = 0;
while (i > 0) {
i--;
- if (isSubtypeOfAny(types[i], types)) {
+ var source = types[i];
+ for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
+ var target = types_7[_i];
+ if (source !== target) {
+ if (count === 100000) {
+ var estimatedCount = (count / (len - i)) * len;
+ if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) {
+ error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
+ return false;
+ }
+ }
+ count++;
+ if (isTypeSubtypeOf(source, target) && (!(ts.getObjectFlags(getTargetType(source)) & 1) ||
+ !(ts.getObjectFlags(getTargetType(target)) & 1) ||
+ isTypeDerivedFrom(source, target))) {
ts.orderedRemoveItemAt(types, i);
+ break;
}
}
}
+ }
+ return true;
+ }
function removeRedundantLiteralTypes(types, includes) {
var i = types.length;
while (i > 0) {
@@ -32682,25 +33003,27 @@
var includes = addTypesToUnion(typeSet, 0, types);
if (unionReduction !== 0) {
if (includes & 3) {
- return includes & 1 ? includes & 268435456 ? wildcardType : anyType : unknownType;
+ return includes & 1 ? includes & 4194304 ? wildcardType : anyType : unknownType;
}
switch (unionReduction) {
case 1:
- if (includes & 8576 | 512) {
+ if (includes & (2944 | 8192)) {
removeRedundantLiteralTypes(typeSet, includes);
}
break;
case 2:
- removeSubtypes(typeSet);
+ if (!removeSubtypes(typeSet, !(includes & 262144))) {
+ return errorType;
+ }
break;
}
if (typeSet.length === 0) {
- return includes & 65536 ? includes & 134217728 ? nullType : nullWideningType :
- includes & 32768 ? includes & 134217728 ? undefinedType : undefinedWideningType :
+ return includes & 65536 ? includes & 2097152 ? nullType : nullWideningType :
+ includes & 32768 ? includes & 2097152 ? undefinedType : undefinedWideningType :
neverType;
}
}
- return getUnionTypeFromSortedList(typeSet, !(includes & 66994211), aliasSymbol, aliasTypeArguments);
+ return getUnionTypeFromSortedList(typeSet, includes & 66994211 ? 0 : 65536, aliasSymbol, aliasTypeArguments);
}
function getUnionTypePredicate(signatures) {
var first;
@@ -32734,7 +33057,7 @@
? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex
: !ts.isIdentifierTypePredicate(b);
}
- function getUnionTypeFromSortedList(types, primitiveTypesOnly, aliasSymbol, aliasTypeArguments) {
+ function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments) {
if (types.length === 0) {
return neverType;
}
@@ -32744,11 +33067,10 @@
var id = getTypeListId(types);
var type = unionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(types, 98304);
- type = createType(1048576 | propagatedFlags);
+ type = createType(1048576);
unionTypes.set(id, type);
+ type.objectFlags = objectFlags | getPropagatingFlagsOfTypes(types, 98304);
type.types = types;
- type.primitiveTypesOnly = primitiveTypesOnly;
type.aliasSymbol = aliasSymbol;
type.aliasTypeArguments = aliasTypeArguments;
}
@@ -32768,16 +33090,16 @@
return addTypesToIntersection(typeSet, includes, type.types);
}
if (isEmptyAnonymousObjectType(type)) {
- if (!(includes & 536870912)) {
- includes |= 536870912;
+ if (!(includes & 8388608)) {
+ includes |= 8388608;
typeSet.push(type);
}
}
else {
- includes |= flags & ~939524096;
+ includes |= flags & 1835007;
if (flags & 3) {
if (type === wildcardType)
- includes |= 268435456;
+ includes |= 4194304;
}
else if ((strictNullChecks || !(flags & 98304)) && !ts.contains(typeSet, type)) {
typeSet.push(type);
@@ -32786,8 +33108,8 @@
return includes;
}
function addTypesToIntersection(typeSet, includes, types) {
- for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
- var type = types_7[_i];
+ for (var _i = 0, types_8 = types; _i < types_8.length; _i++) {
+ var type = types_8[_i];
includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type));
}
return includes;
@@ -32824,14 +33146,14 @@
}
function intersectUnionsOfPrimitiveTypes(types) {
var unionTypes;
- var index = ts.findIndex(types, function (t) { return !!(t.flags & 1048576) && t.primitiveTypesOnly; });
+ var index = ts.findIndex(types, function (t) { return !!(ts.getObjectFlags(t) & 65536); });
if (index < 0) {
return false;
}
var i = index + 1;
while (i < types.length) {
var t = types[i];
- if (t.flags & 1048576 && t.primitiveTypesOnly) {
+ if (ts.getObjectFlags(t) & 65536) {
(unionTypes || (unionTypes = [types[index]])).push(t);
ts.orderedRemoveItemAt(types, i);
}
@@ -32855,7 +33177,7 @@
}
}
}
- types[index] = getUnionTypeFromSortedList(result, true);
+ types[index] = getUnionTypeFromSortedList(result, 65536);
return true;
}
function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
@@ -32865,7 +33187,7 @@
return neverType;
}
if (includes & 1) {
- return includes & 268435456 ? wildcardType : anyType;
+ return includes & 4194304 ? wildcardType : anyType;
}
if (!strictNullChecks && includes & 98304) {
return includes & 32768 ? undefinedType : nullType;
@@ -32876,7 +33198,7 @@
includes & 4096 && includes & 8192) {
removeRedundantPrimitiveTypes(typeSet, includes);
}
- if (includes & 536870912 && includes & 524288) {
+ if (includes & 8388608 && includes & 524288) {
ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
}
if (typeSet.length === 0) {
@@ -32896,9 +33218,9 @@
var id = getTypeListId(typeSet);
var type = intersectionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 98304);
- type = createType(2097152 | propagatedFlags);
+ type = createType(2097152);
intersectionTypes.set(id, type);
+ type.objectFlags = getPropagatingFlagsOfTypes(typeSet, 98304);
type.types = typeSet;
type.aliasSymbol = aliasSymbol;
type.aliasTypeArguments = aliasTypeArguments;
@@ -32953,7 +33275,7 @@
return neverType;
}
function getLiteralTypeFromProperties(type, include) {
- return getUnionType(ts.map(getPropertiesOfType(type), function (t) { return getLiteralTypeFromProperty(t, include); }));
+ return getUnionType(ts.map(getPropertiesOfType(type), function (p) { return getLiteralTypeFromProperty(p, include); }));
}
function getNonEnumNumberIndexInfo(type) {
var numberIndexInfo = getIndexInfoOfType(type, 1);
@@ -32995,6 +33317,9 @@
? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))
: errorType;
break;
+ case 133:
+ links.resolvedType = getTypeFromTypeNode(node.type);
+ break;
}
}
return links.resolvedType;
@@ -33087,7 +33412,10 @@
return anyType;
}
if (accessExpression && !isConstEnumObjectType(objectType)) {
- if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
+ if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418)) {
+ error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
+ }
+ else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {
error(accessExpression, ts.Diagnostics.Property_0_is_a_static_member_of_type_1, propName, typeToString(objectType));
}
@@ -33139,7 +33467,7 @@
: accessNode;
}
function isGenericObjectType(type) {
- return maybeTypeOfKind(type, 58982400 | 134217728);
+ return maybeTypeOfKind(type, 58982400 | 131072);
}
function isGenericIndexType(type) {
return maybeTypeOfKind(type, 58982400 | 4194304);
@@ -33172,12 +33500,15 @@
}
}
if (isGenericMappedType(objectType)) {
- var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]);
- var templateMapper = combineTypeMappers(objectType.mapper, mapper);
- return type.simplified = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType);
+ return type.simplified = mapType(substituteIndexedMappedType(objectType, type.indexType), getSimplifiedType);
}
return type.simplified = type;
}
+ function substituteIndexedMappedType(objectType, index) {
+ var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
+ var templateMapper = combineTypeMappers(objectType.mapper, mapper);
+ return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
+ }
function getIndexedAccessType(objectType, indexType, accessNode, missingType) {
if (missingType === void 0) { missingType = accessNode ? errorType : unknownType; }
if (objectType === wildcardType || indexType === wildcardType) {
@@ -33246,36 +33577,70 @@
function getActualTypeVariable(type) {
return type.flags & 33554432 ? type.typeVariable : type;
}
+ function isIntersectionEmpty(type1, type2) {
+ return !!(getUnionType([intersectTypes(type1, type2), neverType]).flags & 131072);
+ }
function getConditionalType(root, mapper) {
var checkType = instantiateType(root.checkType, mapper);
var extendsType = instantiateType(root.extendsType, mapper);
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
- var checkTypeInstantiable = maybeTypeOfKind(checkType, 63176704 | 134217728);
+ var trueType = instantiateType(root.trueType, mapper);
+ var falseType = instantiateType(root.falseType, mapper);
+ var instantiationId = "" + (root.isDistributive ? "d" : "") + getTypeId(checkType) + ">" + getTypeId(extendsType) + "?" + getTypeId(trueType) + ":" + getTypeId(falseType);
+ var result = conditionalTypes.get(instantiationId);
+ if (result) {
+ return result;
+ }
+ var newResult = getConditionalTypeWorker(root, mapper, checkType, extendsType, trueType, falseType);
+ conditionalTypes.set(instantiationId, newResult);
+ return newResult;
+ }
+ function getConditionalTypeWorker(root, mapper, checkType, extendsType, trueType, falseType) {
+ if (falseType.flags & 131072 && isTypeIdenticalTo(getActualTypeVariable(trueType), getActualTypeVariable(checkType))) {
+ if (checkType.flags & 1 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) {
+ return trueType;
+ }
+ else if (isIntersectionEmpty(checkType, extendsType)) {
+ return neverType;
+ }
+ }
+ else if (trueType.flags & 131072 && isTypeIdenticalTo(getActualTypeVariable(falseType), getActualTypeVariable(checkType))) {
+ if (!(checkType.flags & 1) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) {
+ return neverType;
+ }
+ else if (checkType.flags & 1 || isIntersectionEmpty(checkType, extendsType)) {
+ return falseType;
+ }
+ }
+ var checkTypeInstantiable = maybeTypeOfKind(checkType, 63176704 | 131072);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
if (!checkTypeInstantiable) {
inferTypes(context.inferences, checkType, extendsType, 32 | 64);
}
- combinedMapper = combineTypeMappers(mapper, context);
+ combinedMapper = combineTypeMappers(mapper, context.mapper);
}
var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
- if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, 63176704 | 134217728)) {
+ if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, 63176704 | 131072)) {
if (inferredExtendsType.flags & 3) {
- return instantiateType(root.trueType, mapper);
+ return trueType;
}
if (checkType.flags & 1) {
- return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
+ return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), falseType]);
}
if (!isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType))) {
- return instantiateType(root.falseType, mapper);
+ return falseType;
}
if (isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
return instantiateType(root.trueType, combinedMapper || mapper);
}
}
+ return getDeferredConditionalType(root, mapper, combinedMapper, checkType, extendsType, trueType, falseType);
+ }
+ function getDeferredConditionalType(root, mapper, combinedMapper, checkType, extendsType, trueType, falseType) {
var erasedCheckType = getActualTypeVariable(checkType);
var result = createType(16777216);
result.root = root;
@@ -33283,15 +33648,14 @@
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
+ result.trueType = trueType;
+ result.falseType = falseType;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
}
- function getTrueTypeFromConditionalType(type) {
- return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper));
- }
- function getFalseTypeFromConditionalType(type) {
- return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper));
+ function getInferredTrueTypeFromConditionalType(type) {
+ return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = instantiateType(type.root.trueType, type.combinedMapper || type.mapper));
}
function getInferTypeParameters(node) {
var result;
@@ -33453,7 +33817,7 @@
function isNonGenericObjectType(type) {
return !!(type.flags & 524288) && !isGenericMappedType(type);
}
- function getSpreadType(left, right, symbol, typeFlags, objectFlags) {
+ function getSpreadType(left, right, symbol, objectFlags, readonly) {
if (left.flags & 1 || right.flags & 1) {
return anyType;
}
@@ -33467,10 +33831,10 @@
return left;
}
if (left.flags & 1048576) {
- return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); });
+ return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); });
}
if (right.flags & 1048576) {
- return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); });
+ return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); });
}
if (right.flags & (528 | 296 | 2112 | 132 | 1056 | 67108864 | 4194304)) {
return left;
@@ -33483,7 +33847,7 @@
var types = left.types;
var lastLeft = types[types.length - 1];
if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) {
- return getIntersectionType(ts.concatenate(types.slice(0, types.length - 1), [getSpreadType(lastLeft, right, symbol, typeFlags, objectFlags)]));
+ return getIntersectionType(ts.concatenate(types.slice(0, types.length - 1), [getSpreadType(lastLeft, right, symbol, objectFlags, readonly)]));
}
}
return getIntersectionType([left, right]);
@@ -33506,7 +33870,7 @@
skippedPrivateMembers.set(rightProp.escapedName, true);
}
else if (isSpreadableProperty(rightProp)) {
- members.set(rightProp.escapedName, getSpreadSymbol(rightProp));
+ members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly));
}
}
for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) {
@@ -33530,37 +33894,32 @@
}
}
else {
- members.set(leftProp.escapedName, getSpreadSymbol(leftProp));
+ members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly));
}
}
- var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo));
- spread.flags |= 268435456 | typeFlags;
- spread.objectFlags |= 128 | 1024 | objectFlags;
+ var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfoWithReadonly(stringIndexInfo, readonly), getIndexInfoWithReadonly(numberIndexInfo, readonly));
+ spread.objectFlags |= 128 | 262144 | 1024 | objectFlags;
return spread;
}
function isSpreadableProperty(prop) {
return !(prop.flags & (8192 | 32768 | 65536)) ||
!prop.declarations.some(function (decl) { return ts.isClassLike(decl.parent); });
}
- function getSpreadSymbol(prop) {
- var isReadonly = isReadonlySymbol(prop);
+ function getSpreadSymbol(prop, readonly) {
var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768);
- if (!isReadonly && !isSetonlyAccessor) {
+ if (!isSetonlyAccessor && readonly === isReadonlySymbol(prop)) {
return prop;
}
var flags = 4 | (prop.flags & 16777216);
- var result = createSymbol(flags, prop.escapedName);
+ var result = createSymbol(flags, prop.escapedName, readonly ? 8 : 0);
result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
result.declarations = prop.declarations;
result.nameType = prop.nameType;
result.syntheticOrigin = prop;
return result;
}
- function getNonReadonlyIndexSignature(index) {
- if (index && index.isReadonly) {
- return createIndexInfo(index.type, false, index.declaration);
- }
- return index;
+ function getIndexInfoWithReadonly(info, readonly) {
+ return info && info.isReadonly !== readonly ? createIndexInfo(info.type, readonly, info.declaration) : info;
}
function createLiteralType(flags, value, symbol) {
var type = createType(flags);
@@ -33644,8 +34003,8 @@
function getTypeFromTypeNode(node) {
switch (node.kind) {
case 120:
- case 284:
- case 285:
+ case 289:
+ case 290:
return anyType;
case 143:
return unknownType;
@@ -33692,23 +34051,23 @@
return getTypeFromUnionTypeNode(node);
case 174:
return getTypeFromIntersectionTypeNode(node);
- case 286:
+ case 291:
return getTypeFromJSDocNullableTypeNode(node);
- case 288:
+ case 293:
return addOptionality(getTypeFromTypeNode(node.type));
case 177:
case 172:
- case 287:
- case 283:
+ case 292:
+ case 288:
return getTypeFromTypeNode(node.type);
- case 290:
+ case 295:
return getTypeFromJSDocVariadicType(node);
case 165:
case 166:
case 168:
- case 292:
- case 289:
- case 293:
+ case 297:
+ case 294:
+ case 298:
return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
case 179:
return getTypeFromTypeOperatorNode(node);
@@ -33778,16 +34137,8 @@
function createTypeEraser(sources) {
return createTypeMapper(sources, undefined);
}
- function createBackreferenceMapper(typeParameters, index) {
- return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; };
- }
- function isInferenceContext(mapper) {
- return !!mapper.typeParameters;
- }
- function cloneTypeMapper(mapper) {
- return mapper && isInferenceContext(mapper) ?
- createInferenceContext(mapper.typeParameters, mapper.signature, mapper.flags | 1, mapper.compareTypes, mapper.inferences) :
- mapper;
+ function createBackreferenceMapper(context, index) {
+ return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? emptyObjectType : t; };
}
function combineTypeMappers(mapper1, mapper2) {
if (!mapper1)
@@ -33855,7 +34206,7 @@
symbol = links.target;
mapper = combineTypeMappers(links.mapper, mapper);
}
- var result = createSymbol(symbol.flags, symbol.escapedName, 1 | ts.getCheckFlags(symbol) & (2048 | 8192 | 16384));
+ var result = createSymbol(symbol.flags, symbol.escapedName, 1 | ts.getCheckFlags(symbol) & (8 | 2048 | 8192 | 16384));
result.declarations = symbol.declarations;
result.parent = symbol.parent;
result.target = symbol;
@@ -33941,7 +34292,7 @@
function getHomomorphicTypeVariable(type) {
var constraintType = getConstraintTypeFromMappedType(type);
if (constraintType.flags & 4194304) {
- var typeVariable = constraintType.type;
+ var typeVariable = getActualTypeVariable(constraintType.type);
if (typeVariable.flags & 262144) {
return typeVariable;
}
@@ -33953,26 +34304,27 @@
if (typeVariable) {
var mappedTypeVariable = instantiateType(typeVariable, mapper);
if (typeVariable !== mappedTypeVariable) {
- if (type.instantiating) {
- return errorType;
- }
- type.instantiating = true;
- var result = mapType(mappedTypeVariable, function (t) {
- if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType) {
+ return mapType(mappedTypeVariable, function (t) {
+ if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t !== errorType) {
var replacementMapper = createReplacementMapper(typeVariable, t, mapper);
- return isArrayType(t) ? createArrayType(instantiateMappedTypeTemplate(type, numberType, true, replacementMapper)) :
- isReadonlyArrayType(t) ? createReadonlyArrayType(instantiateMappedTypeTemplate(type, numberType, true, replacementMapper)) :
+ return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) :
isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) :
instantiateAnonymousType(type, replacementMapper);
}
return t;
});
- type.instantiating = false;
- return result;
}
}
return instantiateAnonymousType(type, mapper);
}
+ function getModifiedReadonlyState(state, modifiers) {
+ return modifiers & 1 ? true : modifiers & 2 ? false : state;
+ }
+ function instantiateMappedArrayType(arrayType, mappedType, mapper) {
+ var elementType = instantiateMappedTypeTemplate(mappedType, numberType, true, mapper);
+ return elementType === errorType ? errorType :
+ createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
+ }
function instantiateMappedTupleType(tupleType, mappedType, mapper) {
var minLength = tupleType.target.minLength;
var elementTypes = ts.map(tupleType.typeArguments || ts.emptyArray, function (_, i) {
@@ -33982,7 +34334,9 @@
var newMinLength = modifiers & 4 ? 0 :
modifiers & 8 ? getTypeReferenceArity(tupleType) - (tupleType.target.hasRestElement ? 1 : 0) :
minLength;
- return createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, tupleType.target.associatedNames);
+ var newReadonly = getModifiedReadonlyState(tupleType.target.readonly, modifiers);
+ return ts.contains(elementTypes, errorType) ? errorType :
+ createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, newReadonly, tupleType.target.associatedNames);
}
function instantiateMappedTypeTemplate(type, key, isOptional, mapper) {
var templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key]));
@@ -34038,6 +34392,7 @@
return type;
}
if (instantiationDepth === 50) {
+ error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
return errorType;
}
instantiationDepth++;
@@ -34086,7 +34441,17 @@
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper));
}
if (flags & 33554432) {
- return instantiateType(type.typeVariable, mapper);
+ var maybeVariable = instantiateType(type.typeVariable, mapper);
+ if (maybeVariable.flags & 8650752) {
+ return getSubstitutionType(maybeVariable, instantiateType(type.substitute, mapper));
+ }
+ else {
+ var sub = instantiateType(type.substitute, mapper);
+ if (sub.flags & 3 || isTypeSubtypeOf(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) {
+ return maybeVariable;
+ }
+ return sub;
+ }
}
return type;
}
@@ -34095,8 +34460,15 @@
type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
}
function getRestrictiveInstantiation(type) {
- return type.flags & (131068 | 3 | 131072) ? type :
- type.restrictiveInstantiation || (type.restrictiveInstantiation = instantiateType(type, restrictiveMapper));
+ if (type.flags & (131068 | 3 | 131072)) {
+ return type;
+ }
+ if (type.restrictiveInstantiation) {
+ return type.restrictiveInstantiation;
+ }
+ type.restrictiveInstantiation = instantiateType(type, restrictiveMapper);
+ type.restrictiveInstantiation.restrictiveInstantiation = type.restrictiveInstantiation;
+ return type.restrictiveInstantiation;
}
function instantiateIndexInfo(info, mapper) {
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
@@ -34263,7 +34635,7 @@
var resultObj = {};
checkTypeAssignableTo(source, target, node, headMessage, undefined, resultObj);
var diagnostic = resultObj.error;
- addRelatedInfo(diagnostic, ts.createDiagnosticForNode(node, signatures === constructSignatures ? ts.Diagnostics.Did_you_mean_to_use_new_with_this_expression : ts.Diagnostics.Did_you_mean_to_call_this_expression));
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(node, signatures === constructSignatures ? ts.Diagnostics.Did_you_mean_to_use_new_with_this_expression : ts.Diagnostics.Did_you_mean_to_call_this_expression));
return true;
}
}
@@ -34296,7 +34668,7 @@
checkTypeRelatedTo(sourceReturn, targetReturn, relation, returnExpression, undefined, undefined, resultObj);
if (resultObj.error) {
if (target.symbol && ts.length(target.symbol.declarations)) {
- addRelatedInfo(resultObj.error, ts.createDiagnosticForNode(target.symbol.declarations[0], ts.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature));
+ ts.addRelatedInfo(resultObj.error, ts.createDiagnosticForNode(target.symbol.declarations[0], ts.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature));
}
return true;
}
@@ -34334,13 +34706,13 @@
undefined;
if (indexInfo && indexInfo.declaration && !ts.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
issuedElaboration = true;
- addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));
+ ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));
}
}
if (!issuedElaboration && (targetProp && ts.length(targetProp.declarations) || target.symbol && ts.length(target.symbol.declarations))) {
var targetNode = targetProp && ts.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];
if (!ts.getSourceFileOfNode(targetNode).hasNoDefaultLib) {
- addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));
+ ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));
}
}
}
@@ -34410,7 +34782,7 @@
case 270:
return { errorNode: child, innerExpression: child.expression, nameType: nameType };
case 11:
- if (child.containsOnlyWhiteSpaces) {
+ if (child.containsOnlyTriviaWhiteSpaces) {
break;
}
return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() };
@@ -34431,7 +34803,7 @@
var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName);
var childrenNameType = getLiteralType(childrenPropName);
var childrenTargetType = getIndexedAccessType(target, childrenNameType);
- var validChildren = ts.filter(containingElement.children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyWhiteSpaces; });
+ var validChildren = ts.filter(containingElement.children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; });
if (!ts.length(validChildren)) {
return result;
}
@@ -34515,7 +34887,7 @@
if (isTupleLikeType(source)) {
return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation);
}
- var tupleizedType = checkArrayLiteral(node, 3, true);
+ var tupleizedType = checkArrayLiteral(node, 1, true);
if (isTupleLikeType(tupleizedType)) {
return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation);
}
@@ -34575,10 +34947,18 @@
function isSignatureAssignableTo(source, target, ignoreReturnTypes) {
return compareSignaturesRelated(source, target, 0, ignoreReturnTypes, false, undefined, compareTypesAssignable) !== 0;
}
+ function isAnySignature(s) {
+ return !s.typeParameters && (!s.thisParameter || isTypeAny(getTypeOfParameter(s.thisParameter))) && s.parameters.length === 1 &&
+ s.hasRestParameter && (getTypeOfParameter(s.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s.parameters[0]))) &&
+ isTypeAny(getReturnTypeOfSignature(s));
+ }
function compareSignaturesRelated(source, target, callbackCheck, ignoreReturnTypes, reportErrors, errorReporter, compareTypes) {
if (source === target) {
return -1;
}
+ if (isAnySignature(target)) {
+ return -1;
+ }
var targetCount = getParameterCount(target);
if (!hasEffectiveRestParameter(target) && getMinArgumentCount(source) > targetCount) {
return 0;
@@ -34644,7 +35024,7 @@
if (targetTypePredicate) {
var sourceTypePredicate = getTypePredicateOfSignature(source);
if (sourceTypePredicate) {
- result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes);
+ result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, reportErrors, errorReporter, compareTypes);
}
else if (ts.isIdentifierTypePredicate(targetTypePredicate)) {
if (reportErrors) {
@@ -34660,7 +35040,7 @@
}
return result;
}
- function compareTypePredicateRelatedTo(source, target, sourceDeclaration, targetDeclaration, reportErrors, errorReporter, compareTypes) {
+ function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) {
if (source.kind !== target.kind) {
if (reportErrors) {
errorReporter(ts.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard);
@@ -34669,12 +35049,9 @@
return 0;
}
if (source.kind === 1) {
- var targetPredicate = target;
- var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0);
- var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0);
- if (sourceIndex !== targetIndex) {
+ if (source.parameterIndex !== target.parameterIndex) {
if (reportErrors) {
- errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName);
+ errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, target.parameterName);
errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target));
}
return 0;
@@ -34859,7 +35236,7 @@
}
var diag = ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation);
if (relatedInfo) {
- addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
+ ts.addRelatedInfo.apply(void 0, [diag].concat(relatedInfo));
}
if (errorOutputContainer) {
errorOutputContainer.error = diag;
@@ -35380,8 +35757,8 @@
if (source.root.isDistributive === target.root.isDistributive) {
if (result_3 = isRelatedTo(source.checkType, target.checkType, false)) {
if (result_3 &= isRelatedTo(source.extendsType, target.extendsType, false)) {
- if (result_3 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), false)) {
- if (result_3 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), false)) {
+ if (result_3 &= isRelatedTo(source.trueType, target.trueType, false)) {
+ if (result_3 &= isRelatedTo(source.falseType, target.falseType, false)) {
return result_3;
}
}
@@ -35396,16 +35773,16 @@
}
var result;
var originalErrorInfo;
+ var varianceCheckFailed = false;
var saveErrorInfo = errorInfo;
if (source.flags & (524288 | 16777216) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
- if (result = typeArgumentsRelatedTo(source.aliasTypeArguments, target.aliasTypeArguments, variances, reportErrors)) {
- return result;
+ var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances);
+ if (varianceResult !== undefined) {
+ return varianceResult;
}
- originalErrorInfo = errorInfo;
- errorInfo = saveErrorInfo;
}
if (target.flags & 262144) {
if (ts.getObjectFlags(source) & 32 && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {
@@ -35451,8 +35828,16 @@
template.indexType === getTypeParameterFromMappedType(target)) {
return -1;
}
- if (!isGenericMappedType(source) && isRelatedTo(getConstraintTypeFromMappedType(target), getIndexType(source))) {
- var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target));
+ if (!isGenericMappedType(source)) {
+ var targetConstraint = getConstraintTypeFromMappedType(target);
+ var sourceKeys_1 = getIndexType(source);
+ var hasOptionalUnionKeys = modifiers & 4 && targetConstraint.flags & 1048576;
+ var filteredByApplicability = hasOptionalUnionKeys ? filterType(targetConstraint, function (t) { return !!isRelatedTo(t, sourceKeys_1); }) : undefined;
+ if (hasOptionalUnionKeys
+ ? !(filteredByApplicability.flags & 131072)
+ : isRelatedTo(targetConstraint, sourceKeys_1)) {
+ var indexingType = hasOptionalUnionKeys ? filteredByApplicability : getTypeParameterFromMappedType(target);
+ var indexedAccessType = getIndexedAccessType(source, indexingType);
var templateType = getTemplateTypeFromMappedType(target);
if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
return result;
@@ -35462,6 +35847,7 @@
errorInfo = saveErrorInfo;
}
}
+ }
if (source.flags & 8650752) {
if (source.flags & 8388608 && target.flags & 8388608) {
if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
@@ -35498,8 +35884,8 @@
if (target.flags & 16777216) {
if (isTypeIdenticalTo(source.extendsType, target.extendsType) &&
(isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
- if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) {
- result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors);
+ if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) {
+ result &= isRelatedTo(source.falseType, target.falseType, reportErrors);
}
if (result) {
errorInfo = saveErrorInfo;
@@ -35544,20 +35930,17 @@
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target &&
!(ts.getObjectFlags(source) & 8192 || ts.getObjectFlags(target) & 8192)) {
var variances = getVariances(source.target);
- if (result = typeArgumentsRelatedTo(source.typeArguments, target.typeArguments, variances, reportErrors)) {
- return result;
- }
- if (variances !== ts.emptyArray && !hasCovariantVoidArgument(target, variances)) {
- if (!(reportErrors && ts.some(variances, function (v) { return v === 0; }))) {
- return 0;
- }
- originalErrorInfo = errorInfo;
- errorInfo = saveErrorInfo;
+ var varianceResult = relateVariances(source.typeArguments, target.typeArguments, variances);
+ if (varianceResult !== undefined) {
+ return varianceResult;
}
}
- else if (isTupleType(source) && (isArrayType(target) || isReadonlyArrayType(target)) || isArrayType(source) && isReadonlyArrayType(target)) {
+ else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
return isRelatedTo(getIndexTypeOfType(source, 1) || anyType, getIndexTypeOfType(target, 1) || anyType, reportErrors);
}
+ else if (relation === subtypeRelation && isEmptyObjectType(target) && ts.getObjectFlags(target) & 32768 && !isEmptyObjectType(source)) {
+ return 0;
+ }
if (source.flags & (524288 | 2097152) && target.flags & 524288) {
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors);
@@ -35573,17 +35956,36 @@
}
}
}
- if (result) {
- if (!originalErrorInfo) {
- errorInfo = saveErrorInfo;
+ if (varianceCheckFailed && result) {
+ errorInfo = originalErrorInfo || errorInfo || saveErrorInfo;
+ }
+ else if (result) {
return result;
}
- errorInfo = originalErrorInfo;
}
}
+ return 0;
+ function isNonGeneric(type) {
+ if (relation === identityRelation) {
+ return isRelatedTo(type, getPermissiveInstantiation(type)) === -1;
+ }
+ return isTypeIdenticalTo(type, getPermissiveInstantiation(type));
}
+ function relateVariances(sourceTypeArguments, targetTypeArguments, variances) {
+ if (result = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors)) {
+ return result;
+ }
+ var allowStructuralFallback = (targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances)) || isNonGeneric(source) || isNonGeneric(target);
+ varianceCheckFailed = !allowStructuralFallback;
+ if (variances !== ts.emptyArray && !allowStructuralFallback) {
+ if (varianceCheckFailed && !(reportErrors && ts.some(variances, function (v) { return v === 0; }))) {
return 0;
}
+ originalErrorInfo = errorInfo;
+ errorInfo = saveErrorInfo;
+ }
+ }
+ }
function mappedTypeRelatedTo(source, target, reportErrors) {
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
@@ -36007,17 +36409,14 @@
return variances;
}
function getVariances(type) {
- if (!strictFunctionTypes) {
- return ts.emptyArray;
- }
- if (type === globalArrayType || type === globalReadonlyArrayType) {
+ if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8) {
return ts.emptyArray;
}
return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);
}
- function hasCovariantVoidArgument(type, variances) {
+ function hasCovariantVoidArgument(typeArguments, variances) {
for (var i = 0; i < variances.length; i++) {
- if (variances[i] === 1 && type.typeArguments[i].flags & 16384) {
+ if (variances[i] === 1 && typeArguments[i].flags & 16384) {
return true;
}
}
@@ -36205,8 +36604,8 @@
}
function literalTypesWithSameBaseType(types) {
var commonBaseType;
- for (var _i = 0, types_8 = types; _i < types_8.length; _i++) {
- var t = types_8[_i];
+ for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
+ var t = types_9[_i];
var baseType = getBaseTypeOfLiteralType(t);
if (!commonBaseType) {
commonBaseType = baseType;
@@ -36235,7 +36634,7 @@
return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
}
function isArrayType(type) {
- return !!(ts.getObjectFlags(type) & 4) && type.target === globalArrayType;
+ return !!(ts.getObjectFlags(type) & 4) && (type.target === globalArrayType || type.target === globalReadonlyArrayType);
}
function isReadonlyArrayType(type) {
return !!(ts.getObjectFlags(type) & 4) && type.target === globalReadonlyArrayType;
@@ -36244,8 +36643,7 @@
return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined;
}
function isArrayLikeType(type) {
- return ts.getObjectFlags(type) & 4 && (type.target === globalArrayType || type.target === globalReadonlyArrayType) ||
- !(type.flags & 98304) && isTypeAssignableTo(type, anyReadonlyArrayType);
+ return isArrayType(type) || !(type.flags & 98304) && isTypeAssignableTo(type, anyReadonlyArrayType);
}
function isEmptyArrayLiteralType(type) {
var elementType = isArrayType(type) ? type.typeArguments[0] : undefined;
@@ -36326,8 +36724,8 @@
}
function getFalsyFlagsOfTypes(types) {
var result = 0;
- for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
- var t = types_9[_i];
+ for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
+ var t = types_10[_i];
result |= getFalsyFlags(t);
}
return result;
@@ -36423,7 +36821,7 @@
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
regularNew.flags = resolved.flags;
- regularNew.objectFlags |= 128 | (ts.getObjectFlags(resolved) & 16384);
+ regularNew.objectFlags |= resolved.objectFlags & ~32768;
type.regularType = regularNew;
return regularNew;
}
@@ -36507,7 +36905,7 @@
return getWidenedTypeWithContext(type, undefined);
}
function getWidenedTypeWithContext(type, context) {
- if (type.flags & 402653184) {
+ if (ts.getObjectFlags(type) & 393216) {
if (type.flags & 98304) {
return anyType;
}
@@ -36530,7 +36928,7 @@
}
function reportWideningErrorsInType(type) {
var errorReported = false;
- if (type.flags & 134217728) {
+ if (ts.getObjectFlags(type) & 131072) {
if (type.flags & 1048576) {
if (ts.some(type.types, isEmptyObjectType)) {
errorReported = true;
@@ -36556,7 +36954,7 @@
for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
- if (t.flags & 134217728) {
+ if (ts.getObjectFlags(t) & 131072) {
if (!reportWideningErrorsInType(t)) {
error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
}
@@ -36600,7 +36998,7 @@
return;
}
break;
- case 289:
+ case 294:
error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
case 239:
@@ -36627,13 +37025,13 @@
errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
}
function reportErrorsFromWidening(declaration, type) {
- if (produceDiagnostics && noImplicitAny && type.flags & 134217728) {
+ if (produceDiagnostics && noImplicitAny && ts.getObjectFlags(type) & 131072) {
if (!reportWideningErrorsInType(type)) {
reportImplicitAny(declaration, type);
}
}
}
- function forEachMatchingParameterType(source, target, callback) {
+ function applyToParameterTypes(source, target, callback) {
var sourceCount = getParameterCount(source);
var targetCount = getParameterCount(target);
var sourceRestType = getEffectiveRestType(source);
@@ -36654,25 +37052,55 @@
callback(getRestTypeAtPosition(source, paramCount), targetRestType);
}
}
- function createInferenceContext(typeParameters, signature, flags, compareTypes, baseInferences) {
- var inferences = baseInferences ? baseInferences.map(cloneInferenceInfo) : typeParameters.map(createInferenceInfo);
- var context = mapper;
- context.typeParameters = typeParameters;
- context.signature = signature;
- context.inferences = inferences;
- context.flags = flags;
- context.compareTypes = compareTypes || compareTypesAssignable;
+ function applyToReturnTypes(source, target, callback) {
+ var sourceTypePredicate = getTypePredicateOfSignature(source);
+ var targetTypePredicate = getTypePredicateOfSignature(target);
+ if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind &&
+ (sourceTypePredicate.kind === 0 || sourceTypePredicate.parameterIndex === targetTypePredicate.parameterIndex)) {
+ callback(sourceTypePredicate.type, targetTypePredicate.type);
+ }
+ else {
+ callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
+ }
+ }
+ function createInferenceContext(typeParameters, signature, flags, compareTypes) {
+ return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable);
+ }
+ function cloneInferenceContext(context, extraFlags) {
+ if (extraFlags === void 0) { extraFlags = 0; }
+ return context && createInferenceContextWorker(ts.map(context.inferences, cloneInferenceInfo), context.signature, context.flags | extraFlags, context.compareTypes);
+ }
+ function cloneInferredPartOfContext(context) {
+ var inferences = ts.filter(context.inferences, hasInferenceCandidates);
+ return inferences.length ?
+ createInferenceContextWorker(ts.map(inferences, cloneInferenceInfo), context.signature, context.flags, context.compareTypes) :
+ undefined;
+ }
+ function createInferenceContextWorker(inferences, signature, flags, compareTypes) {
+ var context = {
+ inferences: inferences,
+ signature: signature,
+ flags: flags,
+ compareTypes: compareTypes,
+ mapper: function (t) { return mapToInferredType(context, t, true); },
+ nonFixingMapper: function (t) { return mapToInferredType(context, t, false); },
+ };
return context;
- function mapper(t) {
+ }
+ function mapToInferredType(context, t, fix) {
+ var inferences = context.inferences;
for (var i = 0; i < inferences.length; i++) {
- if (t === inferences[i].typeParameter) {
- inferences[i].isFixed = true;
+ var inference = inferences[i];
+ if (t === inference.typeParameter) {
+ if (fix && !inference.isFixed) {
+ inference.isFixed = true;
+ inference.inferredType = undefined;
+ }
return getInferredType(context, i);
}
}
return t;
}
- }
function createInferenceInfo(typeParameter) {
return {
typeParameter: typeParameter,
@@ -36695,6 +37123,9 @@
isFixed: inference.isFixed
};
}
+ function getMapperFromContext(context) {
+ return context && context.mapper;
+ }
function couldContainTypeVariables(type) {
var objectFlags = ts.getObjectFlags(type);
return !!(type.flags & 63176704 ||
@@ -36747,21 +37178,18 @@
}
for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) {
var prop = properties_3[_i];
- if (getTypeOfSymbol(prop).flags & 536870912) {
+ if (ts.getObjectFlags(getTypeOfSymbol(prop)) & 524288) {
return undefined;
}
}
if (isArrayType(source)) {
- return createArrayType(inferReverseMappedType(source.typeArguments[0], target, constraint));
- }
- if (isReadonlyArrayType(source)) {
- return createReadonlyArrayType(inferReverseMappedType(source.typeArguments[0], target, constraint));
+ return createArrayType(inferReverseMappedType(source.typeArguments[0], target, constraint), isReadonlyArrayType(source));
}
if (isTupleType(source)) {
var elementTypes = ts.map(source.typeArguments || ts.emptyArray, function (t) { return inferReverseMappedType(t, target, constraint); });
var minLength = getMappedTypeModifiers(target) & 4 ?
getTypeReferenceArity(source) - (source.target.hasRestElement ? 1 : 0) : source.target.minLength;
- return createTupleType(elementTypes, minLength, source.target.hasRestElement, source.target.associatedNames);
+ return createTupleType(elementTypes, minLength, source.target.hasRestElement, source.target.readonly, source.target.associatedNames);
}
var reversed = createObjectType(2048 | 16, undefined);
reversed.source = source;
@@ -36831,11 +37259,11 @@
inference.contraCandidates ? getIntersectionType(inference.contraCandidates) :
emptyObjectType;
}
- function inferTypes(inferences, originalSource, originalTarget, priority) {
+ function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) {
if (priority === void 0) { priority = 0; }
+ if (contravariant === void 0) { contravariant = false; }
var symbolStack;
var visited;
- var contravariant = false;
var bivariant = false;
var propagationType;
var allowComplexConstraintInference = true;
@@ -36888,7 +37316,7 @@
}
}
if (target.flags & 8650752) {
- if (source.flags & 536870912 || source === silentNeverType || (priority & 8 && (source === autoType || source === autoArrayType))) {
+ if (ts.getObjectFlags(source) & 524288 || source === silentNeverType || (priority & 8 && (source === autoType || source === autoArrayType))) {
return;
}
var inference = getInferenceInfoForType(target);
@@ -36897,19 +37325,25 @@
if (inference.priority === undefined || priority < inference.priority) {
inference.candidates = undefined;
inference.contraCandidates = undefined;
+ inference.topLevel = true;
inference.priority = priority;
}
if (priority === inference.priority) {
var candidate = propagationType || source;
if (contravariant && !bivariant) {
- inference.contraCandidates = ts.appendIfUnique(inference.contraCandidates, candidate);
+ if (!ts.contains(inference.contraCandidates, candidate)) {
+ inference.contraCandidates = ts.append(inference.contraCandidates, candidate);
+ inference.inferredType = undefined;
}
- else {
- inference.candidates = ts.appendIfUnique(inference.candidates, candidate);
+ }
+ else if (!ts.contains(inference.candidates, candidate)) {
+ inference.candidates = ts.append(inference.candidates, candidate);
+ inference.inferredType = undefined;
}
}
- if (!(priority & 8) && target.flags & 262144 && !isTypeParameterAtTopLevel(originalTarget, target)) {
+ if (!(priority & 8) && target.flags & 262144 && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) {
inference.topLevel = false;
+ inference.inferredType = undefined;
}
}
return;
@@ -36930,6 +37364,9 @@
}
}
}
+ else if (target.flags & 33554432) {
+ inferFromTypes(source, target.typeVariable);
+ }
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) {
var sourceTypes = source.typeArguments || ts.emptyArray;
var targetTypes = target.typeArguments || ts.emptyArray;
@@ -36965,37 +37402,28 @@
else if (source.flags & 16777216 && target.flags & 16777216) {
inferFromTypes(source.checkType, target.checkType);
inferFromTypes(source.extendsType, target.extendsType);
- inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));
- inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
+ inferFromTypes(source.trueType, target.trueType);
+ inferFromTypes(source.falseType, target.falseType);
}
- else if (target.flags & 16777216) {
- inferFromTypes(source, getUnionType([getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]));
+ else if (target.flags & 16777216 && !contravariant) {
+ inferFromTypes(source, target.trueType);
+ inferFromTypes(source, target.falseType);
}
else if (target.flags & 3145728) {
- var targetTypes = target.types;
- var typeVariableCount = 0;
- var typeVariable = void 0;
- for (var _d = 0, targetTypes_3 = targetTypes; _d < targetTypes_3.length; _d++) {
- var t = targetTypes_3[_d];
+ for (var _d = 0, _e = target.types; _d < _e.length; _d++) {
+ var t = _e[_d];
+ var savePriority = priority;
if (getInferenceInfoForType(t)) {
- typeVariable = t;
- typeVariableCount++;
+ priority |= 1;
}
- else {
inferFromTypes(source, t);
- }
- }
- if (typeVariableCount === 1) {
- var savePriority = priority;
- priority |= 1;
- inferFromTypes(source, typeVariable);
priority = savePriority;
}
}
else if (source.flags & 1048576) {
var sourceTypes = source.types;
- for (var _e = 0, sourceTypes_3 = sourceTypes; _e < sourceTypes_3.length; _e++) {
- var sourceType = sourceTypes_3[_e];
+ for (var _f = 0, sourceTypes_3 = sourceTypes; _f < sourceTypes_3.length; _f++) {
+ var sourceType = sourceTypes_3[_f];
inferFromTypes(sourceType, target);
}
}
@@ -37059,12 +37487,12 @@
}
return undefined;
}
- function inferFromMappedTypeConstraint(source, target, constraintType) {
+ function inferToMappedType(source, target, constraintType) {
if (constraintType.flags & 1048576) {
var result = false;
for (var _i = 0, _a = constraintType.types; _i < _a.length; _i++) {
var type = _a[_i];
- result = inferFromMappedTypeConstraint(source, target, type) || result;
+ result = inferToMappedType(source, target, type) || result;
}
return result;
}
@@ -37086,6 +37514,10 @@
priority |= 4;
inferFromTypes(getIndexType(source), constraintType);
priority = savePriority;
+ var extendedConstraint = getConstraintOfType(constraintType);
+ if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
+ return true;
+ }
var valueTypes = ts.compact([
getIndexTypeOfType(source, 0),
getIndexTypeOfType(source, 1)
@@ -37102,7 +37534,7 @@
}
if (ts.getObjectFlags(target) & 32) {
var constraintType = getConstraintTypeFromMappedType(target);
- if (inferFromMappedTypeConstraint(source, target, constraintType)) {
+ if (inferToMappedType(source, target, constraintType)) {
return;
}
}
@@ -37114,11 +37546,11 @@
}
}
function inferFromProperties(source, target) {
- if (isTupleType(source)) {
+ if (isArrayType(source) || isTupleType(source)) {
if (isTupleType(target)) {
- var sourceLength = getLengthOfTupleType(source);
+ var sourceLength = isTupleType(source) ? getLengthOfTupleType(source) : 0;
var targetLength = getLengthOfTupleType(target);
- var sourceRestType = getRestTypeOfTupleType(source);
+ var sourceRestType = isTupleType(source) ? getRestTypeOfTupleType(source) : getElementTypeOfArrayType(source);
var targetRestType = getRestTypeOfTupleType(target);
var fixedLength = targetLength < sourceLength || sourceRestType ? targetLength : sourceLength;
for (var i = 0; i < fixedLength; i++) {
@@ -37155,7 +37587,7 @@
var sourceLen = sourceSignatures.length;
var targetLen = targetSignatures.length;
var len = sourceLen < targetLen ? sourceLen : targetLen;
- var skipParameters = !!(source.flags & 536870912);
+ var skipParameters = !!(ts.getObjectFlags(source) & 524288);
for (var i = 0; i < len; i++) {
inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters);
}
@@ -37165,17 +37597,10 @@
var saveBivariant = bivariant;
var kind = target.declaration ? target.declaration.kind : 0;
bivariant = bivariant || kind === 156 || kind === 155 || kind === 157;
- forEachMatchingParameterType(source, target, inferFromContravariantTypes);
+ applyToParameterTypes(source, target, inferFromContravariantTypes);
bivariant = saveBivariant;
}
- var sourceTypePredicate = getTypePredicateOfSignature(source);
- var targetTypePredicate = getTypePredicateOfSignature(target);
- if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) {
- inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type);
- }
- else {
- inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
- }
+ applyToReturnTypes(source, target, inferFromTypes);
}
function inferFromIndexTypes(source, target) {
var targetStringIndexType = getIndexTypeOfType(target, 0);
@@ -37198,8 +37623,8 @@
}
}
function typeIdenticalToSomeType(type, types) {
- for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
- var t = types_10[_i];
+ for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
+ var t = types_11[_i];
if (isTypeIdenticalTo(t, type)) {
return true;
}
@@ -37271,7 +37696,7 @@
else {
var defaultType = getDefaultFromTypeParameter(inference.typeParameter);
if (defaultType) {
- inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context));
+ inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper));
}
else {
inferredType = getDefaultTypeArgumentType(!!(context.flags & 2));
@@ -37284,7 +37709,7 @@
inference.inferredType = inferredType;
var constraint = getConstraintOfTypeParameter(inference.typeParameter);
if (constraint) {
- var instantiatedConstraint = instantiateType(constraint, context);
+ var instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
inference.inferredType = inferredType = instantiatedConstraint;
}
@@ -37308,17 +37733,23 @@
case "console":
return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;
case "$":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig;
+ return compilerOptions.types
+ ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig
+ : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery;
case "describe":
case "suite":
case "it":
case "test":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig;
+ return compilerOptions.types
+ ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig
+ : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha;
case "process":
case "require":
case "Buffer":
case "module":
- return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig;
+ return compilerOptions.types
+ ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig
+ : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode;
case "Map":
case "Set":
case "Promise":
@@ -37440,9 +37871,8 @@
}
return false;
}
- function hasNarrowableDeclaredType(expr) {
- var type = getDeclaredTypeOfReference(expr);
- return !!(type && type.flags & 1048576);
+ function isSyntheticThisPropertyAccess(expr) {
+ return ts.isAccessExpression(expr) && expr.expression.kind === 100 && !!(expr.expression.flags & 8);
}
function findDiscriminantProperties(sourceProperties, target) {
var result;
@@ -37512,8 +37942,8 @@
}
function getTypeFactsOfTypes(types) {
var result = 0;
- for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
- var t = types_11[_i];
+ for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
+ var t = types_12[_i];
result |= getTypeFacts(t);
}
return result;
@@ -37786,7 +38216,7 @@
if (type.flags & 1048576) {
var types = type.types;
var filtered = ts.filter(types, f);
- return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.primitiveTypesOnly);
+ return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.objectFlags);
}
return f(type) ? type : neverType;
}
@@ -37800,8 +38230,8 @@
var types = type.types;
var mappedType;
var mappedTypes;
- for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
- var current = types_12[_i];
+ for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
+ var current = types_13[_i];
var t = mapper(current);
if (t) {
if (!mappedType) {
@@ -37872,8 +38302,8 @@
}
function isEvolvingArrayTypeList(types) {
var hasEvolvingArrayType = false;
- for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
- var t = types_13[_i];
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
+ var t = types_14[_i];
if (!(t.flags & 131072)) {
if (!(ts.getObjectFlags(t) & 256)) {
return false;
@@ -38297,6 +38727,15 @@
assumeTrue = !assumeTrue;
}
var valueType = getTypeOfExpression(value);
+ if ((type.flags & 2) && (operator === 35) && assumeTrue) {
+ if (valueType.flags & (131068 | 67108864)) {
+ return valueType;
+ }
+ if (valueType.flags & 524288) {
+ return nonPrimitiveType;
+ }
+ return type;
+ }
if (valueType.flags & 98304) {
if (!strictNullChecks) {
return type;
@@ -38325,7 +38764,7 @@
function narrowTypeByTypeof(type, typeOfExpr, operator, literal, assumeTrue) {
var target = getReferenceCandidate(typeOfExpr.expression);
if (!isMatchingReference(reference, target)) {
- if (containsMatchingReference(reference, target) && hasNarrowableDeclaredType(target)) {
+ if (containsMatchingReference(reference, target)) {
return declaredType;
}
return type;
@@ -38369,6 +38808,27 @@
}
var clauseTypes = switchTypes.slice(clauseStart, clauseEnd);
var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType);
+ if ((type.flags & 2) && !hasDefaultClause) {
+ var groundClauseTypes = void 0;
+ for (var i = 0; i < clauseTypes.length; i += 1) {
+ var t = clauseTypes[i];
+ if (t.flags & (131068 | 67108864)) {
+ if (groundClauseTypes !== undefined) {
+ groundClauseTypes.push(t);
+ }
+ }
+ else if (t.flags & 524288) {
+ if (groundClauseTypes === undefined) {
+ groundClauseTypes = clauseTypes.slice(0, i);
+ }
+ groundClauseTypes.push(nonPrimitiveType);
+ }
+ else {
+ return type;
+ }
+ }
+ return getUnionType(groundClauseTypes === undefined ? clauseTypes : groundClauseTypes);
+ }
var discriminantType = getUnionType(clauseTypes);
var caseType = discriminantType.flags & 131072 ? neverType :
replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType);
@@ -38434,7 +38894,7 @@
function narrowTypeByInstanceof(type, expr, assumeTrue) {
var left = getReferenceCandidate(expr.left);
if (!isMatchingReference(reference, left)) {
- if (containsMatchingReference(reference, left) && hasNarrowableDeclaredType(left)) {
+ if (containsMatchingReference(reference, left) && !isSyntheticThisPropertyAccess(reference)) {
return declaredType;
}
return type;
@@ -38490,7 +38950,7 @@
return type;
}
if (ts.isIdentifierTypePredicate(predicate)) {
- var predicateArgument = callExpression.arguments[predicate.parameterIndex - (signature.thisParameter ? 1 : 0)];
+ var predicateArgument = callExpression.arguments[predicate.parameterIndex];
if (predicateArgument) {
if (isMatchingReference(reference, predicateArgument)) {
return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf);
@@ -38556,7 +39016,7 @@
return ts.findAncestor(node.parent, function (node) {
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
node.kind === 245 ||
- node.kind === 279 ||
+ node.kind === 284 ||
node.kind === 154;
});
}
@@ -38657,7 +39117,7 @@
}
else if (declaration.kind === 209) {
var container = ts.getThisContainer(node, false);
- while (container.kind !== 279) {
+ while (container.kind !== 284) {
if (container.parent === declaration) {
if (container.kind === 154 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration).flags |= 16777216;
@@ -38748,6 +39208,7 @@
function checkNestedBlockScopedBinding(node, symbol) {
if (languageVersion >= 2 ||
(symbol.flags & (2 | 32)) === 0 ||
+ ts.isSourceFile(symbol.valueDeclaration) ||
symbol.valueDeclaration.parent.kind === 274) {
return;
}
@@ -38893,21 +39354,26 @@
if (capturedByArrowFunction && languageVersion < 2) {
captureLexicalThis(node, container);
}
- var type = tryGetThisTypeAt(node, container);
- if (!type && noImplicitThis) {
- var diag = error(node, capturedByArrowFunction && container.kind === 279 ?
- ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any :
- ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
+ var type = tryGetThisTypeAt(node, true, container);
+ if (noImplicitThis) {
+ var globalThisType_1 = getTypeOfSymbol(globalThisSymbol);
+ if (type === globalThisType_1 && capturedByArrowFunction) {
+ error(node, ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);
+ }
+ else if (!type) {
+ var diag = error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
if (!ts.isSourceFile(container)) {
var outsideThis = tryGetThisTypeAt(container);
- if (outsideThis) {
- addRelatedInfo(diag, ts.createDiagnosticForNode(container, ts.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));
+ if (outsideThis && outsideThis !== globalThisType_1) {
+ ts.addRelatedInfo(diag, ts.createDiagnosticForNode(container, ts.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));
+ }
}
}
}
return type || anyType;
}
- function tryGetThisTypeAt(node, container) {
+ function tryGetThisTypeAt(node, includeGlobalThis, container) {
+ if (includeGlobalThis === void 0) { includeGlobalThis = true; }
if (container === void 0) { container = ts.getThisContainer(node, false); }
var isInJS = ts.isInJSFile(node);
if (ts.isFunctionLike(container) &&
@@ -38946,6 +39412,15 @@
return getFlowTypeOfReference(node, type);
}
}
+ if (ts.isSourceFile(container)) {
+ if (container.commonJsModuleIndicator) {
+ var fileSymbol = getSymbolOfNode(container);
+ return fileSymbol && getTypeOfSymbol(fileSymbol);
+ }
+ else if (includeGlobalThis) {
+ return getTypeOfSymbol(globalThisSymbol);
+ }
+ }
}
function getClassNameFromPrototypeMethod(container) {
if (container.kind === 196 &&
@@ -38991,7 +39466,7 @@
}
function getTypeForThisExpressionFromJSDoc(node) {
var jsdocType = ts.getJSDocType(node);
- if (jsdocType && jsdocType.kind === 289) {
+ if (jsdocType && jsdocType.kind === 294) {
var jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 &&
jsDocFunctionType.parameters[0].name &&
@@ -39005,7 +39480,7 @@
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 151; });
+ return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 151 && n.parent === constructorDecl; });
}
function checkSuperExpression(node) {
var isCallExpression = node.parent.kind === 191 && node.parent.expression === node;
@@ -39149,7 +39624,7 @@
while (type) {
var thisType = getThisTypeFromContextualType(type);
if (thisType) {
- return instantiateType(thisType, getContextualMapper(containingLiteral));
+ return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral)));
}
if (literal.parent.kind !== 275) {
break;
@@ -39414,7 +39889,15 @@
}
function getTypeOfPropertyOfContextualType(type, name) {
return mapType(type, function (t) {
- if (t.flags & 3670016) {
+ if (isGenericMappedType(t)) {
+ var constraint = getConstraintTypeFromMappedType(t);
+ var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
+ var propertyNameType = getLiteralType(ts.unescapeLeadingUnderscores(name));
+ if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
+ return substituteIndexedMappedType(t, propertyNameType);
+ }
+ }
+ else if (t.flags & 3670016) {
var prop = getPropertyOfType(t, name);
if (prop) {
return getTypeOfSymbol(prop);
@@ -39529,18 +40012,41 @@
return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 267 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType);
}
function getApparentTypeOfContextualType(node) {
- var contextualType = getContextualType(node);
- contextualType = contextualType && mapType(contextualType, getApparentType);
- if (contextualType && contextualType.flags & 1048576) {
+ var contextualType = instantiateContextualType(getContextualType(node), node);
+ if (contextualType) {
+ var apparentType = mapType(contextualType, getApparentType, true);
+ if (apparentType.flags & 1048576) {
if (ts.isObjectLiteralExpression(node)) {
- return discriminateContextualTypeByObjectMembers(node, contextualType);
+ return discriminateContextualTypeByObjectMembers(node, apparentType);
}
else if (ts.isJsxAttributes(node)) {
- return discriminateContextualTypeByJSXAttributes(node, contextualType);
+ return discriminateContextualTypeByJSXAttributes(node, apparentType);
+ }
+ }
+ return apparentType;
+ }
+ }
+ function instantiateContextualType(contextualType, node) {
+ if (contextualType && maybeTypeOfKind(contextualType, 63176704)) {
+ var inferenceContext = getInferenceContext(node);
+ if (inferenceContext && inferenceContext.returnMapper) {
+ return instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
}
}
return contextualType;
}
+ function instantiateInstantiableTypes(type, mapper) {
+ if (type.flags & 63176704) {
+ return instantiateType(type, mapper);
+ }
+ if (type.flags & 1048576) {
+ return getUnionType(ts.map(type.types, function (t) { return instantiateInstantiableTypes(t, mapper); }), 0);
+ }
+ if (type.flags & 2097152) {
+ return getIntersectionType(ts.map(type.types, function (t) { return instantiateInstantiableTypes(t, mapper); }));
+ }
+ return type;
+ }
function getContextualType(node) {
if (node.flags & 8388608) {
return undefined;
@@ -39568,7 +40074,7 @@
return getContextualTypeForArgument(parent, node);
case 194:
case 212:
- return getTypeFromTypeNode(parent.type);
+ return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type);
case 204:
return getContextualTypeForBinaryOperand(node);
case 275:
@@ -39601,9 +40107,9 @@
}
return undefined;
}
- function getContextualMapper(node) {
- var ancestor = ts.findAncestor(node, function (n) { return !!n.contextualMapper; });
- return ancestor ? ancestor.contextualMapper : identityMapper;
+ function getInferenceContext(node) {
+ var ancestor = ts.findAncestor(node, function (n) { return !!n.inferenceContext; });
+ return ancestor && ancestor.inferenceContext;
}
function getContextualJsxElementAttributesType(node) {
if (ts.isJsxOpeningElement(node) && node.parent.contextualType) {
@@ -39761,8 +40267,8 @@
}
var signatureList;
var types = type.types;
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
- var current = types_14[_i];
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
+ var current = types_15[_i];
var signature = getContextualCallSignature(current, node);
if (signature) {
if (!signatureList) {
@@ -39776,12 +40282,7 @@
}
}
}
- var result;
- if (signatureList) {
- result = cloneSignature(signatureList[0]);
- result.unionSignatures = signatureList;
- }
- return result;
+ return signatureList && createUnionSignature(signatureList[0], signatureList);
}
function checkSpreadExpression(node, checkMode) {
if (languageVersion < 2 && compilerOptions.downlevelIteration) {
@@ -39801,6 +40302,7 @@
var elementTypes = [];
var inDestructuringPattern = ts.isAssignmentTarget(node);
var contextualType = getApparentTypeOfContextualType(node);
+ var inConstContext = isConstContext(node);
for (var index = 0; index < elementCount; index++) {
var e = elements[index];
if (inDestructuringPattern && e.kind === 208) {
@@ -39829,20 +40331,23 @@
type.pattern = node;
return type;
}
- else if (tupleResult = getArrayLiteralTupleTypeIfApplicable(elementTypes, contextualType, hasRestElement, elementCount)) {
+ else if (tupleResult = getArrayLiteralTupleTypeIfApplicable(elementTypes, contextualType, hasRestElement, elementCount, inConstContext)) {
return tupleResult;
}
else if (forceTuple) {
return createTupleType(elementTypes, minLength, hasRestElement);
}
}
- return getArrayLiteralType(elementTypes, 2);
+ return createArrayType(elementTypes.length ?
+ getUnionType(elementTypes, 2) :
+ strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext);
}
- function getArrayLiteralTupleTypeIfApplicable(elementTypes, contextualType, hasRestElement, elementCount) {
+ function getArrayLiteralTupleTypeIfApplicable(elementTypes, contextualType, hasRestElement, elementCount, readonly) {
if (elementCount === void 0) { elementCount = elementTypes.length; }
- if (contextualType && forEachType(contextualType, isTupleLikeType)) {
+ if (readonly === void 0) { readonly = false; }
+ if (readonly || (contextualType && forEachType(contextualType, isTupleLikeType))) {
var minLength = elementCount - (hasRestElement ? 1 : 0);
- var pattern = contextualType.pattern;
+ var pattern = contextualType && contextualType.pattern;
if (!hasRestElement && pattern && (pattern.kind === 185 || pattern.kind === 187)) {
var patternElements = pattern.elements;
for (var i = elementCount; i < patternElements.length; i++) {
@@ -39858,14 +40363,8 @@
}
}
}
- return createTupleType(elementTypes, minLength, hasRestElement);
- }
+ return createTupleType(elementTypes, minLength, hasRestElement, readonly);
}
- function getArrayLiteralType(elementTypes, unionReduction) {
- if (unionReduction === void 0) { unionReduction = 1; }
- return createArrayType(elementTypes.length ?
- getUnionType(elementTypes, unionReduction) :
- strictNullChecks ? implicitNeverType : undefinedWideningType);
}
function isNumericName(name) {
switch (name.kind) {
@@ -39904,15 +40403,15 @@
}
return links.resolvedType;
}
- function getObjectLiteralIndexInfo(propertyNodes, offset, properties, kind) {
+ function getObjectLiteralIndexInfo(node, offset, properties, kind) {
var propTypes = [];
for (var i = 0; i < properties.length; i++) {
- if (kind === 0 || isNumericName(propertyNodes[i + offset].name)) {
+ if (kind === 0 || isNumericName(node.properties[i + offset].name)) {
propTypes.push(getTypeOfSymbol(properties[i]));
}
}
var unionType = propTypes.length ? getUnionType(propTypes, 2) : undefinedType;
- return createIndexInfo(unionType, false);
+ return createIndexInfo(unionType, isConstContext(node));
}
function getImmediateAliasedSymbol(symbol) {
ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
@@ -39931,14 +40430,15 @@
var propertiesTable;
var propertiesArray = [];
var spread = emptyObjectType;
- var propagatedFlags = 0;
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
(contextualType.pattern.kind === 184 || contextualType.pattern.kind === 188);
+ var inConstContext = isConstContext(node);
+ var checkFlags = inConstContext ? 8 : 0;
var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node);
var enumTag = ts.getJSDocEnumTag(node);
var isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
- var typeFlags = 0;
+ var objectFlags = freshObjectLiteralFlag;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
var hasComputedNumberProperty = false;
@@ -39965,11 +40465,11 @@
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
}
}
- typeFlags |= type.flags;
+ objectFlags |= ts.getObjectFlags(type) & 917504;
var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;
var prop = nameType ?
- createSymbol(4 | member.flags, getPropertyNameFromType(nameType), 2048) :
- createSymbol(4 | member.flags, member.escapedName);
+ createSymbol(4 | member.flags, getPropertyNameFromType(nameType), checkFlags | 2048) :
+ createSymbol(4 | member.flags, member.escapedName, checkFlags);
if (nameType) {
prop.nameType = nameType;
}
@@ -40003,19 +40503,18 @@
checkExternalEmitHelpers(memberDecl, 2);
}
if (propertiesArray.length > 0) {
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 32768);
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);
propertiesArray = [];
propertiesTable = ts.createSymbolTable();
hasComputedStringProperty = false;
hasComputedNumberProperty = false;
- typeFlags = 0;
}
var type = checkExpression(memberDecl.expression);
if (!isValidSpreadType(type)) {
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
return errorType;
}
- spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 32768);
+ spread = getSpreadType(spread, type, node.symbol, objectFlags, inConstContext);
offset = i + 1;
continue;
}
@@ -40055,17 +40554,16 @@
}
if (spread !== emptyObjectType) {
if (propertiesArray.length > 0) {
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 32768);
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags, inConstContext);
}
return spread;
}
return createObjectLiteralType();
function createObjectLiteralType() {
- var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined;
- var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined;
+ var stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 0) : undefined;
+ var numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, 1) : undefined;
var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
- result.flags |= 268435456 | typeFlags & 939524096;
- result.objectFlags |= 128 | freshObjectLiteralFlag;
+ result.objectFlags |= objectFlags | 128 | 262144;
if (isJSObjectLiteral) {
result.objectFlags |= 16384;
}
@@ -40075,7 +40573,6 @@
if (inDestructuringPattern) {
result.pattern = node;
}
- propagatedFlags |= result.flags & 939524096;
return result;
}
}
@@ -40133,7 +40630,6 @@
var hasSpreadAnyType = false;
var typeToIntersect;
var explicitlySpecifyChildrenAttribute = false;
- var typeFlags = 0;
var objectFlags = 4096;
var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -40141,7 +40637,7 @@
var member = attributeDecl.symbol;
if (ts.isJsxAttribute(attributeDecl)) {
var exprType = checkJsxAttribute(attributeDecl, checkMode);
- typeFlags |= exprType.flags & 939524096;
+ objectFlags |= ts.getObjectFlags(exprType) & 917504;
var attributeSymbol = createSymbol(4 | 33554432 | member.flags, member.escapedName);
attributeSymbol.declarations = member.declarations;
attributeSymbol.parent = member.parent;
@@ -40158,7 +40654,7 @@
else {
ts.Debug.assert(attributeDecl.kind === 269);
if (attributesTable.size > 0) {
- spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, typeFlags, objectFlags);
+ spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
attributesTable = ts.createSymbolTable();
}
var exprType = checkExpressionCached(attributeDecl.expression, checkMode);
@@ -40166,7 +40662,7 @@
hasSpreadAnyType = true;
}
if (isValidSpreadType(exprType)) {
- spread = getSpreadType(spread, exprType, attributes.symbol, typeFlags, objectFlags);
+ spread = getSpreadType(spread, exprType, attributes.symbol, objectFlags, false);
}
else {
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
@@ -40175,7 +40671,7 @@
}
if (!hasSpreadAnyType) {
if (attributesTable.size > 0) {
- spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, typeFlags, objectFlags);
+ spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false);
}
}
var parent = openingLikeElement.parent.kind === 260 ? openingLikeElement.parent : undefined;
@@ -40196,7 +40692,7 @@
childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
var childPropMap = ts.createSymbolTable();
childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol);
- spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, typeFlags, objectFlags);
+ spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, objectFlags, false);
}
}
if (hasSpreadAnyType) {
@@ -40209,8 +40705,7 @@
function createJsxAttributesType() {
objectFlags |= freshObjectLiteralFlag;
var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined);
- result.flags |= 268435456 | typeFlags;
- result.objectFlags |= 128 | objectFlags;
+ result.objectFlags |= objectFlags | 128 | 262144;
return result;
}
}
@@ -40219,7 +40714,7 @@
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
var child = _a[_i];
if (child.kind === 11) {
- if (!child.containsOnlyWhiteSpaces) {
+ if (!child.containsOnlyTriviaWhiteSpaces) {
childrenTypes.push(stringType);
}
}
@@ -40276,7 +40771,7 @@
var namespaceName = getJsxNamespace(location);
var resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false);
if (resolvedNamespace) {
- var candidate = getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920);
+ var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920));
if (candidate) {
if (links) {
links.jsxNamespace = candidate;
@@ -40624,6 +41119,15 @@
if (isJSLiteralType(leftType)) {
return anyType;
}
+ if (leftType.symbol === globalThisSymbol) {
+ if (globalThisSymbol.exports.has(right.escapedText) && (globalThisSymbol.exports.get(right.escapedText).flags & 418)) {
+ error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(right.escapedText), typeToString(leftType));
+ }
+ else if (noImplicitAny) {
+ error(right, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType));
+ }
+ return anyType;
+ }
if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
reportNonexistentProperty(right, leftType.flags & 262144 && leftType.isThisType ? apparentType : leftType);
}
@@ -40694,7 +41198,7 @@
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
}
if (diagnosticMessage) {
- addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));
+ ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));
}
}
function isInPropertyInitializer(node) {
@@ -40703,6 +41207,19 @@
case 154:
return true;
case 275:
+ case 156:
+ case 158:
+ case 159:
+ case 277:
+ case 149:
+ case 216:
+ case 270:
+ case 267:
+ case 268:
+ case 269:
+ case 262:
+ case 211:
+ case 273:
return false;
default:
return ts.isExpressionNode(node) ? false : "quit";
@@ -40766,7 +41283,7 @@
}
var resultDiagnostic = ts.createDiagnosticForNodeFromMessageChain(propNode, errorInfo);
if (relatedInfo) {
- addRelatedInfo(resultDiagnostic, relatedInfo);
+ ts.addRelatedInfo(resultDiagnostic, relatedInfo);
}
diagnostics.add(resultDiagnostic);
}
@@ -41098,43 +41615,43 @@
}
return undefined;
}
- function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) {
+ function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) {
var context = createInferenceContext(signature.typeParameters, signature, 0, compareTypes);
- var sourceSignature = contextualMapper ? instantiateSignature(contextualSignature, contextualMapper) : contextualSignature;
- forEachMatchingParameterType(sourceSignature, signature, function (source, target) {
+ var restType = getEffectiveRestType(contextualSignature);
+ var mapper = inferenceContext && (restType && restType.flags & 262144 ? inferenceContext.nonFixingMapper : inferenceContext.mapper);
+ var sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature;
+ applyToParameterTypes(sourceSignature, signature, function (source, target) {
inferTypes(context.inferences, source, target);
});
- if (!contextualMapper) {
- inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8);
+ if (!inferenceContext) {
+ applyToReturnTypes(contextualSignature, signature, function (source, target) {
+ inferTypes(context.inferences, source, target, 8);
+ });
}
return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJSFile(contextualSignature.declaration));
}
- function inferJsxTypeArguments(node, signature, excludeArgument, context) {
+ function inferJsxTypeArguments(node, signature, checkMode, context) {
var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);
- var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, excludeArgument && excludeArgument[0] !== undefined ? identityMapper : context);
+ var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context, checkMode);
inferTypes(context.inferences, checkAttrType, paramType);
return getInferredTypes(context);
}
- function inferTypeArguments(node, signature, args, excludeArgument, context) {
- for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) {
- var inference = _a[_i];
- if (!inference.isFixed) {
- inference.inferredType = undefined;
- }
- }
+ function inferTypeArguments(node, signature, args, checkMode, context) {
if (ts.isJsxOpeningLikeElement(node)) {
- return inferJsxTypeArguments(node, signature, excludeArgument, context);
+ return inferJsxTypeArguments(node, signature, checkMode, context);
}
if (node.kind !== 152) {
var contextualType = getContextualType(node);
if (contextualType) {
- var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node)));
+ var outerMapper = getMapperFromContext(cloneInferenceContext(getInferenceContext(node), 1));
+ var instantiatedType = instantiateType(contextualType, outerMapper);
var contextualSignature = getSingleCallSignature(instantiatedType);
var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
instantiatedType;
var inferenceTargetType = getReturnTypeOfSignature(signature);
inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8);
+ context.returnMapper = getMapperFromContext(cloneInferredPartOfContext(context));
}
}
var thisType = getThisTypeOfSignature(signature);
@@ -41149,8 +41666,7 @@
var arg = args[i];
if (arg.kind !== 210) {
var paramType = getTypeAtPosition(signature, i);
- var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : context;
- var argType = checkExpressionWithContextualType(arg, paramType, mapper);
+ var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
inferTypes(context.inferences, argType, paramType);
}
}
@@ -41172,7 +41688,7 @@
if (isSpreadArgument(arg)) {
return arg.kind === 215 ?
createArrayType(arg.type) :
- getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context));
+ getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0));
}
}
var contextualType = getIndexTypeOfType(restType, 1) || anyType;
@@ -41180,7 +41696,7 @@
var types = [];
var spreadIndex = -1;
for (var i = index; i < argCount; i++) {
- var argType = checkExpressionWithContextualType(args[i], contextualType, context);
+ var argType = checkExpressionWithContextualType(args[i], contextualType, context, 0);
if (spreadIndex < 0 && isSpreadArgument(args[i])) {
spreadIndex = i - index;
}
@@ -41225,14 +41741,14 @@
}
return 2;
}
- function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, excludeArgument, reportErrors) {
+ function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors) {
var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node);
- var attributesType = checkExpressionWithContextualType(node.attributes, paramType, excludeArgument && excludeArgument[0] ? identityMapper : undefined);
+ var attributesType = checkExpressionWithContextualType(node.attributes, paramType, undefined, checkMode);
return checkTypeRelatedToAndOptionallyElaborate(attributesType, paramType, relation, reportErrors ? node.tagName : undefined, node.attributes);
}
- function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {
+ function checkApplicableSignature(node, args, signature, relation, checkMode, reportErrors) {
if (ts.isJsxOpeningLikeElement(node)) {
- return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, excludeArgument, reportErrors);
+ return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors);
}
var thisType = getThisTypeOfSignature(signature);
if (thisType && thisType !== voidType && node.kind !== 192) {
@@ -41251,8 +41767,8 @@
var arg = args[i];
if (arg.kind !== 210) {
var paramType = getTypeAtPosition(signature, i);
- var argType = checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
- var checkArgType = excludeArgument ? getRegularTypeOfObjectLiteral(argType) : argType;
+ var argType = checkExpressionWithContextualType(arg, paramType, undefined, checkMode);
+ var checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType;
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : undefined, arg, headMessage)) {
return false;
}
@@ -41386,25 +41902,41 @@
if (argCount <= max && hasSpreadArgument) {
argCount--;
}
+ var spanArray;
var related;
+ var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
+ hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 :
+ ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1;
if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) {
var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount];
if (paramDecl) {
related = ts.createDiagnosticForNode(paramDecl, ts.isBindingPattern(paramDecl.name) ? ts.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided : ts.Diagnostics.An_argument_for_0_was_not_provided, !paramDecl.name ? argCount : !ts.isBindingPattern(paramDecl.name) ? ts.idText(getFirstIdentifier(paramDecl.name)) : undefined);
}
}
- if (hasRestParameter || hasSpreadArgument) {
- var error_1 = hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more :
- hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 :
- ts.Diagnostics.Expected_0_arguments_but_got_1_or_more;
- var diagnostic_1 = ts.createDiagnosticForNode(node, error_1, paramRange, argCount);
- return related ? addRelatedInfo(diagnostic_1, related) : diagnostic_1;
- }
if (min < argCount && argCount < max) {
return ts.createDiagnosticForNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, argCount, belowArgCount, aboveArgCount);
}
- var diagnostic = ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_arguments_but_got_1, paramRange, argCount);
- return related ? addRelatedInfo(diagnostic, related) : diagnostic;
+ if (!hasSpreadArgument && argCount < min) {
+ var diagnostic_1 = ts.createDiagnosticForNode(node, error, paramRange, argCount);
+ return related ? ts.addRelatedInfo(diagnostic_1, related) : diagnostic_1;
+ }
+ if (hasRestParameter || hasSpreadArgument) {
+ spanArray = ts.createNodeArray(args);
+ if (hasSpreadArgument && argCount) {
+ var nextArg = ts.elementAt(args, getSpreadArgumentIndex(args) + 1) || undefined;
+ spanArray = ts.createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : max));
+ }
+ }
+ else {
+ spanArray = ts.createNodeArray(args.slice(max));
+ }
+ spanArray.pos = ts.first(spanArray).pos;
+ spanArray.end = ts.last(spanArray).end;
+ if (spanArray.end === spanArray.pos) {
+ spanArray.end++;
+ }
+ var diagnostic = ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), spanArray, error, paramRange, argCount);
+ return related ? ts.addRelatedInfo(diagnostic, related) : diagnostic;
}
function getTypeArgumentArityError(node, signatures, typeArguments) {
var argCount = typeArguments.length;
@@ -41432,7 +41964,7 @@
}
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
}
- function resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp, fallbackError) {
+ function resolveCall(node, signatures, candidatesOutArray, checkMode, fallbackError) {
var isTaggedTemplate = node.kind === 193;
var isDecorator = node.kind === 152;
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
@@ -41454,12 +41986,12 @@
}
var args = getEffectiveCallArguments(node);
var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
- var excludeArgument = !isDecorator && !isSingleNonGenericCandidate ? getExcludeArgument(args) : undefined;
+ var argCheckMode = !isDecorator && !isSingleNonGenericCandidate && ts.some(args, isContextSensitive) ? 4 : 0;
var candidateForArgumentError;
var candidateForArgumentArityError;
var candidateForTypeArgumentError;
var result;
- var signatureHelpTrailingComma = isForSignatureHelp && node.kind === 191 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 191 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -41471,7 +42003,7 @@
}
if (reportErrors) {
if (candidateForArgumentError) {
- checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true);
+ checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, 0, true);
}
else if (candidateForArgumentArityError) {
diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args));
@@ -41503,7 +42035,7 @@
if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) {
return undefined;
}
- if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) {
+ if (!checkApplicableSignature(node, args, candidate, relation, 0, false)) {
candidateForArgumentError = candidate;
return undefined;
}
@@ -41527,9 +42059,10 @@
}
else {
inferenceContext = createInferenceContext(candidate.typeParameters, candidate, ts.isInJSFile(node) ? 2 : 0);
- typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext);
+ typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8, inferenceContext);
+ argCheckMode |= inferenceContext.flags & 4 ? 8 : 0;
}
- checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration));
+ checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) {
candidateForArgumentArityError = checkCandidate;
continue;
@@ -41538,23 +42071,23 @@
else {
checkCandidate = candidate;
}
- if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, false)) {
+ if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, false)) {
if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) {
candidateForArgumentError = checkCandidate;
}
continue;
}
- if (excludeArgument) {
- excludeArgument = undefined;
+ if (argCheckMode) {
+ argCheckMode = 0;
if (inferenceContext) {
- var typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext);
- checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration));
+ var typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
+ checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) {
candidateForArgumentArityError = checkCandidate;
continue;
}
}
- if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, false)) {
+ if (!checkApplicableSignature(node, args, checkCandidate, relation, argCheckMode, false)) {
if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) {
candidateForArgumentError = checkCandidate;
}
@@ -41567,18 +42100,6 @@
return undefined;
}
}
- function getExcludeArgument(args) {
- var excludeArgument;
- for (var i = 0; i < args.length; i++) {
- if (isContextSensitive(args[i])) {
- if (!excludeArgument) {
- excludeArgument = new Array(args.length);
- }
- excludeArgument[i] = true;
- }
- }
- return excludeArgument;
- }
function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray) {
ts.Debug.assert(candidates.length > 0);
return hasCandidatesOutArray || candidates.length === 1 || candidates.some(function (c) { return !!c.typeParameters; })
@@ -41650,7 +42171,7 @@
}
function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args) {
var inferenceContext = createInferenceContext(typeParameters, candidate, ts.isInJSFile(node) ? 2 : 0);
- var typeArgumentTypes = inferTypeArguments(node, candidate, args, getExcludeArgument(args), inferenceContext);
+ var typeArgumentTypes = inferTypeArguments(node, candidate, args, 4 | 8, inferenceContext);
return createSignatureInstantiation(candidate, typeArgumentTypes);
}
function getLongestCandidateIndex(candidates, argsCount) {
@@ -41669,7 +42190,7 @@
}
return maxParamsIndex;
}
- function resolveCallExpression(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveCallExpression(node, candidatesOutArray, checkMode) {
if (node.expression.kind === 98) {
var superType = checkSuperExpression(node.expression);
if (isTypeAny(superType)) {
@@ -41683,7 +42204,7 @@
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
if (baseTypeNode) {
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
- return resolveCall(node, baseConstructors, candidatesOutArray, isForSignatureHelp);
+ return resolveCall(node, baseConstructors, candidatesOutArray, checkMode);
}
}
return resolveUntypedCall(node);
@@ -41720,17 +42241,24 @@
}
return resolveErrorCall(node);
}
+ if (checkMode & 8 && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
+ skippedGenericFunction(node, checkMode);
+ return resolvingSignature;
+ }
if (callSignatures.some(function (sig) { return ts.isInJSFile(sig.declaration) && !!ts.getJSDocClassTag(sig.declaration); })) {
error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
return resolveErrorCall(node);
}
- return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp);
+ return resolveCall(node, callSignatures, candidatesOutArray, checkMode);
+ }
+ function isGenericFunctionReturningFunction(signature) {
+ return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
}
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144) ||
!numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 | 131072)) && isTypeAssignableTo(funcType, globalFunctionType);
}
- function resolveNewExpression(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveNewExpression(node, candidatesOutArray, checkMode) {
if (node.arguments && languageVersion < 1) {
var spreadIndex = getSpreadArgumentIndex(node.arguments);
if (spreadIndex >= 0) {
@@ -41761,11 +42289,11 @@
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
return resolveErrorCall(node);
}
- return resolveCall(node, constructSignatures, candidatesOutArray, isForSignatureHelp);
+ return resolveCall(node, constructSignatures, candidatesOutArray, checkMode);
}
var callSignatures = getSignaturesOfType(expressionType, 0);
if (callSignatures.length) {
- var signature = resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp);
+ var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode);
if (!noImplicitAny) {
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
@@ -41787,12 +42315,11 @@
var firstBase = baseTypes[0];
if (firstBase.flags & 2097152) {
var types = firstBase.types;
- var mixinCount = ts.countWhere(types, isMixinConstructorType);
+ var mixinFlags = findMixins(types);
var i = 0;
for (var _i = 0, _a = firstBase.types; _i < _a.length; _i++) {
var intersectionMember = _a[_i];
- i++;
- if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(intersectionMember)) {
+ if (!mixinFlags[i]) {
if (ts.getObjectFlags(intersectionMember) & (1 | 2)) {
if (intersectionMember.symbol === target) {
return true;
@@ -41802,6 +42329,7 @@
}
}
}
+ i++;
}
return false;
}
@@ -41843,7 +42371,7 @@
var diagnostic = error(node, (kind === 0 ?
ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures :
ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature), typeToString(apparentType));
- invocationErrorRecovery(apparentType, kind, relatedInformation ? addRelatedInfo(diagnostic, relatedInformation) : diagnostic);
+ invocationErrorRecovery(apparentType, kind, relatedInformation ? ts.addRelatedInfo(diagnostic, relatedInformation) : diagnostic);
}
function invocationErrorRecovery(apparentType, kind, diagnostic) {
if (!apparentType.symbol) {
@@ -41854,10 +42382,10 @@
var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind);
if (!sigs || !sigs.length)
return;
- addRelatedInfo(diagnostic, ts.createDiagnosticForNode(importNode, ts.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(importNode, ts.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));
}
}
- function resolveTaggedTemplateExpression(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
var tagType = checkExpression(node.tag);
var apparentType = getApparentType(tagType);
if (apparentType === errorType) {
@@ -41872,7 +42400,7 @@
invocationError(node, apparentType, 0);
return resolveErrorCall(node);
}
- return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp);
+ return resolveCall(node, callSignatures, candidatesOutArray, checkMode);
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
@@ -41891,7 +42419,7 @@
return ts.Debug.fail();
}
}
- function resolveDecorator(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveDecorator(node, candidatesOutArray, checkMode) {
var funcType = checkExpression(node.expression);
var apparentType = getApparentType(funcType);
if (apparentType === errorType) {
@@ -41916,7 +42444,7 @@
invocationErrorRecovery(apparentType, 0, diag);
return resolveErrorCall(node);
}
- return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp, headMessage);
+ return resolveCall(node, callSignatures, candidatesOutArray, checkMode, headMessage);
}
function createSignatureForJSXIntrinsic(node, result) {
var namespace = getJsxNamespaceAt(node);
@@ -41928,11 +42456,11 @@
parameterSymbol.type = result;
return createSignature(declaration, undefined, undefined, [parameterSymbol], typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, undefined, 1, false, false);
}
- function resolveJsxOpeningLikeElement(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode) {
if (isJsxIntrinsicIdentifier(node.tagName)) {
var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
var fakeSignature = createSignatureForJSXIntrinsic(node, result);
- checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined), result, node.tagName, node.attributes);
+ checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined, 0), result, node.tagName, node.attributes);
return fakeSignature;
}
var exprTypes = checkExpression(node.tagName);
@@ -41948,7 +42476,7 @@
error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
return resolveErrorCall(node);
}
- return resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp);
+ return resolveCall(node, signatures, candidatesOutArray, checkMode);
}
function isPotentiallyUncalledDecorator(decorator, signatures) {
return signatures.length && ts.every(signatures, function (signature) {
@@ -41957,32 +42485,33 @@
signature.parameters.length < getDecoratorArgumentCount(decorator, signature);
});
}
- function resolveSignature(node, candidatesOutArray, isForSignatureHelp) {
+ function resolveSignature(node, candidatesOutArray, checkMode) {
switch (node.kind) {
case 191:
- return resolveCallExpression(node, candidatesOutArray, isForSignatureHelp);
+ return resolveCallExpression(node, candidatesOutArray, checkMode);
case 192:
- return resolveNewExpression(node, candidatesOutArray, isForSignatureHelp);
+ return resolveNewExpression(node, candidatesOutArray, checkMode);
case 193:
- return resolveTaggedTemplateExpression(node, candidatesOutArray, isForSignatureHelp);
+ return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode);
case 152:
- return resolveDecorator(node, candidatesOutArray, isForSignatureHelp);
+ return resolveDecorator(node, candidatesOutArray, checkMode);
case 262:
case 261:
- return resolveJsxOpeningLikeElement(node, candidatesOutArray, isForSignatureHelp);
+ return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
}
throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
}
- function getResolvedSignature(node, candidatesOutArray, isForSignatureHelp) {
- if (isForSignatureHelp === void 0) { isForSignatureHelp = false; }
+ function getResolvedSignature(node, candidatesOutArray, checkMode) {
var links = getNodeLinks(node);
var cached = links.resolvedSignature;
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
return cached;
}
links.resolvedSignature = resolvingSignature;
- var result = resolveSignature(node, candidatesOutArray, isForSignatureHelp);
+ var result = resolveSignature(node, candidatesOutArray, checkMode || 0);
+ if (result !== resolvingSignature) {
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
+ }
return result;
}
function isJSConstructor(node) {
@@ -42047,10 +42576,13 @@
}
return links.inferredClassType;
}
- function checkCallExpression(node) {
+ function checkCallExpression(node, checkMode) {
if (!checkGrammarTypeArguments(node, node.typeArguments))
checkGrammarArguments(node.arguments);
- var signature = getResolvedSignature(node);
+ var signature = getResolvedSignature(node, undefined, checkMode);
+ if (signature === resolvingSignature) {
+ return silentNeverType;
+ }
if (node.expression.kind === 98) {
return voidType;
}
@@ -42142,7 +42674,7 @@
var anonymousSymbol = createSymbol(2048, "__type");
var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined);
anonymousSymbol.type = defaultContainingObject;
- synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, 0) : defaultContainingObject;
+ synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
}
else {
synthType.syntheticType = type;
@@ -42186,9 +42718,37 @@
function checkAssertion(node) {
return checkAssertionWorker(node, node.type, node.expression);
}
+ function isValidConstAssertionArgument(node) {
+ switch (node.kind) {
+ case 10:
+ case 14:
+ case 8:
+ case 9:
+ case 102:
+ case 87:
+ case 187:
+ case 188:
+ return true;
+ case 195:
+ return isValidConstAssertionArgument(node.expression);
+ case 202:
+ var op = node.operator;
+ var arg = node.operand;
+ return op === 39 && (arg.kind === 8 || arg.kind === 9) ||
+ op === 38 && arg.kind === 8;
+ }
+ return false;
+ }
function checkAssertionWorker(errNode, type, expression, checkMode) {
- var exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(expression, checkMode)));
+ var exprType = checkExpression(expression, checkMode);
+ if (ts.isConstTypeReference(type)) {
+ if (!isValidConstAssertionArgument(expression)) {
+ error(expression, ts.Diagnostics.A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal);
+ }
+ return getRegularTypeOfLiteralType(exprType);
+ }
checkSourceElement(type);
+ exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));
var targetType = getTypeFromTypeNode(type);
if (produceDiagnostics && targetType !== errorType) {
var widenedType = getWidenedType(exprType);
@@ -42227,7 +42787,7 @@
}
}
function checkImportMetaProperty(node) {
- if (languageVersion < 6 || moduleKind < ts.ModuleKind.ESNext) {
+ if (languageVersion < 7 || moduleKind < ts.ModuleKind.ESNext) {
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options);
}
var file = ts.getSourceFileOfNode(node);
@@ -42255,7 +42815,7 @@
if (isTupleType(restType)) {
var associatedNames = restType.target.associatedNames;
var index = pos - paramCount;
- return associatedNames ? associatedNames[index] : restParameter.escapedName + "_" + index;
+ return associatedNames && associatedNames[index] || restParameter.escapedName + "_" + index;
}
return restParameter.escapedName;
}
@@ -42269,32 +42829,33 @@
}
if (signature.hasRestParameter) {
var restType = getTypeOfSymbol(signature.parameters[paramCount]);
- if (isTupleType(restType)) {
- if (pos - paramCount < getLengthOfTupleType(restType)) {
- return restType.typeArguments[pos - paramCount];
- }
- return getRestTypeOfTupleType(restType);
+ var index = pos - paramCount;
+ if (!isTupleType(restType) || restType.target.hasRestElement || index < (restType.typeArguments || ts.emptyArray).length) {
+ return getIndexedAccessType(restType, getLiteralType(index));
}
- return getIndexTypeOfType(restType, 1);
}
return undefined;
}
function getRestTypeAtPosition(source, pos) {
var paramCount = getParameterCount(source);
var restType = getEffectiveRestType(source);
- if (restType && pos === paramCount - 1) {
+ var nonRestCount = paramCount - (restType ? 1 : 0);
+ if (restType && pos === nonRestCount) {
return restType;
}
- var start = restType ? Math.min(pos, paramCount - 1) : pos;
var types = [];
var names = [];
- for (var i = start; i < paramCount; i++) {
+ for (var i = pos; i < nonRestCount; i++) {
types.push(getTypeAtPosition(source, i));
names.push(getParameterNameAtPosition(source, i));
}
+ if (restType) {
+ types.push(getIndexedAccessType(restType, numberType));
+ names.push(getParameterNameAtPosition(source, nonRestCount));
+ }
var minArgumentCount = getMinArgumentCount(source);
- var minLength = minArgumentCount < start ? 0 : minArgumentCount - start;
- return createTupleType(types, minLength, !!restType, names);
+ var minLength = minArgumentCount < pos ? 0 : minArgumentCount - pos;
+ return createTupleType(types, minLength, !!restType, false, names);
}
function getParameterCount(signature) {
var length = signature.parameters.length;
@@ -42342,17 +42903,24 @@
function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {
return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;
}
- function inferFromAnnotatedParameters(signature, context, mapper) {
+ function inferFromAnnotatedParameters(signature, context, inferenceContext) {
var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);
for (var i = 0; i < len; i++) {
var declaration = signature.parameters[i].valueDeclaration;
if (declaration.type) {
var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);
if (typeNode) {
- inferTypes(mapper.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context, i));
+ inferTypes(inferenceContext.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context, i));
}
}
}
+ var restType = getEffectiveRestType(context);
+ if (restType && restType.flags & 262144) {
+ var instantiatedContext = instantiateSignature(context, inferenceContext.nonFixingMapper);
+ assignContextualParameterTypes(signature, instantiatedContext);
+ var restPos = getParameterCount(context) - 1;
+ inferTypes(inferenceContext.inferences, getRestTypeAtPosition(signature, restPos), restType);
+ }
}
function assignContextualParameterTypes(signature, context) {
signature.typeParameters = context.typeParameters;
@@ -42445,7 +43013,7 @@
var functionFlags = ts.getFunctionFlags(func);
var type;
if (func.body.kind !== 218) {
- type = checkExpressionCached(func.body, checkMode);
+ type = checkExpressionCached(func.body, checkMode && checkMode & ~8);
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
}
@@ -42590,7 +43158,7 @@
ts.forEachReturnStatement(func.body, function (returnStatement) {
var expr = returnStatement.expression;
if (expr) {
- var type = checkExpressionCached(expr, checkMode);
+ var type = checkExpressionCached(expr, checkMode && checkMode & ~8);
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
}
@@ -42659,7 +43227,7 @@
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
ts.Debug.assert(node.kind !== 156 || ts.isObjectLiteralMethod(node));
checkNodeDeferred(node);
- if (checkMode === 1 && isContextSensitive(node)) {
+ if (checkMode && checkMode & 4 && isContextSensitive(node)) {
if (!ts.getEffectiveReturnTypeNode(node) && hasContextSensitiveReturnExpression(node)) {
var links_1 = getNodeLinks(node);
if (links_1.contextFreeType) {
@@ -42668,7 +43236,7 @@
var returnType = getReturnTypeFromBody(node, checkMode);
var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, undefined, 0, false, false);
var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, undefined, undefined);
- returnOnlyType.flags |= 536870912;
+ returnOnlyType.objectFlags |= 524288;
return links_1.contextFreeType = returnOnlyType;
}
return anyFunctionType;
@@ -42689,12 +43257,12 @@
if (contextualSignature) {
var signature = getSignaturesOfType(type, 0)[0];
if (isContextSensitive(node)) {
- var contextualMapper = getContextualMapper(node);
- if (checkMode === 2) {
- inferFromAnnotatedParameters(signature, contextualSignature, contextualMapper);
+ var inferenceContext = getInferenceContext(node);
+ if (checkMode && checkMode & 2) {
+ inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
}
- var instantiatedContextualSignature = contextualMapper === identityMapper ?
- contextualSignature : instantiateSignature(contextualSignature, contextualMapper);
+ var instantiatedContextualSignature = inferenceContext ?
+ instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature;
assignContextualParameterTypes(signature, instantiatedContextualSignature);
}
if (!getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
@@ -42927,13 +43495,13 @@
return numberType;
}
function maybeTypeOfKind(type, kind) {
- if (type.flags & kind & ~134217728 || kind & 134217728 && isGenericMappedType(type)) {
+ if (type.flags & kind & ~131072 || kind & 131072 && isGenericMappedType(type)) {
return true;
}
if (type.flags & 3145728) {
var types = type.types;
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
- var t = types_15[_i];
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
+ var t = types_16[_i];
if (maybeTypeOfKind(t, kind)) {
return true;
}
@@ -43026,7 +43594,7 @@
return checkDestructuringAssignment(property.kind === 276 ? property : property.initializer, type);
}
else if (property.kind === 277) {
- if (languageVersion < 6) {
+ if (languageVersion < 7) {
checkExternalEmitHelpers(property, 4);
}
var nonRestNames = [];
@@ -43477,7 +44045,7 @@
}
if (node.asteriskToken) {
if ((functionFlags & 3) === 3 &&
- languageVersion < 6) {
+ languageVersion < 7) {
checkExternalEmitHelpers(node, 26624);
}
if ((functionFlags & 3) === 1 &&
@@ -43514,23 +44082,23 @@
}
return node;
}
- function checkExpressionWithContextualType(node, contextualType, contextualMapper) {
+ function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
var context = getContextNode(node);
var saveContextualType = context.contextualType;
- var saveContextualMapper = context.contextualMapper;
+ var saveInferenceContext = context.inferenceContext;
context.contextualType = contextualType;
- context.contextualMapper = contextualMapper;
- var checkMode = contextualMapper === identityMapper ? 1 :
- contextualMapper ? 2 : 3;
- var result = checkExpression(node, checkMode);
+ context.inferenceContext = inferenceContext;
+ var type = checkExpression(node, checkMode | 1 | (inferenceContext ? 2 : 0));
+ var result = maybeTypeOfKind(type, 2944) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node)) ?
+ getRegularTypeOfLiteralType(type) : type;
context.contextualType = saveContextualType;
- context.contextualMapper = saveContextualMapper;
+ context.inferenceContext = saveInferenceContext;
return result;
}
function checkExpressionCached(node, checkMode) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
- if (checkMode) {
+ if (checkMode && checkMode !== 0) {
return checkExpression(node, checkMode);
}
var saveFlowLoopStart = flowLoopStart;
@@ -43585,13 +44153,17 @@
}
return false;
}
- function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
- if (arguments.length === 2) {
- contextualType = getContextualType(node);
+ function isConstContext(node) {
+ var parent = node.parent;
+ return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) ||
+ (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) ||
+ (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent);
}
+ function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
var type = checkExpression(node, checkMode, forceTuple);
- return isTypeAssertion(node) ? type :
- getWidenedLiteralLikeTypeForContextualType(type, contextualType);
+ return isConstContext(node) ? getRegularTypeOfLiteralType(type) :
+ isTypeAssertion(node) ? type :
+ getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
}
function checkPropertyAssignment(node, checkMode) {
if (node.name.kind === 149) {
@@ -43608,20 +44180,112 @@
return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
}
function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) {
- if (checkMode === 2) {
+ if (checkMode && checkMode & (2 | 8)) {
var signature = getSingleCallSignature(type);
if (signature && signature.typeParameters) {
+ if (checkMode & 8) {
+ skippedGenericFunction(node, checkMode);
+ return anyFunctionType;
+ }
var contextualType = getApparentTypeOfContextualType(node);
if (contextualType) {
var contextualSignature = getSingleCallSignature(getNonNullableType(contextualType));
if (contextualSignature && !contextualSignature.typeParameters) {
- return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, getContextualMapper(node)));
+ var context = getInferenceContext(node);
+ var returnSignature = context.signature && getSingleCallSignature(getReturnTypeOfSignature(context.signature));
+ if (returnSignature && !returnSignature.typeParameters && !ts.every(context.inferences, hasInferenceCandidates)) {
+ var uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
+ var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
+ var inferences_2 = ts.map(context.inferences, function (info) { return createInferenceInfo(info.typeParameter); });
+ applyToParameterTypes(instantiatedSignature, contextualSignature, function (source, target) {
+ inferTypes(inferences_2, source, target, 0, true);
+ });
+ if (ts.some(inferences_2, hasInferenceCandidates)) {
+ applyToReturnTypes(instantiatedSignature, contextualSignature, function (source, target) {
+ inferTypes(inferences_2, source, target);
+ });
+ if (!hasOverlappingInferences(context.inferences, inferences_2)) {
+ mergeInferences(context.inferences, inferences_2);
+ context.inferredTypeParameters = ts.concatenate(context.inferredTypeParameters, uniqueTypeParameters);
+ return getOrCreateTypeFromSignature(instantiatedSignature);
+ }
+ }
+ }
+ return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
}
}
}
}
return type;
}
+ function skippedGenericFunction(node, checkMode) {
+ if (checkMode & 2) {
+ var context = getInferenceContext(node);
+ context.flags |= 4;
+ }
+ }
+ function hasInferenceCandidates(info) {
+ return !!(info.candidates || info.contraCandidates);
+ }
+ function hasOverlappingInferences(a, b) {
+ for (var i = 0; i < a.length; i++) {
+ if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function mergeInferences(target, source) {
+ for (var i = 0; i < target.length; i++) {
+ if (!hasInferenceCandidates(target[i]) && hasInferenceCandidates(source[i])) {
+ target[i] = source[i];
+ }
+ }
+ }
+ function getUniqueTypeParameters(context, typeParameters) {
+ var result = [];
+ var oldTypeParameters;
+ var newTypeParameters;
+ for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
+ var tp = typeParameters_2[_i];
+ var name = tp.symbol.escapedName;
+ if (hasTypeParameterByName(context.inferredTypeParameters, name) || hasTypeParameterByName(result, name)) {
+ var newName = getUniqueTypeParameterName(ts.concatenate(context.inferredTypeParameters, result), name);
+ var symbol = createSymbol(262144, newName);
+ var newTypeParameter = createTypeParameter(symbol);
+ newTypeParameter.target = tp;
+ oldTypeParameters = ts.append(oldTypeParameters, tp);
+ newTypeParameters = ts.append(newTypeParameters, newTypeParameter);
+ result.push(newTypeParameter);
+ }
+ else {
+ result.push(tp);
+ }
+ }
+ if (newTypeParameters) {
+ var mapper = createTypeMapper(oldTypeParameters, newTypeParameters);
+ for (var _a = 0, newTypeParameters_1 = newTypeParameters; _a < newTypeParameters_1.length; _a++) {
+ var tp = newTypeParameters_1[_a];
+ tp.mapper = mapper;
+ }
+ }
+ return result;
+ }
+ function hasTypeParameterByName(typeParameters, name) {
+ return ts.some(typeParameters, function (tp) { return tp.symbol.escapedName === name; });
+ }
+ function getUniqueTypeParameterName(typeParameters, baseName) {
+ var len = baseName.length;
+ while (len > 1 && baseName.charCodeAt(len - 1) >= 48 && baseName.charCodeAt(len - 1) <= 57)
+ len--;
+ var s = baseName.slice(0, len);
+ for (var index = 1; true; index++) {
+ var augmentedName = (s + index);
+ if (!hasTypeParameterByName(typeParameters, augmentedName)) {
+ return augmentedName;
+ }
+ }
+ }
function getTypeOfExpression(node, cache) {
var expr = ts.skipParentheses(node);
if (expr.kind === 191 && expr.expression.kind !== 98 && !ts.isRequireCall(expr, true) && !isSymbolOrSymbolForCall(expr)) {
@@ -43631,7 +44295,7 @@
return getReturnTypeOfSignature(signature);
}
}
- else if (expr.kind === 194 || expr.kind === 212) {
+ else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {
return getTypeFromTypeNode(expr.type);
}
return cache ? checkExpressionCached(node) : checkExpression(node);
@@ -43643,20 +44307,22 @@
}
var saveContextualType = node.contextualType;
node.contextualType = anyType;
- var type = links.contextFreeType = checkExpression(node, 1);
+ var type = links.contextFreeType = checkExpression(node, 4);
node.contextualType = saveContextualType;
return type;
}
function checkExpression(node, checkMode, forceTuple) {
- var type;
- if (node.kind === 148) {
- type = checkQualifiedName(node);
- }
- else {
+ var saveCurrentNode = currentNode;
+ currentNode = node;
var uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple);
- type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
- }
+ var type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
if (isConstEnumObjectType(type)) {
+ checkConstEnumAccess(node, type);
+ }
+ currentNode = saveCurrentNode;
+ return type;
+ }
+ function checkConstEnumAccess(node, type) {
var ok = (node.parent.kind === 189 && node.parent.expression === node) ||
(node.parent.kind === 190 && node.parent.expression === node) ||
((node.kind === 72 || node.kind === 148) && isInRightSideOfImportOrExportAssignment(node) ||
@@ -43664,8 +44330,13 @@
if (!ok) {
error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
}
+ if (compilerOptions.isolatedModules) {
+ ts.Debug.assert(!!(type.symbol.flags & 128));
+ var constEnumDeclaration = type.symbol.valueDeclaration;
+ if (constEnumDeclaration.flags & 4194304) {
+ error(node, ts.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided);
+ }
}
- return type;
}
function checkParenthesizedExpression(node, checkMode) {
var tag = ts.isInJSFile(node) ? ts.getJSDocTypeTag(node) : undefined;
@@ -43707,6 +44378,8 @@
return checkObjectLiteral(node, checkMode);
case 189:
return checkPropertyAccessExpression(node);
+ case 148:
+ return checkQualifiedName(node);
case 190:
return checkIndexedAccess(node);
case 191:
@@ -43714,7 +44387,7 @@
return checkImportCallExpression(node);
}
case 192:
- return checkCallExpression(node);
+ return checkCallExpression(node, checkMode);
case 193:
return checkTaggedTemplateExpression(node);
case 195:
@@ -43777,9 +44450,7 @@
checkSourceElement(node.constraint);
checkSourceElement(node.default);
var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));
- if (!hasNonCircularBaseConstraint(typeParameter)) {
- error(ts.getEffectiveConstraintOfTypeParameter(node), ts.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter));
- }
+ getBaseConstraintOfType(typeParameter);
if (!hasNonCircularTypeParameterDefault(typeParameter)) {
error(node.default, ts.Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter));
}
@@ -43815,7 +44486,7 @@
error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter);
}
}
- if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyArrayType)) {
+ if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isTypeAssignableTo(getTypeOfSymbol(node.symbol), anyReadonlyArrayType)) {
error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type);
}
}
@@ -43825,7 +44496,8 @@
error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
return;
}
- var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent));
+ var signature = getSignatureFromDeclaration(parent);
+ var typePredicate = getTypePredicateOfSignature(signature);
if (!typePredicate) {
return;
}
@@ -43836,12 +44508,12 @@
}
else {
if (typePredicate.parameterIndex >= 0) {
- if (parent.parameters[typePredicate.parameterIndex].dotDotDotToken) {
+ if (signature.hasRestParameter && typePredicate.parameterIndex === signature.parameters.length - 1) {
error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter);
}
else {
var leadingError = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); };
- checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, undefined, leadingError);
+ checkTypeAssignableTo(typePredicate.type, getTypeOfSymbol(signature.parameters[typePredicate.parameterIndex]), node.type, undefined, leadingError);
}
}
else if (parameterName) {
@@ -43904,7 +44576,7 @@
}
var functionFlags = ts.getFunctionFlags(node);
if (!(functionFlags & 4)) {
- if ((functionFlags & 3) === 3 && languageVersion < 6) {
+ if ((functionFlags & 3) === 3 && languageVersion < 7) {
checkExternalEmitHelpers(node, 6144);
}
if ((functionFlags & 3) === 2 && languageVersion < 4) {
@@ -43951,7 +44623,7 @@
checkAsyncFunctionReturnType(node, returnTypeNode);
}
}
- if (node.kind !== 162 && node.kind !== 289) {
+ if (node.kind !== 162 && node.kind !== 294) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -44549,7 +45221,7 @@
for (var _a = 0, signatures_6 = signatures; _a < signatures_6.length; _a++) {
var signature = signatures_6[_a];
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
- error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation);
+ ts.addRelatedInfo(error(signature.declaration, ts.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), ts.createDiagnosticForNode(bodyDeclaration, ts.Diagnostics.The_implementation_signature_is_declared_here));
break;
}
}
@@ -44610,8 +45282,8 @@
switch (d.kind) {
case 241:
case 242:
- case 304:
- case 297:
+ case 309:
+ case 302:
return 2;
case 244:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
@@ -44620,7 +45292,7 @@
case 240:
case 243:
return 2 | 1;
- case 279:
+ case 284:
return 2 | 1 | 4;
case 254:
if (!ts.isEntityNameExpression(d.expression)) {
@@ -44856,8 +45528,8 @@
}
function getEntityNameForDecoratorMetadataFromTypeList(types) {
var commonEntityName;
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
- var typeNode = types_16[_i];
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
+ var typeNode = types_17[_i];
while (typeNode.kind === 177) {
typeNode = typeNode.type;
}
@@ -45092,7 +45764,7 @@
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 279:
+ case 284:
case 244:
case 218:
case 246:
@@ -45181,8 +45853,8 @@
return;
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
var seenParentsWithEveryUnused = new ts.NodeSet();
- for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
- var typeParameter = typeParameters_2[_i];
+ for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) {
+ var typeParameter = typeParameters_3[_i];
if (!isTypeParameterUnused(typeParameter))
continue;
var name = ts.idText(typeParameter.name);
@@ -45420,7 +46092,7 @@
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 279 && ts.isExternalOrCommonJsModule(parent)) {
+ if (parent.kind === 284 && ts.isExternalOrCommonJsModule(parent)) {
error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name));
}
}
@@ -45432,7 +46104,7 @@
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 279 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
+