Update lib dom for 4.2 (#42067)

This commit is contained in:
Orta Therox
2021-01-04 21:26:56 +00:00
committed by GitHub
parent 9a2ae118f1
commit 222f29f2a5
35 changed files with 484 additions and 422 deletions
+280 -185
View File
@@ -594,6 +594,10 @@ interface ImageEncodeOptions {
type?: string;
}
interface ImportMeta {
url?: string;
}
interface InputEventInit extends UIEventInit {
data?: string | null;
inputType?: string;
@@ -611,7 +615,7 @@ interface IntersectionObserverEntryInit {
}
interface IntersectionObserverInit {
root?: Element | null;
root?: Element | Document | null;
rootMargin?: string;
threshold?: number | number[];
}
@@ -642,6 +646,8 @@ interface KeyAlgorithm {
}
interface KeyboardEventInit extends EventModifierInit {
/** @deprecated */
charCode?: number;
code?: string;
isComposing?: boolean;
key?: string;
@@ -1023,18 +1029,13 @@ interface PermissionDescriptor {
name: PermissionName;
}
interface PipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
preventClose?: boolean;
signal?: AbortSignal;
}
interface PointerEventInit extends MouseEventInit {
coalescedEvents?: PointerEvent[];
height?: number;
isPrimary?: boolean;
pointerId?: number;
pointerType?: string;
predictedEvents?: PointerEvent[];
pressure?: number;
tangentialPressure?: number;
tiltX?: number;
@@ -1138,7 +1139,16 @@ interface PushSubscriptionOptionsInit {
interface QueuingStrategy<T = any> {
highWaterMark?: number;
size?: QueuingStrategySizeCallback<T>;
size?: QueuingStrategySize<T>;
}
interface QueuingStrategyInit {
/**
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
*
* Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
*/
highWaterMark: number;
}
interface RTCAnswerOptions extends RTCOfferAnswerOptions {
@@ -1239,17 +1249,36 @@ interface RTCIceCandidatePair {
interface RTCIceCandidatePairStats extends RTCStats {
availableIncomingBitrate?: number;
availableOutgoingBitrate?: number;
bytesDiscardedOnSend?: number;
bytesReceived?: number;
bytesSent?: number;
circuitBreakerTriggerCount?: number;
consentExpiredTimestamp?: number;
consentRequestsSent?: number;
currentRoundTripTime?: number;
currentRtt?: number;
firstRequestTimestamp?: number;
lastPacketReceivedTimestamp?: number;
lastPacketSentTimestamp?: number;
lastRequestTimestamp?: number;
lastResponseTimestamp?: number;
localCandidateId?: string;
nominated?: boolean;
packetsDiscardedOnSend?: number;
packetsReceived?: number;
packetsSent?: number;
priority?: number;
readable?: boolean;
remoteCandidateId?: string;
roundTripTime?: number;
requestsReceived?: number;
requestsSent?: number;
responsesReceived?: number;
responsesSent?: number;
retransmissionsReceived?: number;
retransmissionsSent?: number;
state?: RTCStatsIceCandidatePairState;
totalRoundTripTime?: number;
totalRtt?: number;
transportId?: string;
writable?: boolean;
}
interface RTCIceGatherOptions {
@@ -1487,9 +1516,9 @@ interface RTCSsrcRange {
}
interface RTCStats {
id: string;
timestamp: number;
type: RTCStatsType;
id?: string;
timestamp?: number;
type?: RTCStatsType;
}
interface RTCStatsEventInit extends EventInit {
@@ -1507,25 +1536,43 @@ interface RTCTrackEventInit extends EventInit {
}
interface RTCTransportStats extends RTCStats {
activeConnection?: boolean;
bytesReceived?: number;
bytesSent?: number;
dtlsCipher?: string;
dtlsState?: RTCDtlsTransportState;
iceRole?: RTCIceRole;
localCertificateId?: string;
packetsReceived?: number;
packetsSent?: number;
remoteCertificateId?: string;
rtcpTransportStatsId?: string;
selectedCandidatePairChanges?: number;
selectedCandidatePairId?: string;
srtpCipher?: string;
tlsGroup?: string;
tlsVersion?: string;
}
interface ReadableStreamReadDoneResult<T> {
interface ReadableStreamDefaultReadDoneResult {
done: true;
value?: T;
value?: undefined;
}
interface ReadableStreamReadValueResult<T> {
interface ReadableStreamDefaultReadValueResult<T> {
done: false;
value: T;
}
interface ReadableWritablePair<R = any, W = any> {
readable: ReadableStream<R>;
/**
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*/
writable: WritableStream<W>;
}
interface RegistrationOptions {
scope?: string;
type?: WorkerType;
@@ -1587,6 +1634,10 @@ interface RequestInit {
window?: any;
}
interface ResizeObserverOptions {
box?: ResizeObserverBoxOptions;
}
interface ResponseInit {
headers?: HeadersInit;
status?: number;
@@ -1700,6 +1751,16 @@ interface ShareData {
url?: string;
}
interface SpeechRecognitionErrorEventInit extends EventInit {
error: SpeechRecognitionErrorCode;
message?: string;
}
interface SpeechRecognitionEventInit extends EventInit {
resultIndex?: number;
results: SpeechRecognitionResultList;
}
interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {
error: SpeechSynthesisErrorCode;
}
@@ -1746,6 +1807,30 @@ interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformat
arrayOfDomainStrings?: string[];
}
interface StreamPipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
/**
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*
* Errors and closures of the source and destination streams propagate as follows:
*
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
*
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
*
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
*
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
*
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
*/
preventClose?: boolean;
signal?: AbortSignal;
}
interface TextDecodeOptions {
stream?: boolean;
}
@@ -1789,10 +1874,10 @@ interface TrackEventInit extends EventInit {
}
interface Transformer<I = any, O = any> {
flush?: TransformStreamDefaultControllerCallback<O>;
flush?: TransformerFlushCallback<O>;
readableType?: undefined;
start?: TransformStreamDefaultControllerCallback<O>;
transform?: TransformStreamDefaultControllerTransformCallback<I, O>;
start?: TransformerStartCallback<O>;
transform?: TransformerTransformCallback<I, O>;
writableType?: undefined;
}
@@ -1812,26 +1897,18 @@ interface ULongRange {
min?: number;
}
interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: ReadableStreamErrorCallback;
pull?: ReadableByteStreamControllerCallback;
start?: ReadableByteStreamControllerCallback;
type: "bytes";
}
interface UnderlyingSink<W = any> {
abort?: WritableStreamErrorCallback;
close?: WritableStreamDefaultControllerCloseCallback;
start?: WritableStreamDefaultControllerStartCallback;
abort?: UnderlyingSinkAbortCallback;
close?: UnderlyingSinkCloseCallback;
start?: UnderlyingSinkStartCallback;
type?: undefined;
write?: WritableStreamDefaultControllerWriteCallback<W>;
write?: UnderlyingSinkWriteCallback<W>;
}
interface UnderlyingSource<R = any> {
cancel?: ReadableStreamErrorCallback;
pull?: ReadableStreamDefaultControllerCallback<R>;
start?: ReadableStreamDefaultControllerCallback<R>;
cancel?: UnderlyingSourceCancelCallback;
pull?: UnderlyingSourcePullCallback<R>;
start?: UnderlyingSourceStartCallback<R>;
type?: undefined;
}
@@ -2320,7 +2397,9 @@ declare var AudioParamMap: {
new(): AudioParamMap;
};
/** The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. */
/** The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed.
* @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet.
*/
interface AudioProcessingEvent extends Event {
readonly inputBuffer: AudioBuffer;
readonly outputBuffer: AudioBuffer;
@@ -2563,13 +2642,13 @@ declare var BroadcastChannel: {
/** This Streams API interface 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;
readonly highWaterMark: number;
readonly size: QueuingStrategySize<ArrayBufferView>;
}
declare var ByteLengthQueuingStrategy: {
prototype: ByteLengthQueuingStrategy;
new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
};
/** A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & dont need escaping as they normally do when inside a CDATA section. */
@@ -3614,13 +3693,13 @@ declare var ConvolverNode: {
/** This Streams API interface 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;
readonly highWaterMark: number;
readonly size: QueuingStrategySize;
}
declare var CountQueuingStrategy: {
prototype: CountQueuingStrategy;
new(options: { highWaterMark: number }): CountQueuingStrategy;
new(init: QueuingStrategyInit): CountQueuingStrategy;
};
interface Credential {
@@ -4680,6 +4759,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -4747,14 +4827,14 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
exitPointerLock(): void;
getAnimations(): Animation[];
/**
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
* @param elementId String that specifies the ID value. Case-insensitive.
* Returns a reference to the first object with the specified value of the ID attribute.
* @param elementId String that specifies the ID value.
*/
getElementById(elementId: string): HTMLElement | null;
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
/**
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
*/
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
/**
* Gets a collection of objects based on the value of the NAME or ID attribute.
* @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
@@ -4929,6 +5009,7 @@ interface DocumentEvent {
createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent;
createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent;
createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent;
createEvent(eventInterface: "SpeechRecognitionErrorEvent"): SpeechRecognitionErrorEvent;
createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent;
createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent;
createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent;
@@ -4949,7 +5030,7 @@ interface DocumentEvent {
/** 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 {
readonly ownerDocument: Document;
getElementById(elementId: string): HTMLElement | null;
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
}
declare var DocumentFragment: {
@@ -5057,7 +5138,6 @@ interface ElementEventMap {
/** 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, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable {
readonly assignedSlot: HTMLSlotElement | null;
readonly attributes: NamedNodeMap;
/**
* Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
@@ -5136,7 +5216,7 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
/**
* Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
*/
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
@@ -5612,24 +5692,7 @@ declare var GamepadPose: {
};
interface GenericTransformStream {
/**
* Returns a readable stream whose chunks are strings resulting from running encoding's decoder on the chunks written to writable.
*/
readonly readable: ReadableStream;
/**
* Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.
*
* Typically this will be used via the pipeThrough() method on a ReadableStream source.
*
* ```
* var decoder = new TextDecoderStream(encoding);
* byteReadable
* .pipeThrough(decoder)
* .pipeTo(textWritable);
* ```
*
* If the error mode is "fatal" and encoding's decoder returns error, both readable and writable will be errored with a TypeError.
*/
readonly writable: WritableStream;
}
@@ -5693,6 +5756,7 @@ interface GlobalEventHandlersEventMap {
"animationiteration": AnimationEvent;
"animationstart": AnimationEvent;
"auxclick": MouseEvent;
"beforeinput": InputEvent;
"blur": FocusEvent;
"cancel": Event;
"canplay": Event;
@@ -5700,6 +5764,9 @@ interface GlobalEventHandlersEventMap {
"change": Event;
"click": MouseEvent;
"close": Event;
"compositionend": CompositionEvent;
"compositionstart": CompositionEvent;
"compositionupdate": CompositionEvent;
"contextmenu": MouseEvent;
"cuechange": Event;
"dblclick": MouseEvent;
@@ -6604,6 +6671,7 @@ interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementC
readonly offsetParent: Element | null;
readonly offsetTop: number;
readonly offsetWidth: number;
readonly parentElement: HTMLElement | null;
spellcheck: boolean;
title: string;
translate: boolean;
@@ -7339,7 +7407,7 @@ interface HTMLInputElement extends HTMLElement {
* @param end The offset into the text field for the end of the selection.
* @param direction The direction in which the selection is performed.
*/
setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void;
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
/**
* Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.
* @param n Value to decrement the value by.
@@ -8635,7 +8703,6 @@ declare var HTMLTableElement: {
};
interface HTMLTableHeaderCellElement extends HTMLTableCellElement {
scope: string;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTableHeaderCellElement, 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: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -8846,7 +8913,7 @@ interface HTMLTextAreaElement extends HTMLElement {
* @param end The offset into the text field for the end of the selection.
* @param direction The direction in which the selection is performed.
*/
setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void;
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLTextAreaElement, 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: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -9613,7 +9680,7 @@ declare var InputEvent: {
/** 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 root: Element | Document | null;
readonly rootMargin: string;
readonly thresholds: ReadonlyArray<number>;
disconnect(): void;
@@ -10552,7 +10619,8 @@ declare var MouseEvent: {
new(type: string, eventInitDict?: MouseEventInit): MouseEvent;
};
/** Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes. */
/** Provides event properties that are specific to modifications to the Document Object Model (DOM) hierarchy and nodes.
* @deprecated DOM4 [DOM] provides a new mechanism using a MutationObserver interface which addresses the use cases that mutation events solve, but in a more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of the MutationEvent interface. */
interface MutationEvent extends Event {
readonly attrChange: number;
readonly attrName: string;
@@ -10797,7 +10865,7 @@ interface Node extends EventTarget {
/**
* Returns the parent element.
*/
readonly parentElement: HTMLElement | null;
readonly parentElement: Element | null;
/**
* Returns the parent.
*/
@@ -11030,7 +11098,6 @@ declare var NodeList: {
};
interface NodeListOf<TNode extends Node> extends NodeList {
length: number;
item(index: number): TNode;
/**
* Performs the specified action for each node in an list.
@@ -11056,7 +11123,7 @@ interface NonElementParentNode {
/**
* Returns the first element within node's descendants whose ID is elementId.
*/
getElementById(elementId: string): Element | null;
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
}
interface NotificationEventMap {
@@ -11539,7 +11606,9 @@ declare var PerformanceMeasure: {
new(): PerformanceMeasure;
};
/** The legacy PerformanceNavigation interface represents information about how the navigation to the current document was done. */
/** The legacy PerformanceNavigation interface represents information about how the navigation to the current document was done.
* @deprecated This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.
*/
interface PerformanceNavigation {
readonly redirectCount: number;
readonly type: number;
@@ -11629,7 +11698,9 @@ declare var PerformanceResourceTiming: {
new(): PerformanceResourceTiming;
};
/** 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. */
/** 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.
* @deprecated This interface is deprecated in the Navigation Timing Level 2 specification. Please use the PerformanceNavigationTiming interface instead.
*/
interface PerformanceTiming {
readonly connectEnd: number;
readonly connectStart: number;
@@ -11772,6 +11843,8 @@ interface PointerEvent extends MouseEvent {
readonly tiltY: number;
readonly twist: number;
readonly width: number;
getCoalescedEvents(): PointerEvent[];
getPredictedEvents(): PointerEvent[];
}
declare var PointerEvent: {
@@ -12475,64 +12548,26 @@ declare var Range: {
toString(): string;
};
interface ReadableByteStreamController {
readonly byobRequest: ReadableStreamBYOBRequest | undefined;
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: ArrayBufferView): void;
error(error?: any): void;
}
declare var ReadableByteStreamController: {
prototype: ReadableByteStreamController;
new(): ReadableByteStreamController;
};
/** This Streams API interface 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>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
getReader(): ReadableStreamDefaultReader<R>;
pipeThrough<T>({ writable, readable }: { writable: WritableStream<R>, readable: ReadableStream<T> }, options?: PipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: PipeOptions): Promise<void>;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
}
declare var ReadableStream: {
prototype: ReadableStream;
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream<Uint8Array>;
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
};
interface ReadableStreamBYOBReader {
readonly closed: Promise<void>;
cancel(reason?: any): Promise<void>;
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
releaseLock(): void;
}
declare var ReadableStreamBYOBReader: {
prototype: ReadableStreamBYOBReader;
new(): ReadableStreamBYOBReader;
};
interface ReadableStreamBYOBRequest {
readonly view: ArrayBufferView;
respond(bytesWritten: number): void;
respondWithNewView(view: ArrayBufferView): void;
}
declare var ReadableStreamBYOBRequest: {
prototype: ReadableStreamBYOBRequest;
new(): ReadableStreamBYOBRequest;
};
interface ReadableStreamDefaultController<R = any> {
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: R): void;
error(error?: any): void;
error(e?: any): void;
}
declare var ReadableStreamDefaultController: {
@@ -12540,29 +12575,21 @@ declare var ReadableStreamDefaultController: {
new(): ReadableStreamDefaultController;
};
interface ReadableStreamDefaultReader<R = any> {
readonly closed: Promise<void>;
cancel(reason?: any): Promise<void>;
read(): Promise<ReadableStreamReadResult<R>>;
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
releaseLock(): void;
}
declare var ReadableStreamDefaultReader: {
prototype: ReadableStreamDefaultReader;
new(): ReadableStreamDefaultReader;
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
};
interface ReadableStreamReader<R = any> {
cancel(): Promise<void>;
read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void;
interface ReadableStreamGenericReader {
readonly closed: Promise<undefined>;
cancel(reason?: any): Promise<void>;
}
declare var ReadableStreamReader: {
prototype: ReadableStreamReader;
new(): ReadableStreamReader;
};
/** This Fetch API interface represents a resource request. */
interface Request extends Body {
/**
@@ -12633,6 +12660,39 @@ declare var Request: {
new(input: RequestInfo, init?: RequestInit): Request;
};
interface ResizeObserver {
disconnect(): void;
observe(target: Element, options?: ResizeObserverOptions): void;
unobserve(target: Element): void;
}
declare var ResizeObserver: {
prototype: ResizeObserver;
new(callback: ResizeObserverCallback): ResizeObserver;
};
interface ResizeObserverEntry {
readonly borderBoxSize: ReadonlyArray<ResizeObserverSize>;
readonly contentBoxSize: ReadonlyArray<ResizeObserverSize>;
readonly contentRect: DOMRectReadOnly;
readonly target: Element;
}
declare var ResizeObserverEntry: {
prototype: ResizeObserverEntry;
new(): ResizeObserverEntry;
};
interface ResizeObserverSize {
readonly blockSize: number;
readonly inlineSize: number;
}
declare var ResizeObserverSize: {
prototype: ResizeObserverSize;
new(): ResizeObserverSize;
};
/** This Fetch API interface represents the response to a request. */
interface Response extends Body {
readonly headers: Headers;
@@ -12992,7 +13052,9 @@ interface SVGElement extends Element, DocumentAndElementEventHandlers, DocumentA
/** @deprecated */
readonly className: any;
readonly ownerSVGElement: SVGSVGElement | null;
readonly parentElement: SVGElement | null;
readonly viewportElement: SVGElement | null;
getElementsByClassName<E extends Element = SVGElement>(classNames: string): HTMLCollectionOf<E>;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -13580,6 +13642,7 @@ interface SVGForeignObjectElement extends SVGGraphicsElement {
readonly width: SVGAnimatedLength;
readonly x: SVGAnimatedLength;
readonly y: SVGAnimatedLength;
getElementsByClassName<E extends Element = HTMLElement>(classNames: string): HTMLCollectionOf<E>;
addEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof SVGElementEventMap>(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -14383,7 +14446,7 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB
forceRedraw(): void;
getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;
getCurrentTime(): number;
getElementById(elementId: string): Element;
getElementById<E extends Element = HTMLElement>(elementId: string): E | null;
getEnclosureList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
getIntersectionList(rect: SVGRect, referenceElement: SVGElement | null): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
pauseAnimations(): void;
@@ -14457,7 +14520,7 @@ declare var SVGStringList: {
};
/** Corresponds to the SVG <style> element. */
interface SVGStyleElement extends SVGElement {
interface SVGStyleElement extends SVGElement, LinkStyle {
disabled: boolean;
media: string;
title: string;
@@ -14811,7 +14874,9 @@ interface ScriptProcessorNodeEventMap {
"audioprocess": AudioProcessingEvent;
}
/** Allows the generation, processing, or analyzing of audio using JavaScript. */
/** Allows the generation, processing, or analyzing of audio using JavaScript.
* @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and was replaced by AudioWorklet (see AudioWorkletNode).
*/
interface ScriptProcessorNode extends AudioNode {
/** @deprecated */
readonly bufferSize: number;
@@ -14922,7 +14987,7 @@ interface ServiceWorkerContainer extends EventTarget {
readonly ready: Promise<ServiceWorkerRegistration>;
getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;
getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;
register(scriptURL: string, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
register(scriptURL: string | URL, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
startMessages(): void;
addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -14935,7 +15000,9 @@ declare var ServiceWorkerContainer: {
new(): ServiceWorkerContainer;
};
/** This ServiceWorker API interface 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. */
/** This ServiceWorker API interface 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.
* @deprecated In modern browsers, this interface has been deprecated. Service worker messages will now use the MessageEvent interface, for consistency with other web messaging features.
*/
interface ServiceWorkerMessageEvent extends Event {
readonly data: any;
readonly lastEventId: string;
@@ -15096,7 +15163,7 @@ interface SpeechRecognitionEventMap {
"audioend": Event;
"audiostart": Event;
"end": Event;
"error": ErrorEvent;
"error": SpeechRecognitionErrorEvent;
"nomatch": SpeechRecognitionEvent;
"result": SpeechRecognitionEvent;
"soundend": Event;
@@ -15115,7 +15182,7 @@ interface SpeechRecognition extends EventTarget {
onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
onend: ((this: SpeechRecognition, ev: Event) => any) | null;
onerror: ((this: SpeechRecognition, ev: ErrorEvent) => any) | null;
onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | null;
onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
@@ -15147,6 +15214,16 @@ declare var SpeechRecognitionAlternative: {
new(): SpeechRecognitionAlternative;
};
interface SpeechRecognitionErrorEvent extends Event {
readonly error: SpeechRecognitionErrorCode;
readonly message: string;
}
declare var SpeechRecognitionErrorEvent: {
prototype: SpeechRecognitionErrorEvent;
new(type: string, eventInitDict: SpeechRecognitionErrorEventInit): SpeechRecognitionErrorEvent;
};
interface SpeechRecognitionEvent extends Event {
readonly resultIndex: number;
readonly results: SpeechRecognitionResultList;
@@ -15154,7 +15231,7 @@ interface SpeechRecognitionEvent extends Event {
declare var SpeechRecognitionEvent: {
prototype: SpeechRecognitionEvent;
new(): SpeechRecognitionEvent;
new(type: string, eventInitDict: SpeechRecognitionEventInit): SpeechRecognitionEvent;
};
interface SpeechRecognitionResult {
@@ -15470,14 +15547,14 @@ declare var Text: {
/** 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 extends TextDecoderCommon {
/**
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented stream. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
*
* ```
* var string = "", decoder = new TextDecoder(encoding), buffer;
* while(buffer = next_chunk()) {
* string += decoder.decode(buffer, {stream:true});
* }
* string += decoder.decode(); // end-of-stream
* string += decoder.decode(); // end-of-queue
* ```
*
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
@@ -15496,11 +15573,11 @@ interface TextDecoderCommon {
*/
readonly encoding: string;
/**
* Returns true if error mode is "fatal", and false otherwise.
* Returns true if error mode is "fatal", otherwise false.
*/
readonly fatal: boolean;
/**
* Returns true if ignore BOM flag is set, and false otherwise.
* Returns the value of ignore BOM.
*/
readonly ignoreBOM: boolean;
}
@@ -15522,7 +15599,7 @@ interface TextEncoder extends TextEncoderCommon {
*/
encode(input?: string): Uint8Array;
/**
* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.
* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
*/
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
}
@@ -18377,6 +18454,8 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler
"ended": Event;
"error": ErrorEvent;
"focus": FocusEvent;
"gamepadconnected": GamepadEvent;
"gamepaddisconnected": GamepadEvent;
"hashchange": HashChangeEvent;
"input": Event;
"invalid": Event;
@@ -18462,7 +18541,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
readonly event: Event | undefined;
/** @deprecated */
readonly external: External;
readonly frameElement: Element;
readonly frameElement: Element | null;
readonly frames: Window;
readonly history: History;
readonly innerHeight: number;
@@ -18480,6 +18559,8 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;
ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;
ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null;
ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null;
ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null;
onmousewheel: ((this: Window, ev: Event) => any) | null;
onmsgesturechange: ((this: Window, ev: Event) => any) | null;
onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;
@@ -18701,7 +18782,7 @@ declare var WritableStream: {
/** This Streams API interface 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;
error(e?: any): void;
}
declare var WritableStreamDefaultController: {
@@ -18711,9 +18792,9 @@ declare var WritableStreamDefaultController: {
/** This Streams API interface 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 closed: Promise<undefined>;
readonly desiredSize: number | null;
readonly ready: Promise<void>;
readonly ready: Promise<undefined>;
abort(reason?: any): Promise<void>;
close(): Promise<void>;
releaseLock(): void;
@@ -18722,7 +18803,7 @@ interface WritableStreamDefaultWriter<W = any> {
declare var WritableStreamDefaultWriter: {
prototype: WritableStreamDefaultWriter;
new(): WritableStreamDefaultWriter;
new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
};
/** 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. */
@@ -19234,7 +19315,7 @@ interface PositionErrorCallback {
(positionError: GeolocationPositionError): void;
}
interface QueuingStrategySizeCallback<T = any> {
interface QueuingStrategySize<T = any> {
(chunk: T): number;
}
@@ -19250,46 +19331,54 @@ interface RTCStatsCallback {
(report: RTCStatsReport): void;
}
interface ReadableByteStreamControllerCallback {
(controller: ReadableByteStreamController): void | PromiseLike<void>;
interface ResizeObserverCallback {
(entries: ResizeObserverEntry[], observer: ResizeObserver): void;
}
interface ReadableStreamDefaultControllerCallback<R> {
(controller: ReadableStreamDefaultController<R>): void | PromiseLike<void>;
}
interface ReadableStreamErrorCallback {
(reason: any): void | PromiseLike<void>;
}
interface TransformStreamDefaultControllerCallback<O> {
interface TransformerFlushCallback<O> {
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface TransformStreamDefaultControllerTransformCallback<I, O> {
interface TransformerStartCallback<O> {
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface TransformerTransformCallback<I, O> {
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface UnderlyingSinkAbortCallback {
(reason: any): void | PromiseLike<void>;
}
interface UnderlyingSinkCloseCallback {
(): void | PromiseLike<void>;
}
interface UnderlyingSinkStartCallback {
(controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface UnderlyingSinkWriteCallback<W> {
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface UnderlyingSourceCancelCallback {
(reason: any): void | PromiseLike<void>;
}
interface UnderlyingSourcePullCallback<R> {
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
}
interface UnderlyingSourceStartCallback<R> {
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
}
interface VoidFunction {
(): void;
}
interface WritableStreamDefaultControllerCloseCallback {
(): void | PromiseLike<void>;
}
interface WritableStreamDefaultControllerStartCallback {
(controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface WritableStreamDefaultControllerWriteCallback<W> {
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface WritableStreamErrorCallback {
(reason: any): void | PromiseLike<void>;
}
interface HTMLElementTagNameMap {
"a": HTMLAnchorElement;
"abbr": HTMLElement;
@@ -19501,7 +19590,7 @@ declare var document: Document;
declare var event: Event | undefined;
/** @deprecated */
declare var external: External;
declare var frameElement: Element;
declare var frameElement: Element | null;
declare var frames: Window;
declare var history: History;
declare var innerHeight: number;
@@ -19520,6 +19609,8 @@ declare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;
declare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;
declare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;
declare var ondeviceorientationabsolute: ((this: Window, ev: DeviceOrientationEvent) => any) | null;
declare var ongamepadconnected: ((this: Window, ev: GamepadEvent) => any) | null;
declare var ongamepaddisconnected: ((this: Window, ev: GamepadEvent) => any) | null;
declare var onmousewheel: ((this: Window, ev: Event) => any) | null;
declare var onmsgesturechange: ((this: Window, ev: Event) => any) | null;
declare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;
@@ -19939,7 +20030,8 @@ type ConstrainDouble = number | ConstrainDoubleRange;
type ConstrainBoolean = boolean | ConstrainBooleanParameters;
type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
type PerformanceEntryList = PerformanceEntry[];
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type VibratePattern = number | number[];
type COSEAlgorithmIdentifier = number;
type UvmEntry = number[];
@@ -19978,6 +20070,7 @@ type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
/** @deprecated */
type MouseWheelEvent = WheelEvent;
type WindowProxy = Window;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type AlignSetting = "center" | "end" | "left" | "right" | "start";
type AnimationPlayState = "finished" | "idle" | "paused" | "running";
type AppendMode = "segments" | "sequence";
@@ -20049,7 +20142,7 @@ type OverSampleType = "2x" | "4x" | "none";
type PanningModelType = "HRTF" | "equalpower";
type PaymentComplete = "fail" | "success" | "unknown";
type PaymentShippingType = "delivery" | "pickup" | "shipping";
type PermissionName = "accelerometer" | "ambient-light-sensor" | "background-sync" | "bluetooth" | "camera" | "clipboard" | "device-info" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "notifications" | "persistent-storage" | "push" | "speaker";
type PermissionName = "accelerometer" | "ambient-light-sensor" | "background-fetch" | "background-sync" | "bluetooth" | "camera" | "clipboard-read" | "clipboard-write" | "device-info" | "display-capture" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "nfc" | "notifications" | "persistent-storage" | "push" | "speaker";
type PermissionState = "denied" | "granted" | "prompt";
type PlaybackDirection = "alternate" | "alternate-reverse" | "normal" | "reverse";
type PositionAlignSetting = "auto" | "center" | "line-left" | "line-right";
@@ -20083,9 +20176,9 @@ type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendre
type RTCSctpTransportState = "closed" | "connected" | "connecting";
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";
type RTCStatsIceCandidatePairState = "cancelled" | "failed" | "frozen" | "inprogress" | "succeeded" | "waiting";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "succeeded" | "waiting";
type RTCStatsIceCandidateType = "host" | "peerreflexive" | "relayed" | "serverreflexive";
type RTCStatsType = "candidatepair" | "datachannel" | "inboundrtp" | "localcandidate" | "outboundrtp" | "remotecandidate" | "session" | "track" | "transport";
type RTCStatsType = "candidate-pair" | "certificate" | "codec" | "csrc" | "data-channel" | "ice-server" | "inbound-rtp" | "local-candidate" | "media-source" | "outbound-rtp" | "peer-connection" | "receiver" | "remote-candidate" | "remote-inbound-rtp" | "remote-outbound-rtp" | "sctp-transport" | "sender" | "stream" | "track" | "transceiver" | "transport";
type ReadyState = "closed" | "ended" | "open";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
@@ -20094,6 +20187,7 @@ type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" |
type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";
type RequestRedirect = "error" | "follow" | "manual";
type ResidentKeyRequirement = "discouraged" | "preferred" | "required";
type ResizeObserverBoxOptions = "border-box" | "content-box" | "device-pixel-content-box";
type ResizeQuality = "high" | "low" | "medium" | "pixelated";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ScopedCredentialType = "ScopedCred";
@@ -20105,6 +20199,7 @@ type SelectionMode = "end" | "preserve" | "select" | "start";
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
type ShadowRootMode = "closed" | "open";
type SpeechRecognitionErrorCode = "aborted" | "audio-capture" | "bad-grammar" | "language-not-supported" | "network" | "no-speech" | "not-allowed" | "service-not-allowed";
type SpeechSynthesisErrorCode = "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable";
type TextTrackKind = "captions" | "chapters" | "descriptions" | "metadata" | "subtitles";
type TextTrackMode = "disabled" | "hidden" | "showing";
+126 -151
View File
@@ -243,6 +243,10 @@ interface ImageEncodeOptions {
type?: string;
}
interface ImportMeta {
url?: string;
}
interface JsonWebKey {
alg?: string;
crv?: string;
@@ -334,13 +338,6 @@ interface PermissionDescriptor {
name: PermissionName;
}
interface PipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
preventClose?: boolean;
signal?: AbortSignal;
}
interface PostMessageOptions {
transfer?: any[];
}
@@ -383,19 +380,38 @@ interface PushSubscriptionOptionsInit {
interface QueuingStrategy<T = any> {
highWaterMark?: number;
size?: QueuingStrategySizeCallback<T>;
size?: QueuingStrategySize<T>;
}
interface ReadableStreamReadDoneResult<T> {
interface QueuingStrategyInit {
/**
* Creates a new ByteLengthQueuingStrategy with the provided high water mark.
*
* Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.
*/
highWaterMark: number;
}
interface ReadableStreamDefaultReadDoneResult {
done: true;
value?: T;
value?: undefined;
}
interface ReadableStreamReadValueResult<T> {
interface ReadableStreamDefaultReadValueResult<T> {
done: false;
value: T;
}
interface ReadableWritablePair<R = any, W = any> {
readable: ReadableStream<R>;
/**
* Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*/
writable: WritableStream<W>;
}
interface RegistrationOptions {
scope?: string;
type?: WorkerType;
@@ -495,6 +511,30 @@ interface StorageEstimate {
usage?: number;
}
interface StreamPipeOptions {
preventAbort?: boolean;
preventCancel?: boolean;
/**
* Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
*
* Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.
*
* Errors and closures of the source and destination streams propagate as follows:
*
* An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.
*
* An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.
*
* When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.
*
* If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
*
* The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.
*/
preventClose?: boolean;
signal?: AbortSignal;
}
interface SyncEventInit extends ExtendableEventInit {
lastChance?: boolean;
tag: string;
@@ -515,33 +555,25 @@ interface TextEncoderEncodeIntoResult {
}
interface Transformer<I = any, O = any> {
flush?: TransformStreamDefaultControllerCallback<O>;
flush?: TransformerFlushCallback<O>;
readableType?: undefined;
start?: TransformStreamDefaultControllerCallback<O>;
transform?: TransformStreamDefaultControllerTransformCallback<I, O>;
start?: TransformerStartCallback<O>;
transform?: TransformerTransformCallback<I, O>;
writableType?: undefined;
}
interface UnderlyingByteSource {
autoAllocateChunkSize?: number;
cancel?: ReadableStreamErrorCallback;
pull?: ReadableByteStreamControllerCallback;
start?: ReadableByteStreamControllerCallback;
type: "bytes";
}
interface UnderlyingSink<W = any> {
abort?: WritableStreamErrorCallback;
close?: WritableStreamDefaultControllerCloseCallback;
start?: WritableStreamDefaultControllerStartCallback;
abort?: UnderlyingSinkAbortCallback;
close?: UnderlyingSinkCloseCallback;
start?: UnderlyingSinkStartCallback;
type?: undefined;
write?: WritableStreamDefaultControllerWriteCallback<W>;
write?: UnderlyingSinkWriteCallback<W>;
}
interface UnderlyingSource<R = any> {
cancel?: ReadableStreamErrorCallback;
pull?: ReadableStreamDefaultControllerCallback<R>;
start?: ReadableStreamDefaultControllerCallback<R>;
cancel?: UnderlyingSourceCancelCallback;
pull?: UnderlyingSourcePullCallback<R>;
start?: UnderlyingSourceStartCallback<R>;
type?: undefined;
}
@@ -701,13 +733,13 @@ declare var BroadcastChannel: {
/** This Streams API interface 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;
readonly highWaterMark: number;
readonly size: QueuingStrategySize<ArrayBufferView>;
}
declare var ByteLengthQueuingStrategy: {
prototype: ByteLengthQueuingStrategy;
new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;
new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
};
/** 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. */
@@ -900,7 +932,7 @@ declare var Client: {
interface Clients {
claim(): Promise<void>;
get(id: string): Promise<Client | undefined>;
matchAll(options?: ClientQueryOptions): Promise<ReadonlyArray<Client>>;
matchAll<T extends ClientQueryOptions>(options?: T): Promise<ReadonlyArray<T["type"] extends "window" ? WindowClient : Client>>;
openWindow(url: string): Promise<WindowClient | null>;
}
@@ -941,13 +973,13 @@ interface ConcatParams extends Algorithm {
/** This Streams API interface 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;
readonly highWaterMark: number;
readonly size: QueuingStrategySize;
}
declare var CountQueuingStrategy: {
prototype: CountQueuingStrategy;
new(options: { highWaterMark: number }): CountQueuingStrategy;
new(init: QueuingStrategyInit): CountQueuingStrategy;
};
/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
@@ -1624,24 +1656,7 @@ declare var FormData: {
};
interface GenericTransformStream {
/**
* Returns a readable stream whose chunks are strings resulting from running encoding's decoder on the chunks written to writable.
*/
readonly readable: ReadableStream;
/**
* Returns a writable stream which accepts [AllowShared] BufferSource chunks and runs them through encoding's decoder before making them available to readable.
*
* Typically this will be used via the pipeThrough() method on a ReadableStream source.
*
* ```
* var decoder = new TextDecoderStream(encoding);
* byteReadable
* .pipeThrough(decoder)
* .pipeTo(textWritable);
* ```
*
* If the error mode is "fatal" and encoding's decoder returns error, both readable and writable will be errored with a TypeError.
*/
readonly writable: WritableStream;
}
@@ -2707,64 +2722,26 @@ declare var PushSubscriptionOptions: {
new(): PushSubscriptionOptions;
};
interface ReadableByteStreamController {
readonly byobRequest: ReadableStreamBYOBRequest | undefined;
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: ArrayBufferView): void;
error(error?: any): void;
}
declare var ReadableByteStreamController: {
prototype: ReadableByteStreamController;
new(): ReadableByteStreamController;
};
/** This Streams API interface 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>;
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
getReader(): ReadableStreamDefaultReader<R>;
pipeThrough<T>({ writable, readable }: { writable: WritableStream<R>, readable: ReadableStream<T> }, options?: PipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: PipeOptions): Promise<void>;
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
pipeTo(dest: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
tee(): [ReadableStream<R>, ReadableStream<R>];
}
declare var ReadableStream: {
prototype: ReadableStream;
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream<Uint8Array>;
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
};
interface ReadableStreamBYOBReader {
readonly closed: Promise<void>;
cancel(reason?: any): Promise<void>;
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
releaseLock(): void;
}
declare var ReadableStreamBYOBReader: {
prototype: ReadableStreamBYOBReader;
new(): ReadableStreamBYOBReader;
};
interface ReadableStreamBYOBRequest {
readonly view: ArrayBufferView;
respond(bytesWritten: number): void;
respondWithNewView(view: ArrayBufferView): void;
}
declare var ReadableStreamBYOBRequest: {
prototype: ReadableStreamBYOBRequest;
new(): ReadableStreamBYOBRequest;
};
interface ReadableStreamDefaultController<R = any> {
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: R): void;
error(error?: any): void;
error(e?: any): void;
}
declare var ReadableStreamDefaultController: {
@@ -2772,29 +2749,21 @@ declare var ReadableStreamDefaultController: {
new(): ReadableStreamDefaultController;
};
interface ReadableStreamDefaultReader<R = any> {
readonly closed: Promise<void>;
cancel(reason?: any): Promise<void>;
read(): Promise<ReadableStreamReadResult<R>>;
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
releaseLock(): void;
}
declare var ReadableStreamDefaultReader: {
prototype: ReadableStreamDefaultReader;
new(): ReadableStreamDefaultReader;
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
};
interface ReadableStreamReader<R = any> {
cancel(): Promise<void>;
read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void;
interface ReadableStreamGenericReader {
readonly closed: Promise<undefined>;
cancel(reason?: any): Promise<void>;
}
declare var ReadableStreamReader: {
prototype: ReadableStreamReader;
new(): ReadableStreamReader;
};
/** This Fetch API interface represents a resource request. */
interface Request extends Body {
/**
@@ -2922,7 +2891,7 @@ interface ServiceWorkerContainer extends EventTarget {
readonly ready: Promise<ServiceWorkerRegistration>;
getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;
getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;
register(scriptURL: string, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
register(scriptURL: string | URL, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
startMessages(): void;
addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -3108,14 +3077,14 @@ declare var SyncManager: {
/** 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 extends TextDecoderCommon {
/**
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented stream. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
* Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
*
* ```
* var string = "", decoder = new TextDecoder(encoding), buffer;
* while(buffer = next_chunk()) {
* string += decoder.decode(buffer, {stream:true});
* }
* string += decoder.decode(); // end-of-stream
* string += decoder.decode(); // end-of-queue
* ```
*
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
@@ -3134,11 +3103,11 @@ interface TextDecoderCommon {
*/
readonly encoding: string;
/**
* Returns true if error mode is "fatal", and false otherwise.
* Returns true if error mode is "fatal", otherwise false.
*/
readonly fatal: boolean;
/**
* Returns true if ignore BOM flag is set, and false otherwise.
* Returns the value of ignore BOM.
*/
readonly ignoreBOM: boolean;
}
@@ -3160,7 +3129,7 @@ interface TextEncoder extends TextEncoderCommon {
*/
encode(input?: string): Uint8Array;
/**
* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.
* Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination.
*/
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
}
@@ -5539,7 +5508,7 @@ declare var WritableStream: {
/** This Streams API interface 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;
error(e?: any): void;
}
declare var WritableStreamDefaultController: {
@@ -5549,9 +5518,9 @@ declare var WritableStreamDefaultController: {
/** This Streams API interface 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 closed: Promise<undefined>;
readonly desiredSize: number | null;
readonly ready: Promise<void>;
readonly ready: Promise<undefined>;
abort(reason?: any): Promise<void>;
close(): Promise<void>;
releaseLock(): void;
@@ -5560,7 +5529,7 @@ interface WritableStreamDefaultWriter<W = any> {
declare var WritableStreamDefaultWriter: {
prototype: WritableStreamDefaultWriter;
new(): WritableStreamDefaultWriter;
new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
};
interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
@@ -5856,50 +5825,54 @@ interface PerformanceObserverCallback {
(entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
}
interface QueuingStrategySizeCallback<T = any> {
interface QueuingStrategySize<T = any> {
(chunk: T): number;
}
interface ReadableByteStreamControllerCallback {
(controller: ReadableByteStreamController): void | PromiseLike<void>;
}
interface ReadableStreamDefaultControllerCallback<R> {
(controller: ReadableStreamDefaultController<R>): void | PromiseLike<void>;
}
interface ReadableStreamErrorCallback {
(reason: any): void | PromiseLike<void>;
}
interface TransformStreamDefaultControllerCallback<O> {
interface TransformerFlushCallback<O> {
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface TransformStreamDefaultControllerTransformCallback<I, O> {
interface TransformerStartCallback<O> {
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface TransformerTransformCallback<I, O> {
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}
interface UnderlyingSinkAbortCallback {
(reason: any): void | PromiseLike<void>;
}
interface UnderlyingSinkCloseCallback {
(): void | PromiseLike<void>;
}
interface UnderlyingSinkStartCallback {
(controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface UnderlyingSinkWriteCallback<W> {
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface UnderlyingSourceCancelCallback {
(reason: any): void | PromiseLike<void>;
}
interface UnderlyingSourcePullCallback<R> {
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
}
interface UnderlyingSourceStartCallback<R> {
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
}
interface VoidFunction {
(): void;
}
interface WritableStreamDefaultControllerCloseCallback {
(): void | PromiseLike<void>;
}
interface WritableStreamDefaultControllerStartCallback {
(controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface WritableStreamDefaultControllerWriteCallback<W> {
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
}
interface WritableStreamErrorCallback {
(reason: any): void | PromiseLike<void>;
}
/**
* Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
*/
@@ -5977,7 +5950,8 @@ type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type TimerHandler = string | Function;
type PerformanceEntryList = PerformanceEntry[];
type PushMessageDataInit = BufferSource | string;
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type VibratePattern = number | number[];
type AlgorithmIdentifier = string | Algorithm;
type HashAlgorithmIdentifier = AlgorithmIdentifier;
@@ -6004,6 +5978,7 @@ type DOMTimeStamp = number;
type FormDataEntryValue = File | string;
type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;
type Transferable = ArrayBuffer | MessagePort | ImageBitmap | OffscreenCanvas;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type BinaryType = "arraybuffer" | "blob";
type CanvasDirection = "inherit" | "ltr" | "rtl";
type CanvasFillRule = "evenodd" | "nonzero";
@@ -6026,7 +6001,7 @@ type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "u
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2";
type PermissionName = "accelerometer" | "ambient-light-sensor" | "background-sync" | "bluetooth" | "camera" | "clipboard" | "device-info" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "notifications" | "persistent-storage" | "push" | "speaker";
type PermissionName = "accelerometer" | "ambient-light-sensor" | "background-fetch" | "background-sync" | "bluetooth" | "camera" | "clipboard-read" | "clipboard-write" | "device-info" | "display-capture" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "nfc" | "notifications" | "persistent-storage" | "push" | "speaker";
type PermissionState = "denied" | "granted" | "prompt";
type PremultiplyAlpha = "default" | "none" | "premultiply";
type PushEncryptionKeyName = "auth" | "p256dh";
@@ -9,9 +9,9 @@ import model = require("./greeter")
var el = document.getElementById('content');
>el : HTMLElement
>document.getElementById('content') : HTMLElement
>document.getElementById : (elementId: string) => HTMLElement
>document.getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>document : Document
>getElementById : (elementId: string) => HTMLElement
>getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>'content' : "content"
var greeter = new model.Greeter(el);
@@ -8,9 +8,9 @@ import model = require("./greeter")
var el = document.getElementById('content');
>el : HTMLElement
>document.getElementById('content') : HTMLElement
>document.getElementById : (elementId: string) => HTMLElement
>document.getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>document : Document
>getElementById : (elementId: string) => HTMLElement
>getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>'content' : "content"
var greeter = new model.Greeter(el);
@@ -21,7 +21,7 @@ declare var document: Document;
interface Document {
getElementById(elementId: string): HTMLElement;
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>elementId : string
}
@@ -36,9 +36,9 @@ var elements = names.map(function (name) {
return document.getElementById(name);
>document.getElementById(name) : HTMLElement
>document.getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>document.getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>document : Document
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>name : string
});
File diff suppressed because one or more lines are too long
@@ -9,7 +9,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS236
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
@@ -25,7 +24,7 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (5 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (4 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
@@ -33,8 +32,6 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~~~~~~~~~
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -9,7 +9,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS236
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
@@ -25,7 +24,7 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (5 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (4 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
@@ -33,8 +32,6 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~~~~~~~~~
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
@@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS
!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
@@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
const blob = await response.blob();
@@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
@@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))
interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
@@ -15,10 +15,10 @@
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string
const blob = await response.blob();
@@ -74,8 +74,8 @@ export function assertNodeProperty<
>tagName : T
node[prop];
>node[prop] : ElementTagNameMap[T][P]
>node : ElementTagNameMap[T]
>node[prop] : ((null & ElementTagNameMap[T]) | (Node & ElementTagNameMap[T]))[P]
>node : (null & ElementTagNameMap[T]) | (Node & ElementTagNameMap[T])
>prop : P
}
}
@@ -10,7 +10,7 @@ tests/cases/compiler/intersectionsOfLargeUnions2.ts(31,15): error TS2536: Type '
interface ElementTagNameMap {
~~~~~~~~~~~~~~~~~
!!! error TS2300: Duplicate identifier 'ElementTagNameMap'.
!!! related TS6203 /.ts/lib.dom.d.ts:19501:6: 'ElementTagNameMap' was also declared here.
!!! related TS6203 /.ts/lib.dom.d.ts:19590:6: 'ElementTagNameMap' was also declared here.
[index: number]: HTMLElement
}
@@ -88,8 +88,8 @@ export function assertNodeProperty<
>tagName : T
node[prop];
>node[prop] : ElementTagNameMap[T][P]
>node : ElementTagNameMap[T]
>node[prop] : ((null & ElementTagNameMap[T]) | (Node & ElementTagNameMap[T]))[P]
>node : (null & ElementTagNameMap[T]) | (Node & ElementTagNameMap[T])
>prop : P
}
}
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@ declare var document: Document;
interface Document {
getElementById(elementId: string): HTMLElement;
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>elementId : string
}
interface HTMLElement {
@@ -26,9 +26,9 @@ function getMaxWidth(elementNames: string[]) {
return document.getElementById(name);
>document.getElementById(name) : HTMLElement
>document.getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>document.getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>document : Document
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>name : string
});