diff --git a/src/lib/lib.ts b/src/lib/lib.ts index 8e9e8bd2..da2a996a 100644 --- a/src/lib/lib.ts +++ b/src/lib/lib.ts @@ -29,7 +29,7 @@ export const lib_webworker_importscripts_dts = "/*! **************************** export const lib_dom_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// DOM APIs\n/////////////////////////////\n\ninterface Account {\n displayName: string;\n id: string;\n imageURL?: string;\n name?: string;\n rpDisplayName: string;\n}\n\ninterface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\ninterface AesCbcParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface AesCtrParams extends Algorithm {\n counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n length: number;\n}\n\ninterface AesDerivedKeyParams extends Algorithm {\n length: number;\n}\n\ninterface AesGcmParams extends Algorithm {\n additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n tagLength?: number;\n}\n\ninterface AesKeyAlgorithm extends KeyAlgorithm {\n length: number;\n}\n\ninterface AesKeyGenParams extends Algorithm {\n length: number;\n}\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AnalyserOptions extends AudioNodeOptions {\n fftSize?: number;\n maxDecibels?: number;\n minDecibels?: number;\n smoothingTimeConstant?: number;\n}\n\ninterface AnimationEventInit extends EventInit {\n animationName?: string;\n elapsedTime?: number;\n pseudoElement?: string;\n}\n\ninterface AnimationPlaybackEventInit extends EventInit {\n currentTime?: number | null;\n timelineTime?: number | null;\n}\n\ninterface AssertionOptions {\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface AssignedNodesOptions {\n flatten?: boolean;\n}\n\ninterface AudioBufferOptions {\n length: number;\n numberOfChannels?: number;\n sampleRate: number;\n}\n\ninterface AudioBufferSourceOptions {\n buffer?: AudioBuffer | null;\n detune?: number;\n loop?: boolean;\n loopEnd?: number;\n loopStart?: number;\n playbackRate?: number;\n}\n\ninterface AudioContextInfo {\n currentTime?: number;\n sampleRate?: number;\n}\n\ninterface AudioContextOptions {\n latencyHint?: AudioContextLatencyCategory | number;\n sampleRate?: number;\n}\n\ninterface AudioNodeOptions {\n channelCount?: number;\n channelCountMode?: ChannelCountMode;\n channelInterpretation?: ChannelInterpretation;\n}\n\ninterface AudioParamDescriptor {\n automationRate?: AutomationRate;\n defaultValue?: number;\n maxValue?: number;\n minValue?: number;\n name: string;\n}\n\ninterface AudioProcessingEventInit extends EventInit {\n inputBuffer: AudioBuffer;\n outputBuffer: AudioBuffer;\n playbackTime: number;\n}\n\ninterface AudioTimestamp {\n contextTime?: number;\n performanceTime?: number;\n}\n\ninterface AudioWorkletNodeOptions extends AudioNodeOptions {\n numberOfInputs?: number;\n numberOfOutputs?: number;\n outputChannelCount?: number[];\n parameterData?: Record;\n processorOptions?: any;\n}\n\ninterface BiquadFilterOptions extends AudioNodeOptions {\n Q?: number;\n detune?: number;\n frequency?: number;\n gain?: number;\n type?: BiquadFilterType;\n}\n\ninterface BlobPropertyBag {\n endings?: EndingType;\n type?: string;\n}\n\ninterface ByteLengthChunk {\n byteLength?: number;\n}\n\ninterface CacheQueryOptions {\n cacheName?: string;\n ignoreMethod?: boolean;\n ignoreSearch?: boolean;\n ignoreVary?: boolean;\n}\n\ninterface CanvasRenderingContext2DSettings {\n alpha?: boolean;\n}\n\ninterface ChannelMergerOptions extends AudioNodeOptions {\n numberOfInputs?: number;\n}\n\ninterface ChannelSplitterOptions extends AudioNodeOptions {\n numberOfOutputs?: number;\n}\n\ninterface ClientData {\n challenge: string;\n extensions?: WebAuthnExtensions;\n hashAlg: string | Algorithm;\n origin: string;\n rpId: string;\n tokenBinding?: string;\n}\n\ninterface ClientQueryOptions {\n includeUncontrolled?: boolean;\n type?: ClientTypes;\n}\n\ninterface CloseEventInit extends EventInit {\n code?: number;\n reason?: string;\n wasClean?: boolean;\n}\n\ninterface CompositionEventInit extends UIEventInit {\n data?: string;\n}\n\ninterface ComputedEffectTiming extends EffectTiming {\n activeDuration?: number;\n currentIteration?: number | null;\n endTime?: number;\n localTime?: number | null;\n progress?: number | null;\n}\n\ninterface ComputedKeyframe {\n composite: CompositeOperationOrAuto;\n computedOffset: number;\n easing: string;\n offset: number | null;\n [property: string]: string | number | null | undefined;\n}\n\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface ConstantSourceOptions {\n offset?: number;\n}\n\ninterface ConstrainBooleanParameters {\n exact?: boolean;\n ideal?: boolean;\n}\n\ninterface ConstrainDOMStringParameters {\n exact?: string | string[];\n ideal?: string | string[];\n}\n\ninterface ConstrainDoubleRange extends DoubleRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainLongRange extends LongRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainVideoFacingModeParameters {\n exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\n ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\n}\n\ninterface ConvolverOptions extends AudioNodeOptions {\n buffer?: AudioBuffer | null;\n disableNormalization?: boolean;\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: T;\n}\n\ninterface DOMMatrix2DInit {\n a?: number;\n b?: number;\n c?: number;\n d?: number;\n e?: number;\n f?: number;\n m11?: number;\n m12?: number;\n m21?: number;\n m22?: number;\n m41?: number;\n m42?: number;\n}\n\ninterface DOMMatrixInit extends DOMMatrix2DInit {\n is2D?: boolean;\n m13?: number;\n m14?: number;\n m23?: number;\n m24?: number;\n m31?: number;\n m32?: number;\n m33?: number;\n m34?: number;\n m43?: number;\n m44?: number;\n}\n\ninterface DOMPointInit {\n w?: number;\n x?: number;\n y?: number;\n z?: number;\n}\n\ninterface DOMQuadInit {\n p1?: DOMPointInit;\n p2?: DOMPointInit;\n p3?: DOMPointInit;\n p4?: DOMPointInit;\n}\n\ninterface DOMRectInit {\n height?: number;\n width?: number;\n x?: number;\n y?: number;\n}\n\ninterface DelayOptions extends AudioNodeOptions {\n delayTime?: number;\n maxDelayTime?: number;\n}\n\ninterface DeviceAccelerationDict {\n x?: number | null;\n y?: number | null;\n z?: number | null;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict | null;\n accelerationIncludingGravity?: DeviceAccelerationDict | null;\n interval?: number | null;\n rotationRate?: DeviceRotationRateDict | null;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n absolute?: boolean;\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DocumentTimelineOptions {\n originTime?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface DragEventInit extends MouseEventInit {\n dataTransfer?: DataTransfer | null;\n}\n\ninterface DynamicsCompressorOptions extends AudioNodeOptions {\n attack?: number;\n knee?: number;\n ratio?: number;\n release?: number;\n threshold?: number;\n}\n\ninterface EcKeyAlgorithm extends KeyAlgorithm {\n namedCurve: NamedCurve;\n}\n\ninterface EcKeyGenParams extends Algorithm {\n namedCurve: NamedCurve;\n}\n\ninterface EcKeyImportParams extends Algorithm {\n namedCurve: NamedCurve;\n}\n\ninterface EcdhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface EcdsaParams extends Algorithm {\n hash: HashAlgorithmIdentifier;\n}\n\ninterface EffectTiming {\n delay?: number;\n direction?: PlaybackDirection;\n duration?: number | string;\n easing?: string;\n endDelay?: number;\n fill?: FillMode;\n iterationStart?: number;\n iterations?: number;\n}\n\ninterface ElementDefinitionOptions {\n extends?: string;\n}\n\ninterface ErrorEventInit extends EventInit {\n colno?: number;\n error?: any;\n filename?: string;\n lineno?: number;\n message?: string;\n}\n\ninterface EventInit {\n bubbles?: boolean;\n cancelable?: boolean;\n composed?: boolean;\n}\n\ninterface EventListenerOptions {\n capture?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n altKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n modifierAltGraph?: boolean;\n modifierCapsLock?: boolean;\n modifierFn?: boolean;\n modifierFnLock?: boolean;\n modifierHyper?: boolean;\n modifierNumLock?: boolean;\n modifierOS?: boolean;\n modifierScrollLock?: boolean;\n modifierSuper?: boolean;\n modifierSymbol?: boolean;\n modifierSymbolLock?: boolean;\n shiftKey?: boolean;\n}\n\ninterface ExceptionInformation {\n domain?: string | null;\n}\n\ninterface FilePropertyBag extends BlobPropertyBag {\n lastModified?: number;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget | null;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string | null;\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusNavigationOrigin {\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusOptions {\n preventScroll?: boolean;\n}\n\ninterface GainOptions extends AudioNodeOptions {\n gain?: number;\n}\n\ninterface GamepadEventInit extends EventInit {\n gamepad?: Gamepad;\n}\n\ninterface GetNotificationOptions {\n tag?: string;\n}\n\ninterface GetRootNodeOptions {\n composed?: boolean;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string;\n oldURL?: string;\n}\n\ninterface HkdfParams extends Algorithm {\n hash: HashAlgorithmIdentifier;\n info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface HmacImportParams extends Algorithm {\n hash: HashAlgorithmIdentifier;\n length?: number;\n}\n\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\n hash: KeyAlgorithm;\n length: number;\n}\n\ninterface HmacKeyGenParams extends Algorithm {\n hash: HashAlgorithmIdentifier;\n length?: number;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: string | string[] | null;\n}\n\ninterface IDBVersionChangeEventInit extends EventInit {\n newVersion?: number | null;\n oldVersion?: number;\n}\n\ninterface IIRFilterOptions extends AudioNodeOptions {\n feedback: number[];\n feedforward: number[];\n}\n\ninterface IntersectionObserverEntryInit {\n boundingClientRect: DOMRectInit;\n intersectionRect: DOMRectInit;\n isIntersecting: boolean;\n rootBounds: DOMRectInit;\n target: Element;\n time: number;\n}\n\ninterface IntersectionObserverInit {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface JsonWebKey {\n alg?: string;\n crv?: string;\n d?: string;\n dp?: string;\n dq?: string;\n e?: string;\n ext?: boolean;\n k?: string;\n key_ops?: string[];\n kty?: string;\n n?: string;\n oth?: RsaOtherPrimesInfo[];\n p?: string;\n q?: string;\n qi?: string;\n use?: string;\n x?: string;\n y?: string;\n}\n\ninterface KeyAlgorithm {\n name: string;\n}\n\ninterface KeyboardEventInit extends EventModifierInit {\n code?: string;\n key?: string;\n location?: number;\n repeat?: boolean;\n}\n\ninterface Keyframe {\n composite?: CompositeOperationOrAuto;\n easing?: string;\n offset?: number | null;\n [property: string]: string | number | null | undefined;\n}\n\ninterface KeyframeAnimationOptions extends KeyframeEffectOptions {\n id?: string;\n}\n\ninterface KeyframeEffectOptions extends EffectTiming {\n composite?: CompositeOperation;\n iterationComposite?: IterationCompositeOperation;\n}\n\ninterface LongRange {\n max?: number;\n min?: number;\n}\n\ninterface MediaElementAudioSourceOptions {\n mediaElement: HTMLMediaElement;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initData?: ArrayBuffer | null;\n initDataType?: string;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n message?: ArrayBuffer | null;\n messageType?: MediaKeyMessageType;\n}\n\ninterface MediaKeySystemConfiguration {\n audioCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n initDataTypes?: string[];\n persistentState?: MediaKeysRequirement;\n videoCapabilities?: MediaKeySystemMediaCapability[];\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaQueryListEventInit extends EventInit {\n matches?: boolean;\n media?: string;\n}\n\ninterface MediaStreamAudioSourceOptions {\n mediaStream: MediaStream;\n}\n\ninterface MediaStreamConstraints {\n audio?: boolean | MediaTrackConstraints;\n peerIdentity?: string;\n video?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError | null;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackAudioSourceOptions {\n mediaStreamTrack: MediaStreamTrack;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack | null;\n}\n\ninterface MediaTrackCapabilities {\n aspectRatio?: number | DoubleRange;\n deviceId?: string;\n echoCancellation?: boolean[];\n facingMode?: string;\n frameRate?: number | DoubleRange;\n groupId?: string;\n height?: number | LongRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n volume?: number | DoubleRange;\n width?: number | LongRange;\n}\n\ninterface MediaTrackConstraintSet {\n aspectRatio?: number | ConstrainDoubleRange;\n channelCount?: number | ConstrainLongRange;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n displaySurface?: string | string[] | ConstrainDOMStringParameters;\n echoCancellation?: boolean | ConstrainBooleanParameters;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n frameRate?: number | ConstrainDoubleRange;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n height?: number | ConstrainLongRange;\n latency?: number | ConstrainDoubleRange;\n logicalSurface?: boolean | ConstrainBooleanParameters;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n volume?: number | ConstrainDoubleRange;\n width?: number | ConstrainLongRange;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n aspectRatio?: number;\n deviceId?: string;\n echoCancellation?: boolean;\n facingMode?: string;\n frameRate?: number;\n groupId?: string;\n height?: number;\n sampleRate?: number;\n sampleSize?: number;\n volume?: number;\n width?: number;\n}\n\ninterface MediaTrackSupportedConstraints {\n aspectRatio?: boolean;\n deviceId?: boolean;\n echoCancellation?: boolean;\n facingMode?: boolean;\n frameRate?: boolean;\n groupId?: boolean;\n height?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n volume?: boolean;\n width?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[];\n source?: MessageEventSource | null;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n button?: number;\n buttons?: number;\n clientX?: number;\n clientY?: number;\n relatedTarget?: EventTarget | null;\n screenX?: number;\n screenY?: number;\n}\n\ninterface MutationObserverInit {\n attributeFilter?: string[];\n attributeOldValue?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n characterDataOldValue?: boolean;\n childList?: boolean;\n subtree?: boolean;\n}\n\ninterface NavigationPreloadState {\n enabled?: boolean;\n headerValue?: string;\n}\n\ninterface NotificationAction {\n action: string;\n icon?: string;\n title: string;\n}\n\ninterface NotificationOptions {\n actions?: NotificationAction[];\n badge?: string;\n body?: string;\n data?: any;\n dir?: NotificationDirection;\n icon?: string;\n image?: string;\n lang?: string;\n renotify?: boolean;\n requireInteraction?: boolean;\n silent?: boolean;\n tag?: string;\n timestamp?: number;\n vibrate?: VibratePattern;\n}\n\ninterface OfflineAudioCompletionEventInit extends EventInit {\n renderedBuffer: AudioBuffer;\n}\n\ninterface OfflineAudioContextOptions {\n length: number;\n numberOfChannels?: number;\n sampleRate: number;\n}\n\ninterface OptionalEffectTiming {\n delay?: number;\n direction?: PlaybackDirection;\n duration?: number | string;\n easing?: string;\n endDelay?: number;\n fill?: FillMode;\n iterationStart?: number;\n iterations?: number;\n}\n\ninterface OscillatorOptions extends AudioNodeOptions {\n detune?: number;\n frequency?: number;\n periodicWave?: PeriodicWave;\n type?: OscillatorType;\n}\n\ninterface PannerOptions extends AudioNodeOptions {\n coneInnerAngle?: number;\n coneOuterAngle?: number;\n coneOuterGain?: number;\n distanceModel?: DistanceModelType;\n maxDistance?: number;\n orientationX?: number;\n orientationY?: number;\n orientationZ?: number;\n panningModel?: PanningModelType;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n refDistance?: number;\n rolloffFactor?: number;\n}\n\ninterface PaymentCurrencyAmount {\n currency: string;\n currencySystem?: string;\n value: string;\n}\n\ninterface PaymentDetailsBase {\n displayItems?: PaymentItem[];\n modifiers?: PaymentDetailsModifier[];\n shippingOptions?: PaymentShippingOption[];\n}\n\ninterface PaymentDetailsInit extends PaymentDetailsBase {\n id?: string;\n total: PaymentItem;\n}\n\ninterface PaymentDetailsModifier {\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n supportedMethods: string | string[];\n total?: PaymentItem;\n}\n\ninterface PaymentDetailsUpdate extends PaymentDetailsBase {\n error?: string;\n total?: PaymentItem;\n}\n\ninterface PaymentItem {\n amount: PaymentCurrencyAmount;\n label: string;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n data?: any;\n supportedMethods: string | string[];\n}\n\ninterface PaymentOptions {\n requestPayerEmail?: boolean;\n requestPayerName?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n amount: PaymentCurrencyAmount;\n id: string;\n label: string;\n selected?: boolean;\n}\n\ninterface Pbkdf2Params extends Algorithm {\n hash: HashAlgorithmIdentifier;\n iterations: number;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface PerformanceObserverInit {\n buffered?: boolean;\n entryTypes: string[];\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PeriodicWaveOptions extends PeriodicWaveConstraints {\n imag?: number[] | Float32Array;\n real?: number[] | Float32Array;\n}\n\ninterface PipeOptions {\n preventAbort?: boolean;\n preventCancel?: boolean;\n preventClose?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n height?: number;\n isPrimary?: boolean;\n pointerId?: number;\n pointerType?: string;\n pressure?: number;\n tangentialPressure?: number;\n tiltX?: number;\n tiltY?: number;\n twist?: number;\n width?: number;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n maximumAge?: number;\n timeout?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PromiseRejectionEventInit extends EventInit {\n promise: Promise;\n reason?: any;\n}\n\ninterface PropertyIndexedKeyframes {\n composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[];\n easing?: string | string[];\n offset?: number | (number | null)[];\n [property: string]: string | string[] | number | null | (number | null)[] | undefined;\n}\n\ninterface PushSubscriptionJSON {\n endpoint?: string;\n expirationTime?: number | null;\n keys?: Record;\n}\n\ninterface PushSubscriptionOptionsInit {\n applicationServerKey?: BufferSource | string | null;\n userVisibleOnly?: boolean;\n}\n\ninterface QueuingStrategy {\n highWaterMark?: number;\n size?: QueuingStrategySizeCallback;\n}\n\ninterface RTCAnswerOptions extends RTCOfferAnswerOptions {\n}\n\ninterface RTCCertificateExpiration {\n expires?: number;\n}\n\ninterface RTCConfiguration {\n bundlePolicy?: RTCBundlePolicy;\n certificates?: RTCCertificate[];\n iceCandidatePoolSize?: number;\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n peerIdentity?: string;\n rtcpMuxPolicy?: RTCRtcpMuxPolicy;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone: string;\n}\n\ninterface RTCDataChannelEventInit extends EventInit {\n channel: RTCDataChannel;\n}\n\ninterface RTCDataChannelInit {\n id?: number;\n maxPacketLifeTime?: number;\n maxRetransmits?: number;\n negotiated?: boolean;\n ordered?: boolean;\n priority?: RTCPriorityType;\n protocol?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n fingerprints?: RTCDtlsFingerprint[];\n role?: RTCDtlsRole;\n}\n\ninterface RTCErrorEventInit extends EventInit {\n error?: RTCError | null;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n addressSourceUrl?: string;\n candidateType?: RTCStatsIceCandidateType;\n ipAddress?: string;\n portNumber?: number;\n priority?: number;\n transport?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n ip?: string;\n msMTurnSessionId?: string;\n port?: number;\n priority?: number;\n protocol?: RTCIceProtocol;\n relatedAddress?: string;\n relatedPort?: number;\n tcpType?: RTCIceTcpCandidateType;\n type?: RTCIceCandidateType;\n}\n\ninterface RTCIceCandidateInit {\n candidate?: string;\n sdpMLineIndex?: number | null;\n sdpMid?: string | null;\n usernameFragment?: string;\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidate;\n remote?: RTCIceCandidate;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n availableIncomingBitrate?: number;\n availableOutgoingBitrate?: number;\n bytesReceived?: number;\n bytesSent?: number;\n localCandidateId?: string;\n nominated?: boolean;\n priority?: number;\n readable?: boolean;\n remoteCandidateId?: string;\n roundTripTime?: number;\n state?: RTCStatsIceCandidatePairState;\n transportId?: string;\n writable?: boolean;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n}\n\ninterface RTCIceParameters {\n password?: string;\n usernameFragment?: string;\n}\n\ninterface RTCIceServer {\n credential?: string | RTCOAuthCredential;\n credentialType?: RTCIceCredentialType;\n urls: string | string[];\n username?: string;\n}\n\ninterface RTCIdentityProviderOptions {\n peerIdentity?: string;\n protocol?: string;\n usernameHint?: string;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n bytesReceived?: number;\n fractionLost?: number;\n jitter?: number;\n packetsLost?: number;\n packetsReceived?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n frameHeight?: number;\n frameWidth?: number;\n framesCorrupted?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesPerSecond?: number;\n framesReceived?: number;\n framesSent?: number;\n remoteSource?: boolean;\n ssrcIds?: string[];\n trackIdentifier?: string;\n}\n\ninterface RTCOAuthCredential {\n accessToken: string;\n macKey: string;\n}\n\ninterface RTCOfferAnswerOptions {\n voiceActivityDetection?: boolean;\n}\n\ninterface RTCOfferOptions extends RTCOfferAnswerOptions {\n iceRestart?: boolean;\n offerToReceiveAudio?: boolean;\n offerToReceiveVideo?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n bytesSent?: number;\n packetsSent?: number;\n roundTripTime?: number;\n targetBitrate?: number;\n}\n\ninterface RTCPeerConnectionIceErrorEventInit extends EventInit {\n errorCode: number;\n hostCandidate?: string;\n statusText?: string;\n url?: string;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate | null;\n url?: string | null;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n associateStatsId?: string;\n codecId?: string;\n firCount?: number;\n isRemote?: boolean;\n mediaTrackId?: string;\n mediaType?: string;\n nackCount?: number;\n pliCount?: number;\n sliCount?: number;\n ssrc?: string;\n transportId?: string;\n}\n\ninterface RTCRtcpFeedback {\n parameter?: string;\n type?: string;\n}\n\ninterface RTCRtcpParameters {\n cname?: string;\n reducedSize?: boolean;\n}\n\ninterface RTCRtpCapabilities {\n codecs: RTCRtpCodecCapability[];\n headerExtensions: RTCRtpHeaderExtensionCapability[];\n}\n\ninterface RTCRtpCodecCapability {\n channels?: number;\n clockRate: number;\n mimeType: string;\n sdpFmtpLine?: string;\n}\n\ninterface RTCRtpCodecParameters {\n channels?: number;\n clockRate: number;\n mimeType: string;\n payloadType: number;\n sdpFmtpLine?: string;\n}\n\ninterface RTCRtpCodingParameters {\n rid?: string;\n}\n\ninterface RTCRtpContributingSource {\n audioLevel?: number;\n source: number;\n timestamp: number;\n}\n\ninterface RTCRtpDecodingParameters extends RTCRtpCodingParameters {\n}\n\ninterface RTCRtpEncodingParameters extends RTCRtpCodingParameters {\n active?: boolean;\n codecPayloadType?: number;\n dtx?: RTCDtxStatus;\n maxBitrate?: number;\n maxFramerate?: number;\n priority?: RTCPriorityType;\n ptime?: number;\n scaleResolutionDownBy?: number;\n}\n\ninterface RTCRtpFecParameters {\n mechanism?: string;\n ssrc?: number;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n preferredEncrypt?: boolean;\n preferredId?: number;\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionCapability {\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n encrypted?: boolean;\n id: number;\n uri: string;\n}\n\ninterface RTCRtpParameters {\n codecs: RTCRtpCodecParameters[];\n headerExtensions: RTCRtpHeaderExtensionParameters[];\n rtcp: RTCRtcpParameters;\n}\n\ninterface RTCRtpReceiveParameters extends RTCRtpParameters {\n encodings: RTCRtpDecodingParameters[];\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpSendParameters extends RTCRtpParameters {\n degradationPreference?: RTCDegradationPreference;\n encodings: RTCRtpEncodingParameters[];\n transactionId: string;\n}\n\ninterface RTCRtpSynchronizationSource extends RTCRtpContributingSource {\n voiceActivityFlag?: boolean;\n}\n\ninterface RTCRtpTransceiverInit {\n direction?: RTCRtpTransceiverDirection;\n sendEncodings?: RTCRtpEncodingParameters[];\n streams?: MediaStream[];\n}\n\ninterface RTCRtpUnhandled {\n muxId?: string;\n payloadType?: number;\n ssrc?: number;\n}\n\ninterface RTCSessionDescriptionInit {\n sdp?: string;\n type: RTCSdpType;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiLength?: number;\n mkiValue?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n tag?: number;\n}\n\ninterface RTCSsrcRange {\n max?: number;\n min?: number;\n}\n\ninterface RTCStats {\n id: string;\n timestamp: number;\n type: RTCStatsType;\n}\n\ninterface RTCStatsEventInit extends EventInit {\n report: RTCStatsReport;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTrackEventInit extends EventInit {\n receiver: RTCRtpReceiver;\n streams?: MediaStream[];\n track: MediaStreamTrack;\n transceiver: RTCRtpTransceiver;\n}\n\ninterface RTCTransportStats extends RTCStats {\n activeConnection?: boolean;\n bytesReceived?: number;\n bytesSent?: number;\n localCertificateId?: string;\n remoteCertificateId?: string;\n rtcpTransportStatsId?: string;\n selectedCandidatePairId?: string;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n type?: WorkerType;\n updateViaCache?: ServiceWorkerUpdateViaCache;\n}\n\ninterface RequestInit {\n body?: BodyInit | null;\n cache?: RequestCache;\n credentials?: RequestCredentials;\n headers?: HeadersInit;\n integrity?: string;\n keepalive?: boolean;\n method?: string;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n signal?: AbortSignal | null;\n window?: any;\n}\n\ninterface ResponseInit {\n headers?: HeadersInit;\n status?: number;\n statusText?: string;\n}\n\ninterface RsaHashedImportParams extends Algorithm {\n hash: HashAlgorithmIdentifier;\n}\n\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\n hash: KeyAlgorithm;\n}\n\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\n hash: HashAlgorithmIdentifier;\n}\n\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\n modulusLength: number;\n publicExponent: BigInteger;\n}\n\ninterface RsaKeyGenParams extends Algorithm {\n modulusLength: number;\n publicExponent: BigInteger;\n}\n\ninterface RsaOaepParams extends Algorithm {\n label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface RsaOtherPrimesInfo {\n d?: string;\n r?: string;\n t?: string;\n}\n\ninterface RsaPssParams extends Algorithm {\n saltLength: number;\n}\n\ninterface SVGBoundingBoxOptions {\n clipped?: boolean;\n fill?: boolean;\n markers?: boolean;\n stroke?: boolean;\n}\n\ninterface ScopedCredentialDescriptor {\n id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n transports?: Transport[];\n type: ScopedCredentialType;\n}\n\ninterface ScopedCredentialOptions {\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface ScopedCredentialParameters {\n algorithm: string | Algorithm;\n type: ScopedCredentialType;\n}\n\ninterface ScrollIntoViewOptions extends ScrollOptions {\n block?: ScrollLogicalPosition;\n inline?: ScrollLogicalPosition;\n}\n\ninterface ScrollOptions {\n behavior?: ScrollBehavior;\n}\n\ninterface ScrollToOptions extends ScrollOptions {\n left?: number;\n top?: number;\n}\n\ninterface SecurityPolicyViolationEventInit extends EventInit {\n blockedURI?: string;\n columnNumber?: number;\n documentURI?: string;\n effectiveDirective?: string;\n lineNumber?: number;\n originalPolicy?: string;\n referrer?: string;\n sourceFile?: string;\n statusCode?: number;\n violatedDirective?: string;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: ServiceWorker | MessagePort | null;\n}\n\ninterface StereoPannerOptions extends AudioNodeOptions {\n pan?: number;\n}\n\ninterface StorageEstimate {\n quota?: number;\n usage?: number;\n}\n\ninterface StorageEventInit extends EventInit {\n key?: string | null;\n newValue?: string | null;\n oldValue?: string | null;\n storageArea?: Storage | null;\n url?: string;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n detailURI?: string | null;\n explanationString?: string | null;\n siteName?: string | null;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface TextDecodeOptions {\n stream?: boolean;\n}\n\ninterface TextDecoderOptions {\n fatal?: boolean;\n ignoreBOM?: boolean;\n}\n\ninterface TouchEventInit extends EventModifierInit {\n changedTouches?: Touch[];\n targetTouches?: Touch[];\n touches?: Touch[];\n}\n\ninterface TouchInit {\n altitudeAngle?: number;\n azimuthAngle?: number;\n clientX?: number;\n clientY?: number;\n force?: number;\n identifier: number;\n pageX?: number;\n pageY?: number;\n radiusX?: number;\n radiusY?: number;\n rotationAngle?: number;\n screenX?: number;\n screenY?: number;\n target: EventTarget;\n touchType?: TouchType;\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ninterface Transformer {\n flush?: TransformStreamDefaultControllerCallback;\n readableType?: undefined;\n start?: TransformStreamDefaultControllerCallback;\n transform?: TransformStreamDefaultControllerTransformCallback;\n writableType?: undefined;\n}\n\ninterface TransitionEventInit extends EventInit {\n elapsedTime?: number;\n propertyName?: string;\n pseudoElement?: string;\n}\n\ninterface UIEventInit extends EventInit {\n detail?: number;\n view?: Window | null;\n}\n\ninterface UnderlyingByteSource {\n autoAllocateChunkSize?: number;\n cancel?: ReadableStreamErrorCallback;\n pull?: ReadableByteStreamControllerCallback;\n start?: ReadableByteStreamControllerCallback;\n type: \"bytes\";\n}\n\ninterface UnderlyingSink {\n abort?: WritableStreamErrorCallback;\n close?: WritableStreamDefaultControllerCloseCallback;\n start?: WritableStreamDefaultControllerStartCallback;\n type?: undefined;\n write?: WritableStreamDefaultControllerWriteCallback;\n}\n\ninterface UnderlyingSource {\n cancel?: ReadableStreamErrorCallback;\n pull?: ReadableStreamDefaultControllerCallback;\n start?: ReadableStreamDefaultControllerCallback;\n type?: undefined;\n}\n\ninterface VRDisplayEventInit extends EventInit {\n display: VRDisplay;\n reason?: VRDisplayEventReason;\n}\n\ninterface VRLayer {\n leftBounds?: number[] | Float32Array | null;\n rightBounds?: number[] | Float32Array | null;\n source?: HTMLCanvasElement | null;\n}\n\ninterface VRStageParameters {\n sittingToStandingTransform?: Float32Array;\n sizeX?: number;\n sizeY?: number;\n}\n\ninterface WaveShaperOptions extends AudioNodeOptions {\n curve?: number[] | Float32Array;\n oversample?: OverSampleType;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n alpha?: GLboolean;\n antialias?: GLboolean;\n depth?: GLboolean;\n failIfMajorPerformanceCaveat?: boolean;\n powerPreference?: WebGLPowerPreference;\n premultipliedAlpha?: GLboolean;\n preserveDrawingBuffer?: GLboolean;\n stencil?: GLboolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaMode?: number;\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n}\n\ninterface WorkerOptions {\n credentials?: RequestCredentials;\n name?: string;\n type?: WorkerType;\n}\n\ninterface WorkletOptions {\n credentials?: RequestCredentials;\n}\n\ninterface EventListener {\n (evt: Event): void;\n}\n\ninterface ANGLE_instanced_arrays {\n drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void;\n drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void;\n vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum;\n}\n\ninterface AbortController {\n /**\n * Returns the AbortSignal object associated with this object.\n */\n readonly signal: AbortSignal;\n /**\n * Invoking this method will set this object's AbortSignal's aborted flag and\n * signal to any observers that the associated activity is to be aborted.\n */\n abort(): void;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ninterface AbortSignalEventMap {\n \"abort\": ProgressEvent;\n}\n\ninterface AbortSignal extends EventTarget {\n /**\n * Returns true if this AbortSignal's AbortController has signaled to abort, and false\n * otherwise.\n */\n readonly aborted: boolean;\n onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AbortSignal: {\n prototype: AbortSignal;\n new(): AbortSignal;\n};\n\ninterface AbstractRange {\n readonly collapsed: boolean;\n readonly endContainer: Node;\n readonly endOffset: number;\n readonly startContainer: Node;\n readonly startOffset: number;\n}\n\ndeclare var AbstractRange: {\n prototype: AbstractRange;\n new(): AbstractRange;\n};\n\ninterface AbstractWorkerEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface AbstractWorker {\n onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AesCfbParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface AesCmacParams extends Algorithm {\n length: number;\n}\n\ninterface AnalyserNode extends AudioNode {\n fftSize: number;\n readonly frequencyBinCount: number;\n maxDecibels: number;\n minDecibels: number;\n smoothingTimeConstant: number;\n getByteFrequencyData(array: Uint8Array): void;\n getByteTimeDomainData(array: Uint8Array): void;\n getFloatFrequencyData(array: Float32Array): void;\n getFloatTimeDomainData(array: Float32Array): void;\n}\n\ndeclare var AnalyserNode: {\n prototype: AnalyserNode;\n new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode;\n};\n\ninterface Animatable {\n animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;\n getAnimations(): Animation[];\n}\n\ninterface AnimationEventMap {\n \"cancel\": AnimationPlaybackEvent;\n \"finish\": AnimationPlaybackEvent;\n}\n\ninterface Animation extends EventTarget {\n currentTime: number | null;\n effect: AnimationEffect | null;\n readonly finished: Promise;\n id: string;\n oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;\n onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null;\n readonly pending: boolean;\n readonly playState: AnimationPlayState;\n playbackRate: number;\n readonly ready: Promise;\n startTime: number | null;\n timeline: AnimationTimeline | null;\n cancel(): void;\n finish(): void;\n pause(): void;\n play(): void;\n reverse(): void;\n updatePlaybackRate(playbackRate: number): void;\n addEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Animation: {\n prototype: Animation;\n new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation;\n};\n\ninterface AnimationEffect {\n getComputedTiming(): ComputedEffectTiming;\n getTiming(): EffectTiming;\n updateTiming(timing?: OptionalEffectTiming): void;\n}\n\ndeclare var AnimationEffect: {\n prototype: AnimationEffect;\n new(): AnimationEffect;\n};\n\ninterface AnimationEvent extends Event {\n readonly animationName: string;\n readonly elapsedTime: number;\n readonly pseudoElement: string;\n}\n\ndeclare var AnimationEvent: {\n prototype: AnimationEvent;\n new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent;\n};\n\ninterface AnimationPlaybackEvent extends Event {\n readonly currentTime: number | null;\n readonly timelineTime: number | null;\n}\n\ndeclare var AnimationPlaybackEvent: {\n prototype: AnimationPlaybackEvent;\n new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent;\n};\n\ninterface AnimationTimeline {\n readonly currentTime: number | null;\n}\n\ndeclare var AnimationTimeline: {\n prototype: AnimationTimeline;\n new(): AnimationTimeline;\n};\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": Event;\n \"noupdate\": Event;\n \"obsolete\": Event;\n \"progress\": ProgressEvent;\n \"updateready\": Event;\n}\n\ninterface ApplicationCache extends EventTarget {\n /** @deprecated */\n oncached: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n onchecking: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n ondownloading: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n onerror: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n onnoupdate: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n onobsolete: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null;\n /** @deprecated */\n onupdateready: ((this: ApplicationCache, ev: Event) => any) | null;\n /** @deprecated */\n readonly status: number;\n /** @deprecated */\n abort(): void;\n /** @deprecated */\n swapCache(): void;\n /** @deprecated */\n update(): void;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ApplicationCache: {\n prototype: ApplicationCache;\n new(): ApplicationCache;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n};\n\ninterface Attr extends Node {\n readonly localName: string;\n readonly name: string;\n readonly namespaceURI: string | null;\n readonly ownerElement: Element | null;\n readonly prefix: string | null;\n readonly specified: boolean;\n value: string;\n}\n\ndeclare var Attr: {\n prototype: Attr;\n new(): Attr;\n};\n\ninterface AudioBuffer {\n readonly duration: number;\n readonly length: number;\n readonly numberOfChannels: number;\n readonly sampleRate: number;\n copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;\n copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;\n getChannelData(channel: number): Float32Array;\n}\n\ndeclare var AudioBuffer: {\n prototype: AudioBuffer;\n new(options: AudioBufferOptions): AudioBuffer;\n};\n\ninterface AudioBufferSourceNode extends AudioScheduledSourceNode {\n buffer: AudioBuffer | null;\n readonly detune: AudioParam;\n loop: boolean;\n loopEnd: number;\n loopStart: number;\n readonly playbackRate: AudioParam;\n start(when?: number, offset?: number, duration?: number): void;\n addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode;\n};\n\ninterface AudioContext extends BaseAudioContext {\n readonly baseLatency: number;\n readonly outputLatency: number;\n close(): Promise;\n createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\n createMediaStreamDestination(): MediaStreamAudioDestinationNode;\n createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\n createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack): MediaStreamTrackAudioSourceNode;\n getOutputTimestamp(): AudioTimestamp;\n suspend(): Promise;\n addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioContext: {\n prototype: AudioContext;\n new(contextOptions?: AudioContextOptions): AudioContext;\n};\n\ninterface AudioDestinationNode extends AudioNode {\n readonly maxChannelCount: number;\n}\n\ndeclare var AudioDestinationNode: {\n prototype: AudioDestinationNode;\n new(): AudioDestinationNode;\n};\n\ninterface AudioListener {\n readonly forwardX: AudioParam;\n readonly forwardY: AudioParam;\n readonly forwardZ: AudioParam;\n readonly positionX: AudioParam;\n readonly positionY: AudioParam;\n readonly positionZ: AudioParam;\n readonly upX: AudioParam;\n readonly upY: AudioParam;\n readonly upZ: AudioParam;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n}\n\ndeclare var AudioListener: {\n prototype: AudioListener;\n new(): AudioListener;\n};\n\ninterface AudioNode extends EventTarget {\n channelCount: number;\n channelCountMode: ChannelCountMode;\n channelInterpretation: ChannelInterpretation;\n readonly context: BaseAudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode;\n connect(destinationParam: AudioParam, output?: number): void;\n disconnect(): void;\n disconnect(output: number): void;\n disconnect(destinationNode: AudioNode): void;\n disconnect(destinationNode: AudioNode, output: number): void;\n disconnect(destinationNode: AudioNode, output: number, input: number): void;\n disconnect(destinationParam: AudioParam): void;\n disconnect(destinationParam: AudioParam, output: number): void;\n}\n\ndeclare var AudioNode: {\n prototype: AudioNode;\n new(): AudioNode;\n};\n\ninterface AudioParam {\n automationRate: AutomationRate;\n readonly defaultValue: number;\n readonly maxValue: number;\n readonly minValue: number;\n value: number;\n cancelAndHoldAtTime(cancelTime: number): AudioParam;\n cancelScheduledValues(cancelTime: number): AudioParam;\n exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\n linearRampToValueAtTime(value: number, endTime: number): AudioParam;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\n setValueAtTime(value: number, startTime: number): AudioParam;\n setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam;\n}\n\ndeclare var AudioParam: {\n prototype: AudioParam;\n new(): AudioParam;\n};\n\ninterface AudioParamMap {\n forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void;\n}\n\ndeclare var AudioParamMap: {\n prototype: AudioParamMap;\n new(): AudioParamMap;\n};\n\ninterface AudioProcessingEvent extends Event {\n readonly inputBuffer: AudioBuffer;\n readonly outputBuffer: AudioBuffer;\n readonly playbackTime: number;\n}\n\ndeclare var AudioProcessingEvent: {\n prototype: AudioProcessingEvent;\n new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent;\n};\n\ninterface AudioScheduledSourceNodeEventMap {\n \"ended\": Event;\n}\n\ninterface AudioScheduledSourceNode extends AudioNode {\n onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null;\n start(when?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioScheduledSourceNode: {\n prototype: AudioScheduledSourceNode;\n new(): AudioScheduledSourceNode;\n};\n\ninterface AudioTrack {\n enabled: boolean;\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var AudioTrack: {\n prototype: AudioTrack;\n new(): AudioTrack;\n};\n\ninterface AudioTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface AudioTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: AudioTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n getTrackById(id: string): AudioTrack | null;\n item(index: number): AudioTrack;\n addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: AudioTrack;\n}\n\ndeclare var AudioTrackList: {\n prototype: AudioTrackList;\n new(): AudioTrackList;\n};\n\ninterface AudioWorklet extends Worklet {\n}\n\ndeclare var AudioWorklet: {\n prototype: AudioWorklet;\n new(): AudioWorklet;\n};\n\ninterface AudioWorkletNodeEventMap {\n \"processorerror\": Event;\n}\n\ninterface AudioWorkletNode extends AudioNode {\n onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null;\n readonly parameters: AudioParamMap;\n readonly port: MessagePort;\n addEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioWorkletNode: {\n prototype: AudioWorkletNode;\n new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode;\n};\n\ninterface BarProp {\n readonly visible: boolean;\n}\n\ndeclare var BarProp: {\n prototype: BarProp;\n new(): BarProp;\n};\n\ninterface BaseAudioContextEventMap {\n \"statechange\": Event;\n}\n\ninterface BaseAudioContext extends EventTarget {\n readonly audioWorklet: AudioWorklet;\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null;\n readonly sampleRate: number;\n readonly state: AudioContextState;\n createAnalyser(): AnalyserNode;\n createBiquadFilter(): BiquadFilterNode;\n createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\n createBufferSource(): AudioBufferSourceNode;\n createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\n createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\n createConstantSource(): ConstantSourceNode;\n createConvolver(): ConvolverNode;\n createDelay(maxDelayTime?: number): DelayNode;\n createDynamicsCompressor(): DynamicsCompressorNode;\n createGain(): GainNode;\n createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\n createOscillator(): OscillatorNode;\n createPanner(): PannerNode;\n createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\n createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\n createStereoPanner(): StereoPannerNode;\n createWaveShaper(): WaveShaperNode;\n decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise;\n resume(): Promise;\n addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BaseAudioContext: {\n prototype: BaseAudioContext;\n new(): BaseAudioContext;\n};\n\ninterface BeforeUnloadEvent extends Event {\n returnValue: any;\n}\n\ndeclare var BeforeUnloadEvent: {\n prototype: BeforeUnloadEvent;\n new(): BeforeUnloadEvent;\n};\n\ninterface BhxBrowser {\n readonly lastError: DOMException;\n checkMatchesGlobExpression(pattern: string, value: string): boolean;\n checkMatchesUriExpression(pattern: string, value: string): boolean;\n clearLastError(): void;\n currentWindowId(): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(functionId: number, destination: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n getExtensionId(): string;\n getThisAddress(): any;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericListenerHandler(eventHandler: Function): void;\n setLastError(parameters: string): void;\n webPlatformGenericFunction(destination: any, parameters?: string, callbackId?: number): void;\n}\n\ndeclare var BhxBrowser: {\n prototype: BhxBrowser;\n new(): BhxBrowser;\n};\n\ninterface BiquadFilterNode extends AudioNode {\n readonly Q: AudioParam;\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n type: BiquadFilterType;\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var BiquadFilterNode: {\n prototype: BiquadFilterNode;\n new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode;\n};\n\ninterface Blob {\n readonly size: number;\n readonly type: string;\n slice(start?: number, end?: number, contentType?: string): Blob;\n}\n\ndeclare var Blob: {\n prototype: Blob;\n new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;\n};\n\ninterface Body {\n readonly body: ReadableStream | null;\n readonly bodyUsed: boolean;\n arrayBuffer(): Promise;\n blob(): Promise;\n formData(): Promise;\n json(): Promise;\n text(): Promise;\n}\n\ninterface BroadcastChannelEventMap {\n \"message\": MessageEvent;\n \"messageerror\": MessageEvent;\n}\n\ninterface BroadcastChannel extends EventTarget {\n /**\n * Returns the channel name (as passed to the constructor).\n */\n readonly name: string;\n onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\n onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;\n /**\n * Closes the BroadcastChannel object, opening it up to garbage collection.\n */\n close(): void;\n /**\n * Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.\n */\n postMessage(message: any): void;\n addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BroadcastChannel: {\n prototype: BroadcastChannel;\n new(name: string): BroadcastChannel;\n};\n\ninterface BroadcastChannelEventMap {\n message: MessageEvent;\n messageerror: MessageEvent;\n}\n\ninterface ByteLengthQueuingStrategy extends QueuingStrategy {\n highWaterMark: number;\n size(chunk: ArrayBufferView): number;\n}\n\ndeclare var ByteLengthQueuingStrategy: {\n prototype: ByteLengthQueuingStrategy;\n new(options: { highWaterMark: number }): ByteLengthQueuingStrategy;\n};\n\ninterface CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\n};\n\ninterface CSS {\n escape(value: string): string;\n supports(property: string, value?: string): boolean;\n}\ndeclare var CSS: CSS;\n\ninterface CSSConditionRule extends CSSGroupingRule {\n conditionText: string;\n}\n\ndeclare var CSSConditionRule: {\n prototype: CSSConditionRule;\n new(): CSSConditionRule;\n};\n\ninterface CSSFontFaceRule extends CSSRule {\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSFontFaceRule: {\n prototype: CSSFontFaceRule;\n new(): CSSFontFaceRule;\n};\n\ninterface CSSGroupingRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n insertRule(rule: string, index: number): number;\n}\n\ndeclare var CSSGroupingRule: {\n prototype: CSSGroupingRule;\n new(): CSSGroupingRule;\n};\n\ninterface CSSImportRule extends CSSRule {\n readonly href: string;\n readonly media: MediaList;\n readonly styleSheet: CSSStyleSheet;\n}\n\ndeclare var CSSImportRule: {\n prototype: CSSImportRule;\n new(): CSSImportRule;\n};\n\ninterface CSSKeyframeRule extends CSSRule {\n keyText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSKeyframeRule: {\n prototype: CSSKeyframeRule;\n new(): CSSKeyframeRule;\n};\n\ninterface CSSKeyframesRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n name: string;\n appendRule(rule: string): void;\n deleteRule(select: string): void;\n findRule(select: string): CSSKeyframeRule | null;\n}\n\ndeclare var CSSKeyframesRule: {\n prototype: CSSKeyframesRule;\n new(): CSSKeyframesRule;\n};\n\ninterface CSSMediaRule extends CSSConditionRule {\n readonly media: MediaList;\n}\n\ndeclare var CSSMediaRule: {\n prototype: CSSMediaRule;\n new(): CSSMediaRule;\n};\n\ninterface CSSNamespaceRule extends CSSRule {\n readonly namespaceURI: string;\n readonly prefix: string;\n}\n\ndeclare var CSSNamespaceRule: {\n prototype: CSSNamespaceRule;\n new(): CSSNamespaceRule;\n};\n\ninterface CSSPageRule extends CSSRule {\n readonly pseudoClass: string;\n readonly selector: string;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSPageRule: {\n prototype: CSSPageRule;\n new(): CSSPageRule;\n};\n\ninterface CSSRule {\n cssText: string;\n readonly parentRule: CSSRule | null;\n readonly parentStyleSheet: CSSStyleSheet | null;\n readonly type: number;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n}\n\ndeclare var CSSRule: {\n prototype: CSSRule;\n new(): CSSRule;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n};\n\ninterface CSSRuleList {\n readonly length: number;\n item(index: number): CSSRule | null;\n [index: number]: CSSRule;\n}\n\ndeclare var CSSRuleList: {\n prototype: CSSRuleList;\n new(): CSSRuleList;\n};\n\ninterface CSSStyleDeclaration {\n alignContent: string | null;\n alignItems: string | null;\n alignSelf: string | null;\n alignmentBaseline: string | null;\n animation: string;\n animationDelay: string;\n animationDirection: string;\n animationDuration: string;\n animationFillMode: string;\n animationIterationCount: string;\n animationName: string;\n animationPlayState: string;\n animationTimingFunction: string;\n backfaceVisibility: string | null;\n background: string | null;\n backgroundAttachment: string | null;\n backgroundClip: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n backgroundOrigin: string | null;\n backgroundPosition: string | null;\n backgroundPositionX: string | null;\n backgroundPositionY: string | null;\n backgroundRepeat: string | null;\n backgroundSize: string | null;\n baselineShift: string | null;\n border: string | null;\n borderBottom: string | null;\n borderBottomColor: string | null;\n borderBottomLeftRadius: string | null;\n borderBottomRightRadius: string | null;\n borderBottomStyle: string | null;\n borderBottomWidth: string | null;\n borderCollapse: string | null;\n borderColor: string | null;\n borderImage: string | null;\n borderImageOutset: string | null;\n borderImageRepeat: string | null;\n borderImageSlice: string | null;\n borderImageSource: string | null;\n borderImageWidth: string | null;\n borderLeft: string | null;\n borderLeftColor: string | null;\n borderLeftStyle: string | null;\n borderLeftWidth: string | null;\n borderRadius: string | null;\n borderRight: string | null;\n borderRightColor: string | null;\n borderRightStyle: string | null;\n borderRightWidth: string | null;\n borderSpacing: string | null;\n borderStyle: string | null;\n borderTop: string | null;\n borderTopColor: string | null;\n borderTopLeftRadius: string | null;\n borderTopRightRadius: string | null;\n borderTopStyle: string | null;\n borderTopWidth: string | null;\n borderWidth: string | null;\n bottom: string | null;\n boxShadow: string | null;\n boxSizing: string | null;\n breakAfter: string | null;\n breakBefore: string | null;\n breakInside: string | null;\n captionSide: string | null;\n clear: string | null;\n clip: string | null;\n clipPath: string | null;\n clipRule: string | null;\n color: string | null;\n colorInterpolationFilters: string | null;\n columnCount: any;\n columnFill: string | null;\n columnGap: any;\n columnRule: string | null;\n columnRuleColor: any;\n columnRuleStyle: string | null;\n columnRuleWidth: any;\n columnSpan: string | null;\n columnWidth: any;\n columns: string | null;\n content: string | null;\n counterIncrement: string | null;\n counterReset: string | null;\n cssFloat: string | null;\n cssText: string;\n cursor: string | null;\n direction: string | null;\n display: string | null;\n dominantBaseline: string | null;\n emptyCells: string | null;\n enableBackground: string | null;\n fill: string | null;\n fillOpacity: string | null;\n fillRule: string | null;\n filter: string | null;\n flex: string | null;\n flexBasis: string | null;\n flexDirection: string | null;\n flexFlow: string | null;\n flexGrow: string | null;\n flexShrink: string | null;\n flexWrap: string | null;\n floodColor: string | null;\n floodOpacity: string | null;\n font: string | null;\n fontFamily: string | null;\n fontFeatureSettings: string | null;\n fontSize: string | null;\n fontSizeAdjust: string | null;\n fontStretch: string | null;\n fontStyle: string | null;\n fontVariant: string | null;\n fontWeight: string | null;\n gap: string | null;\n glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n grid: string | null;\n gridArea: string | null;\n gridAutoColumns: string | null;\n gridAutoFlow: string | null;\n gridAutoRows: string | null;\n gridColumn: string | null;\n gridColumnEnd: string | null;\n gridColumnGap: string | null;\n gridColumnStart: string | null;\n gridGap: string | null;\n gridRow: string | null;\n gridRowEnd: string | null;\n gridRowGap: string | null;\n gridRowStart: string | null;\n gridTemplate: string | null;\n gridTemplateAreas: string | null;\n gridTemplateColumns: string | null;\n gridTemplateRows: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n justifyItems: string | null;\n justifySelf: string | null;\n kerning: string | null;\n layoutGrid: string | null;\n layoutGridChar: string | null;\n layoutGridLine: string | null;\n layoutGridMode: string | null;\n layoutGridType: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: string | null;\n lineBreak: string | null;\n lineHeight: string | null;\n listStyle: string | null;\n listStyleImage: string | null;\n listStylePosition: string | null;\n listStyleType: string | null;\n margin: string | null;\n marginBottom: string | null;\n marginLeft: string | null;\n marginRight: string | null;\n marginTop: string | null;\n marker: string | null;\n markerEnd: string | null;\n markerMid: string | null;\n markerStart: string | null;\n mask: string | null;\n maskImage: string | null;\n maxHeight: string | null;\n maxWidth: string | null;\n minHeight: string | null;\n minWidth: string | null;\n msContentZoomChaining: string | null;\n msContentZoomLimit: string | null;\n msContentZoomLimitMax: any;\n msContentZoomLimitMin: any;\n msContentZoomSnap: string | null;\n msContentZoomSnapPoints: string | null;\n msContentZoomSnapType: string | null;\n msContentZooming: string | null;\n msFlowFrom: string | null;\n msFlowInto: string | null;\n msFontFeatureSettings: string | null;\n msGridColumn: any;\n msGridColumnAlign: string | null;\n msGridColumnSpan: any;\n msGridColumns: string | null;\n msGridRow: any;\n msGridRowAlign: string | null;\n msGridRowSpan: any;\n msGridRows: string | null;\n msHighContrastAdjust: string | null;\n msHyphenateLimitChars: string | null;\n msHyphenateLimitLines: any;\n msHyphenateLimitZone: any;\n msHyphens: string | null;\n msImeAlign: string | null;\n msOverflowStyle: string | null;\n msScrollChaining: string | null;\n msScrollLimit: string | null;\n msScrollLimitXMax: any;\n msScrollLimitXMin: any;\n msScrollLimitYMax: any;\n msScrollLimitYMin: any;\n msScrollRails: string | null;\n msScrollSnapPointsX: string | null;\n msScrollSnapPointsY: string | null;\n msScrollSnapType: string | null;\n msScrollSnapX: string | null;\n msScrollSnapY: string | null;\n msScrollTranslation: string | null;\n msTextCombineHorizontal: string | null;\n msTextSizeAdjust: any;\n msTouchAction: string | null;\n msTouchSelect: string | null;\n msUserSelect: string | null;\n msWrapFlow: string;\n msWrapMargin: any;\n msWrapThrough: string;\n objectFit: string | null;\n objectPosition: string | null;\n opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: string | null;\n outlineOffset: string | null;\n outlineStyle: string | null;\n outlineWidth: string | null;\n overflow: string | null;\n overflowX: string | null;\n overflowY: string | null;\n padding: string | null;\n paddingBottom: string | null;\n paddingLeft: string | null;\n paddingRight: string | null;\n paddingTop: string | null;\n pageBreakAfter: string | null;\n pageBreakBefore: string | null;\n pageBreakInside: string | null;\n readonly parentRule: CSSRule;\n penAction: string | null;\n perspective: string | null;\n perspectiveOrigin: string | null;\n pointerEvents: string | null;\n position: string | null;\n quotes: string | null;\n resize: string | null;\n right: string | null;\n rotate: string | null;\n rowGap: string | null;\n rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: string | null;\n scale: string | null;\n scrollBehavior: string;\n stopColor: string | null;\n stopOpacity: string | null;\n stroke: string | null;\n strokeDasharray: string | null;\n strokeDashoffset: string | null;\n strokeLinecap: string | null;\n strokeLinejoin: string | null;\n strokeMiterlimit: string | null;\n strokeOpacity: string | null;\n strokeWidth: string | null;\n tableLayout: string | null;\n textAlign: string | null;\n textAlignLast: string | null;\n textAnchor: string | null;\n textCombineUpright: string | null;\n textDecoration: string | null;\n textIndent: string | null;\n textJustify: string | null;\n textKashida: string | null;\n textKashidaSpace: string | null;\n textOverflow: string | null;\n textShadow: string | null;\n textTransform: string | null;\n textUnderlinePosition: string | null;\n top: string | null;\n touchAction: string;\n transform: string | null;\n transformOrigin: string | null;\n transformStyle: string | null;\n transition: string;\n transitionDelay: string;\n transitionDuration: string;\n transitionProperty: string;\n transitionTimingFunction: string;\n translate: string | null;\n unicodeBidi: string | null;\n userSelect: string | null;\n verticalAlign: string | null;\n visibility: string | null;\n /** @deprecated */\n webkitAlignContent: string;\n /** @deprecated */\n webkitAlignItems: string;\n /** @deprecated */\n webkitAlignSelf: string;\n /** @deprecated */\n webkitAnimation: string;\n /** @deprecated */\n webkitAnimationDelay: string;\n /** @deprecated */\n webkitAnimationDirection: string;\n /** @deprecated */\n webkitAnimationDuration: string;\n /** @deprecated */\n webkitAnimationFillMode: string;\n /** @deprecated */\n webkitAnimationIterationCount: string;\n /** @deprecated */\n webkitAnimationName: string;\n /** @deprecated */\n webkitAnimationPlayState: string;\n /** @deprecated */\n webkitAnimationTimingFunction: string;\n /** @deprecated */\n webkitAppearance: string;\n /** @deprecated */\n webkitBackfaceVisibility: string;\n /** @deprecated */\n webkitBackgroundClip: string;\n /** @deprecated */\n webkitBackgroundOrigin: string;\n /** @deprecated */\n webkitBackgroundSize: string;\n /** @deprecated */\n webkitBorderBottomLeftRadius: string;\n /** @deprecated */\n webkitBorderBottomRightRadius: string;\n webkitBorderImage: string | null;\n /** @deprecated */\n webkitBorderRadius: string;\n /** @deprecated */\n webkitBorderTopLeftRadius: string;\n /** @deprecated */\n webkitBorderTopRightRadius: string;\n /** @deprecated */\n webkitBoxAlign: string;\n webkitBoxDirection: string | null;\n /** @deprecated */\n webkitBoxFlex: string;\n /** @deprecated */\n webkitBoxOrdinalGroup: string;\n webkitBoxOrient: string | null;\n /** @deprecated */\n webkitBoxPack: string;\n /** @deprecated */\n webkitBoxShadow: string;\n /** @deprecated */\n webkitBoxSizing: string;\n webkitColumnBreakAfter: string | null;\n webkitColumnBreakBefore: string | null;\n webkitColumnBreakInside: string | null;\n webkitColumnCount: any;\n webkitColumnGap: any;\n webkitColumnRule: string | null;\n webkitColumnRuleColor: any;\n webkitColumnRuleStyle: string | null;\n webkitColumnRuleWidth: any;\n webkitColumnSpan: string | null;\n webkitColumnWidth: any;\n webkitColumns: string | null;\n /** @deprecated */\n webkitFilter: string;\n /** @deprecated */\n webkitFlex: string;\n /** @deprecated */\n webkitFlexBasis: string;\n /** @deprecated */\n webkitFlexDirection: string;\n /** @deprecated */\n webkitFlexFlow: string;\n /** @deprecated */\n webkitFlexGrow: string;\n /** @deprecated */\n webkitFlexShrink: string;\n /** @deprecated */\n webkitFlexWrap: string;\n /** @deprecated */\n webkitJustifyContent: string;\n /** @deprecated */\n webkitMask: string;\n /** @deprecated */\n webkitMaskBoxImage: string;\n /** @deprecated */\n webkitMaskBoxImageOutset: string;\n /** @deprecated */\n webkitMaskBoxImageRepeat: string;\n /** @deprecated */\n webkitMaskBoxImageSlice: string;\n /** @deprecated */\n webkitMaskBoxImageSource: string;\n /** @deprecated */\n webkitMaskBoxImageWidth: string;\n /** @deprecated */\n webkitMaskClip: string;\n /** @deprecated */\n webkitMaskComposite: string;\n /** @deprecated */\n webkitMaskImage: string;\n /** @deprecated */\n webkitMaskOrigin: string;\n /** @deprecated */\n webkitMaskPosition: string;\n /** @deprecated */\n webkitMaskRepeat: string;\n /** @deprecated */\n webkitMaskSize: string;\n /** @deprecated */\n webkitOrder: string;\n /** @deprecated */\n webkitPerspective: string;\n /** @deprecated */\n webkitPerspectiveOrigin: string;\n webkitTapHighlightColor: string | null;\n /** @deprecated */\n webkitTextFillColor: string;\n /** @deprecated */\n webkitTextSizeAdjust: string;\n /** @deprecated */\n webkitTextStroke: string;\n /** @deprecated */\n webkitTextStrokeColor: string;\n /** @deprecated */\n webkitTextStrokeWidth: string;\n /** @deprecated */\n webkitTransform: string;\n /** @deprecated */\n webkitTransformOrigin: string;\n /** @deprecated */\n webkitTransformStyle: string;\n /** @deprecated */\n webkitTransition: string;\n /** @deprecated */\n webkitTransitionDelay: string;\n /** @deprecated */\n webkitTransitionDuration: string;\n /** @deprecated */\n webkitTransitionProperty: string;\n /** @deprecated */\n webkitTransitionTimingFunction: string;\n webkitUserModify: string | null;\n webkitUserSelect: string | null;\n webkitWritingMode: string | null;\n whiteSpace: string | null;\n widows: string | null;\n width: string | null;\n wordBreak: string | null;\n wordSpacing: string | null;\n wordWrap: string | null;\n writingMode: string | null;\n zIndex: string | null;\n zoom: string | null;\n getPropertyPriority(propertyName: string): string;\n getPropertyValue(propertyName: string): string;\n item(index: number): string;\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string | null, priority?: string | null): void;\n [index: number]: string;\n}\n\ndeclare var CSSStyleDeclaration: {\n prototype: CSSStyleDeclaration;\n new(): CSSStyleDeclaration;\n};\n\ninterface CSSStyleRule extends CSSRule {\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSStyleRule: {\n prototype: CSSStyleRule;\n new(): CSSStyleRule;\n};\n\ninterface CSSStyleSheet extends StyleSheet {\n readonly cssRules: CSSRuleList;\n /** @deprecated */\n cssText: string;\n /** @deprecated */\n readonly id: string;\n /** @deprecated */\n readonly imports: StyleSheetList;\n /** @deprecated */\n readonly isAlternate: boolean;\n /** @deprecated */\n readonly isPrefAlternate: boolean;\n readonly ownerRule: CSSRule | null;\n /** @deprecated */\n readonly owningElement: Element;\n /** @deprecated */\n readonly pages: any;\n /** @deprecated */\n readonly readOnly: boolean;\n readonly rules: CSSRuleList;\n /** @deprecated */\n addImport(bstrURL: string, lIndex?: number): number;\n /** @deprecated */\n addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;\n addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;\n deleteRule(index?: number): void;\n insertRule(rule: string, index?: number): number;\n /** @deprecated */\n removeImport(lIndex: number): void;\n removeRule(lIndex: number): void;\n}\n\ndeclare var CSSStyleSheet: {\n prototype: CSSStyleSheet;\n new(): CSSStyleSheet;\n};\n\ninterface CSSSupportsRule extends CSSConditionRule {\n}\n\ndeclare var CSSSupportsRule: {\n prototype: CSSSupportsRule;\n new(): CSSSupportsRule;\n};\n\ninterface Cache {\n add(request: RequestInfo): Promise;\n addAll(requests: RequestInfo[]): Promise;\n delete(request: RequestInfo, options?: CacheQueryOptions): Promise;\n keys(request?: RequestInfo, options?: CacheQueryOptions): Promise>;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise>;\n put(request: RequestInfo, response: Response): Promise;\n}\n\ndeclare var Cache: {\n prototype: Cache;\n new(): Cache;\n};\n\ninterface CacheStorage {\n delete(cacheName: string): Promise;\n has(cacheName: string): Promise;\n keys(): Promise;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n open(cacheName: string): Promise;\n}\n\ndeclare var CacheStorage: {\n prototype: CacheStorage;\n new(): CacheStorage;\n};\n\ninterface CanvasCompositing {\n globalAlpha: number;\n globalCompositeOperation: string;\n}\n\ninterface CanvasDrawImage {\n drawImage(image: CanvasImageSource, dx: number, dy: number): void;\n drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;\n drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;\n}\n\ninterface CanvasDrawPath {\n beginPath(): void;\n clip(fillRule?: CanvasFillRule): void;\n clip(path: Path2D, fillRule?: CanvasFillRule): void;\n fill(fillRule?: CanvasFillRule): void;\n fill(path: Path2D, fillRule?: CanvasFillRule): void;\n isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInStroke(x: number, y: number): boolean;\n isPointInStroke(path: Path2D, x: number, y: number): boolean;\n stroke(): void;\n stroke(path: Path2D): void;\n}\n\ninterface CanvasFillStrokeStyles {\n fillStyle: string | CanvasGradient | CanvasPattern;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\n createPattern(image: CanvasImageSource, repetition: string): CanvasPattern | null;\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\n}\n\ninterface CanvasFilters {\n filter: string;\n}\n\ninterface CanvasGradient {\n /**\n * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset\n * at one end of the gradient, 1.0 is the offset at the other end.\n * Throws an \"IndexSizeError\" DOMException if the offset\n * is out of range. Throws a \"SyntaxError\" DOMException if\n * the color cannot be parsed.\n */\n addColorStop(offset: number, color: string): void;\n}\n\ndeclare var CanvasGradient: {\n prototype: CanvasGradient;\n new(): CanvasGradient;\n};\n\ninterface CanvasImageData {\n createImageData(sw: number, sh: number): ImageData;\n createImageData(imagedata: ImageData): ImageData;\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\n putImageData(imagedata: ImageData, dx: number, dy: number): void;\n putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;\n}\n\ninterface CanvasImageSmoothing {\n imageSmoothingEnabled: boolean;\n imageSmoothingQuality: ImageSmoothingQuality;\n}\n\ninterface CanvasPath {\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\n closePath(): void;\n ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n lineTo(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\n rect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface CanvasPathDrawingStyles {\n lineCap: CanvasLineCap;\n lineDashOffset: number;\n lineJoin: CanvasLineJoin;\n lineWidth: number;\n miterLimit: number;\n getLineDash(): number[];\n setLineDash(segments: number[]): void;\n}\n\ninterface CanvasPattern {\n /**\n * Sets the transformation matrix that will be used when rendering the pattern during a fill or\n * stroke painting operation.\n */\n setTransform(transform?: DOMMatrix2DInit): void;\n}\n\ndeclare var CanvasPattern: {\n prototype: CanvasPattern;\n new(): CanvasPattern;\n};\n\ninterface CanvasRect {\n clearRect(x: number, y: number, w: number, h: number): void;\n fillRect(x: number, y: number, w: number, h: number): void;\n strokeRect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath {\n readonly canvas: HTMLCanvasElement;\n}\n\ndeclare var CanvasRenderingContext2D: {\n prototype: CanvasRenderingContext2D;\n new(): CanvasRenderingContext2D;\n};\n\ninterface CanvasShadowStyles {\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n}\n\ninterface CanvasState {\n restore(): void;\n save(): void;\n}\n\ninterface CanvasText {\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\n measureText(text: string): TextMetrics;\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\n}\n\ninterface CanvasTextDrawingStyles {\n direction: CanvasDirection;\n font: string;\n textAlign: CanvasTextAlign;\n textBaseline: CanvasTextBaseline;\n}\n\ninterface CanvasTransform {\n getTransform(): DOMMatrix;\n resetTransform(): void;\n rotate(angle: number): void;\n scale(x: number, y: number): void;\n setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\n setTransform(transform?: DOMMatrix2DInit): void;\n transform(a: number, b: number, c: number, d: number, e: number, f: number): void;\n translate(x: number, y: number): void;\n}\n\ninterface CanvasUserInterface {\n drawFocusIfNeeded(element: Element): void;\n drawFocusIfNeeded(path: Path2D, element: Element): void;\n scrollPathIntoView(): void;\n scrollPathIntoView(path: Path2D): void;\n}\n\ninterface CaretPosition {\n readonly offset: number;\n readonly offsetNode: Node;\n getClientRect(): DOMRect | null;\n}\n\ndeclare var CaretPosition: {\n prototype: CaretPosition;\n new(): CaretPosition;\n};\n\ninterface ChannelMergerNode extends AudioNode {\n}\n\ndeclare var ChannelMergerNode: {\n prototype: ChannelMergerNode;\n new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode;\n};\n\ninterface ChannelSplitterNode extends AudioNode {\n}\n\ndeclare var ChannelSplitterNode: {\n prototype: ChannelSplitterNode;\n new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode;\n};\n\ninterface CharacterData extends Node, NonDocumentTypeChildNode, ChildNode {\n data: string;\n readonly length: number;\n appendData(data: string): void;\n deleteData(offset: number, count: number): void;\n insertData(offset: number, data: string): void;\n replaceData(offset: number, count: number, data: string): void;\n substringData(offset: number, count: number): string;\n}\n\ndeclare var CharacterData: {\n prototype: CharacterData;\n new(): CharacterData;\n};\n\ninterface ChildNode extends Node {\n /**\n * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.\n * Throws a \"HierarchyRequestError\" DOMException if the constraints of\n * the node tree are violated.\n */\n after(...nodes: (Node | string)[]): void;\n /**\n * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.\n * Throws a \"HierarchyRequestError\" DOMException if the constraints of\n * the node tree are violated.\n */\n before(...nodes: (Node | string)[]): void;\n /**\n * Removes node.\n */\n remove(): void;\n /**\n * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.\n * Throws a \"HierarchyRequestError\" DOMException if the constraints of\n * the node tree are violated.\n */\n replaceWith(...nodes: (Node | string)[]): void;\n}\n\ninterface ClientRect {\n bottom: number;\n readonly height: number;\n left: number;\n right: number;\n top: number;\n readonly width: number;\n}\n\ndeclare var ClientRect: {\n prototype: ClientRect;\n new(): ClientRect;\n};\n\ninterface ClientRectList {\n readonly length: number;\n item(index: number): ClientRect;\n [index: number]: ClientRect;\n}\n\ndeclare var ClientRectList: {\n prototype: ClientRectList;\n new(): ClientRectList;\n};\n\ninterface ClipboardEvent extends Event {\n readonly clipboardData: DataTransfer;\n}\n\ndeclare var ClipboardEvent: {\n prototype: ClipboardEvent;\n new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\n};\n\ninterface ClipboardEventInit extends EventInit {\n data?: string;\n dataType?: string;\n}\n\ninterface CloseEvent extends Event {\n readonly code: number;\n readonly reason: string;\n readonly wasClean: boolean;\n /** @deprecated */\n initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;\n}\n\ndeclare var CloseEvent: {\n prototype: CloseEvent;\n new(type: string, eventInitDict?: CloseEventInit): CloseEvent;\n};\n\ninterface Comment extends CharacterData {\n}\n\ndeclare var Comment: {\n prototype: Comment;\n new(data?: string): Comment;\n};\n\ninterface CompositionEvent extends UIEvent {\n readonly data: string;\n readonly locale: string;\n initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;\n}\n\ndeclare var CompositionEvent: {\n prototype: CompositionEvent;\n new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;\n};\n\ninterface ConcatParams extends Algorithm {\n algorithmId: Uint8Array;\n hash?: string | Algorithm;\n partyUInfo: Uint8Array;\n partyVInfo: Uint8Array;\n privateInfo?: Uint8Array;\n publicInfo?: Uint8Array;\n}\n\ninterface Console {\n memory: any;\n assert(condition?: boolean, message?: string, ...data: any[]): void;\n clear(): void;\n count(label?: string): void;\n debug(message?: any, ...optionalParams: any[]): void;\n dir(value?: any, ...optionalParams: any[]): void;\n dirxml(value: any): void;\n error(message?: any, ...optionalParams: any[]): void;\n exception(message?: string, ...optionalParams: any[]): void;\n group(groupTitle?: string, ...optionalParams: any[]): void;\n groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;\n groupEnd(): void;\n info(message?: any, ...optionalParams: any[]): void;\n log(message?: any, ...optionalParams: any[]): void;\n markTimeline(label?: string): void;\n profile(reportName?: string): void;\n profileEnd(reportName?: string): void;\n table(...tabularData: any[]): void;\n time(label?: string): void;\n timeEnd(label?: string): void;\n timeStamp(label?: string): void;\n timeline(label?: string): void;\n timelineEnd(label?: string): void;\n trace(message?: any, ...optionalParams: any[]): void;\n warn(message?: any, ...optionalParams: any[]): void;\n}\n\ndeclare var Console: {\n prototype: Console;\n new(): Console;\n};\n\ninterface ConstantSourceNode extends AudioScheduledSourceNode {\n readonly offset: AudioParam;\n addEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ConstantSourceNode: {\n prototype: ConstantSourceNode;\n new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode;\n};\n\ninterface ConvolverNode extends AudioNode {\n buffer: AudioBuffer | null;\n normalize: boolean;\n}\n\ndeclare var ConvolverNode: {\n prototype: ConvolverNode;\n new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode;\n};\n\ninterface Coordinates {\n readonly accuracy: number;\n readonly altitude: number | null;\n readonly altitudeAccuracy: number | null;\n readonly heading: number | null;\n readonly latitude: number;\n readonly longitude: number;\n readonly speed: number | null;\n}\n\ninterface CountQueuingStrategy extends QueuingStrategy {\n highWaterMark: number;\n size(chunk: any): 1;\n}\n\ndeclare var CountQueuingStrategy: {\n prototype: CountQueuingStrategy;\n new(options: { highWaterMark: number }): CountQueuingStrategy;\n};\n\ninterface Crypto {\n readonly subtle: SubtleCrypto;\n getRandomValues(array: T): T;\n}\n\ndeclare var Crypto: {\n prototype: Crypto;\n new(): Crypto;\n};\n\ninterface CryptoKey {\n readonly algorithm: KeyAlgorithm;\n readonly extractable: boolean;\n readonly type: KeyType;\n readonly usages: KeyUsage[];\n}\n\ndeclare var CryptoKey: {\n prototype: CryptoKey;\n new(): CryptoKey;\n};\n\ninterface CryptoKeyPair {\n privateKey: CryptoKey;\n publicKey: CryptoKey;\n}\n\ndeclare var CryptoKeyPair: {\n prototype: CryptoKeyPair;\n new(): CryptoKeyPair;\n};\n\ninterface CustomElementRegistry {\n define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;\n get(name: string): any;\n upgrade(root: Node): void;\n whenDefined(name: string): Promise;\n}\n\ndeclare var CustomElementRegistry: {\n prototype: CustomElementRegistry;\n new(): CustomElementRegistry;\n};\n\ninterface CustomEvent extends Event {\n /**\n * Returns any custom data event was created with.\n * Typically used for synthetic events.\n */\n readonly detail: T;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\n}\n\ndeclare var CustomEvent: {\n prototype: CustomEvent;\n new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;\n};\n\ninterface DOMError {\n readonly name: string;\n toString(): string;\n}\n\ndeclare var DOMError: {\n prototype: DOMError;\n new(): DOMError;\n};\n\ninterface DOMException {\n readonly code: number;\n readonly message: string;\n readonly name: string;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n}\n\ndeclare var DOMException: {\n prototype: DOMException;\n new(message?: string, name?: string): DOMException;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n};\n\ninterface DOMImplementation {\n createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;\n createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\n createHTMLDocument(title?: string): Document;\n /** @deprecated */\n hasFeature(...args: any[]): true;\n}\n\ndeclare var DOMImplementation: {\n prototype: DOMImplementation;\n new(): DOMImplementation;\n};\n\ninterface DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOMMatrix extends DOMMatrixReadOnly {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n m11: number;\n m12: number;\n m13: number;\n m14: number;\n m21: number;\n m22: number;\n m23: number;\n m24: number;\n m31: number;\n m32: number;\n m33: number;\n m34: number;\n m41: number;\n m42: number;\n m43: number;\n m44: number;\n invertSelf(): DOMMatrix;\n multiplySelf(other?: DOMMatrixInit): DOMMatrix;\n preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;\n rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\n rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;\n rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\n scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\n scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\n setMatrixValue(transformList: string): DOMMatrix;\n skewXSelf(sx?: number): DOMMatrix;\n skewYSelf(sy?: number): DOMMatrix;\n translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;\n}\n\ndeclare var DOMMatrix: {\n prototype: DOMMatrix;\n new(init?: string | number[]): DOMMatrix;\n fromFloat32Array(array32: Float32Array): DOMMatrix;\n fromFloat64Array(array64: Float64Array): DOMMatrix;\n fromMatrix(other?: DOMMatrixInit): DOMMatrix;\n};\n\ntype SVGMatrix = DOMMatrix;\ndeclare var SVGMatrix: typeof DOMMatrix;\n\ntype WebKitCSSMatrix = DOMMatrix;\ndeclare var WebKitCSSMatrix: typeof DOMMatrix;\n\ninterface DOMMatrixReadOnly {\n readonly a: number;\n readonly b: number;\n readonly c: number;\n readonly d: number;\n readonly e: number;\n readonly f: number;\n readonly is2D: boolean;\n readonly isIdentity: boolean;\n readonly m11: number;\n readonly m12: number;\n readonly m13: number;\n readonly m14: number;\n readonly m21: number;\n readonly m22: number;\n readonly m23: number;\n readonly m24: number;\n readonly m31: number;\n readonly m32: number;\n readonly m33: number;\n readonly m34: number;\n readonly m41: number;\n readonly m42: number;\n readonly m43: number;\n readonly m44: number;\n flipX(): DOMMatrix;\n flipY(): DOMMatrix;\n inverse(): DOMMatrix;\n multiply(other?: DOMMatrixInit): DOMMatrix;\n rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;\n rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;\n rotateFromVector(x?: number, y?: number): DOMMatrix;\n scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\n scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;\n skewX(sx?: number): DOMMatrix;\n skewY(sy?: number): DOMMatrix;\n toFloat32Array(): Float32Array;\n toFloat64Array(): Float64Array;\n toJSON(): any;\n transformPoint(point?: DOMPointInit): DOMPoint;\n translate(tx?: number, ty?: number, tz?: number): DOMMatrix;\n}\n\ndeclare var DOMMatrixReadOnly: {\n prototype: DOMMatrixReadOnly;\n new(init?: string | number[]): DOMMatrixReadOnly;\n fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;\n fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;\n fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;\n};\n\ninterface DOMParser {\n parseFromString(str: string, type: SupportedType): Document;\n}\n\ndeclare var DOMParser: {\n prototype: DOMParser;\n new(): DOMParser;\n};\n\ninterface DOMPoint extends DOMPointReadOnly {\n w: number;\n x: number;\n y: number;\n z: number;\n}\n\ndeclare var DOMPoint: {\n prototype: DOMPoint;\n new(x?: number, y?: number, z?: number, w?: number): DOMPoint;\n fromPoint(other?: DOMPointInit): DOMPoint;\n};\n\ntype SVGPoint = DOMPoint;\ndeclare var SVGPoint: typeof DOMPoint;\n\ninterface DOMPointReadOnly {\n readonly w: number;\n readonly x: number;\n readonly y: number;\n readonly z: number;\n matrixTransform(matrix?: DOMMatrixInit): DOMPoint;\n toJSON(): any;\n}\n\ndeclare var DOMPointReadOnly: {\n prototype: DOMPointReadOnly;\n new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly;\n fromPoint(other?: DOMPointInit): DOMPointReadOnly;\n};\n\ninterface DOMQuad {\n readonly p1: DOMPoint;\n readonly p2: DOMPoint;\n readonly p3: DOMPoint;\n readonly p4: DOMPoint;\n getBounds(): DOMRect;\n toJSON(): any;\n}\n\ndeclare var DOMQuad: {\n prototype: DOMQuad;\n new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad;\n fromQuad(other?: DOMQuadInit): DOMQuad;\n fromRect(other?: DOMRectInit): DOMQuad;\n};\n\ninterface DOMRect extends DOMRectReadOnly {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var DOMRect: {\n prototype: DOMRect;\n new(x?: number, y?: number, width?: number, height?: number): DOMRect;\n fromRect(other?: DOMRectInit): DOMRect;\n};\n\ntype SVGRect = DOMRect;\ndeclare var SVGRect: typeof DOMRect;\n\ninterface DOMRectList {\n readonly length: number;\n item(index: number): DOMRect | null;\n [index: number]: DOMRect;\n}\n\ndeclare var DOMRectList: {\n prototype: DOMRectList;\n new(): DOMRectList;\n};\n\ninterface DOMRectReadOnly {\n readonly bottom: number;\n readonly height: number;\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly width: number;\n readonly x: number;\n readonly y: number;\n toJSON(): any;\n}\n\ndeclare var DOMRectReadOnly: {\n prototype: DOMRectReadOnly;\n new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\n fromRect(other?: DOMRectInit): DOMRectReadOnly;\n};\n\ninterface DOMSettableTokenList extends DOMTokenList {\n value: string;\n}\n\ndeclare var DOMSettableTokenList: {\n prototype: DOMSettableTokenList;\n new(): DOMSettableTokenList;\n};\n\ninterface DOMStringList {\n /**\n * Returns the number of strings in strings.\n */\n readonly length: number;\n /**\n * Returns true if strings contains string, and false\n * otherwise.\n */\n contains(string: string): boolean;\n /**\n * Returns the string with index index from strings.\n */\n item(index: number): string | null;\n [index: number]: string;\n}\n\ndeclare var DOMStringList: {\n prototype: DOMStringList;\n new(): DOMStringList;\n};\n\ninterface DOMStringMap {\n [name: string]: string | undefined;\n}\n\ndeclare var DOMStringMap: {\n prototype: DOMStringMap;\n new(): DOMStringMap;\n};\n\ninterface DOMTokenList {\n /**\n * Returns the number of tokens.\n */\n readonly length: number;\n /**\n * Returns the associated set as string.\n * Can be set, to change the associated attribute.\n */\n value: string;\n /**\n * Adds all arguments passed, except those already present.\n * Throws a \"SyntaxError\" DOMException if one of the arguments is the empty\n * string.\n * Throws an \"InvalidCharacterError\" DOMException if one of the arguments\n * contains any ASCII whitespace.\n */\n add(...tokens: string[]): void;\n /**\n * Returns true if token is present, and false otherwise.\n */\n contains(token: string): boolean;\n /**\n * tokenlist[index]\n */\n item(index: number): string | null;\n /**\n * Removes arguments passed, if they are present.\n * Throws a \"SyntaxError\" DOMException if one of the arguments is the empty\n * string.\n * Throws an \"InvalidCharacterError\" DOMException if one of the arguments\n * contains any ASCII whitespace.\n */\n remove(...tokens: string[]): void;\n /**\n * Replaces token with newToken.\n * Returns true if token was replaced with newToken, and false otherwise.\n * Throws a \"SyntaxError\" DOMException if one of the arguments is the empty\n * string.\n * Throws an \"InvalidCharacterError\" DOMException if one of the arguments\n * contains any ASCII whitespace.\n */\n replace(oldToken: string, newToken: string): void;\n /**\n * Returns true if token is in the associated attribute's supported tokens. Returns\n * false otherwise.\n * Throws a TypeError if the associated attribute has no supported tokens defined.\n */\n supports(token: string): boolean;\n toggle(token: string, force?: boolean): boolean;\n forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void;\n [index: number]: string;\n}\n\ndeclare var DOMTokenList: {\n prototype: DOMTokenList;\n new(): DOMTokenList;\n};\n\ninterface DataCue extends TextTrackCue {\n data: ArrayBuffer;\n addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var DataCue: {\n prototype: DataCue;\n new(): DataCue;\n};\n\ninterface DataTransfer {\n dropEffect: string;\n effectAllowed: string;\n /**\n * Returns a FileList of the files being dragged, if any.\n */\n readonly files: FileList;\n /**\n * Returns a DataTransferItemList object, with the drag data.\n */\n readonly items: DataTransferItemList;\n /**\n * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being\n * dragged, then one of the types will be the string \"Files\".\n */\n readonly types: ReadonlyArray;\n /**\n * Removes the data of the specified formats. Removes all data if the argument is omitted.\n */\n clearData(format?: string): void;\n /**\n * Returns the specified data. If there is no such data, returns the empty string.\n */\n getData(format: string): string;\n /**\n * Adds the specified data.\n */\n setData(format: string, data: string): void;\n /**\n * Uses the given element to update the drag feedback, replacing any previously specified\n * feedback.\n */\n setDragImage(image: Element, x: number, y: number): void;\n}\n\ndeclare var DataTransfer: {\n prototype: DataTransfer;\n new(): DataTransfer;\n};\n\ninterface DataTransferItem {\n /**\n * Returns the drag data item kind, one of: \"string\",\n * \"file\".\n */\n readonly kind: string;\n /**\n * Returns the drag data item type string.\n */\n readonly type: string;\n /**\n * Returns a File object, if the drag data item kind is File.\n */\n getAsFile(): File | null;\n /**\n * Invokes the callback with the string data as the argument, if the drag data item\n * kind is Plain Unicode string.\n */\n getAsString(callback: FunctionStringCallback | null): void;\n webkitGetAsEntry(): any;\n}\n\ndeclare var DataTransferItem: {\n prototype: DataTransferItem;\n new(): DataTransferItem;\n};\n\ninterface DataTransferItemList {\n /**\n * Returns the number of items in the drag data store.\n */\n readonly length: number;\n /**\n * Adds a new entry for the given data to the drag data store. If the data is plain\n * text then a type string has to be provided\n * also.\n */\n add(data: string, type: string): DataTransferItem | null;\n add(data: File): DataTransferItem | null;\n /**\n * Removes all the entries in the drag data store.\n */\n clear(): void;\n item(index: number): DataTransferItem;\n /**\n * Removes the indexth entry in the drag data store.\n */\n remove(index: number): void;\n [name: number]: DataTransferItem;\n}\n\ndeclare var DataTransferItemList: {\n prototype: DataTransferItemList;\n new(): DataTransferItemList;\n};\n\ninterface DeferredPermissionRequest {\n readonly id: number;\n readonly type: MSWebViewPermissionType;\n readonly uri: string;\n allow(): void;\n deny(): void;\n}\n\ndeclare var DeferredPermissionRequest: {\n prototype: DeferredPermissionRequest;\n new(): DeferredPermissionRequest;\n};\n\ninterface DelayNode extends AudioNode {\n readonly delayTime: AudioParam;\n}\n\ndeclare var DelayNode: {\n prototype: DelayNode;\n new(context: BaseAudioContext, options?: DelayOptions): DelayNode;\n};\n\ninterface DeviceAcceleration {\n readonly x: number | null;\n readonly y: number | null;\n readonly z: number | null;\n}\n\ndeclare var DeviceAcceleration: {\n prototype: DeviceAcceleration;\n new(): DeviceAcceleration;\n};\n\ninterface DeviceLightEvent extends Event {\n readonly value: number;\n}\n\ndeclare var DeviceLightEvent: {\n prototype: DeviceLightEvent;\n new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\n};\n\ninterface DeviceMotionEvent extends Event {\n readonly acceleration: DeviceAcceleration | null;\n readonly accelerationIncludingGravity: DeviceAcceleration | null;\n readonly interval: number | null;\n readonly rotationRate: DeviceRotationRate | null;\n initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;\n}\n\ndeclare var DeviceMotionEvent: {\n prototype: DeviceMotionEvent;\n new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\n};\n\ninterface DeviceOrientationEvent extends Event {\n readonly absolute: boolean;\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;\n}\n\ndeclare var DeviceOrientationEvent: {\n prototype: DeviceOrientationEvent;\n new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\n};\n\ninterface DeviceRotationRate {\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n}\n\ndeclare var DeviceRotationRate: {\n prototype: DeviceRotationRate;\n new(): DeviceRotationRate;\n};\n\ninterface DhImportKeyParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyAlgorithm extends KeyAlgorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface DhKeyGenParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n \"readystatechange\": ProgressEvent;\n \"visibilitychange\": Event;\n}\n\ninterface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, GlobalEventHandlers, DocumentAndElementEventHandlers {\n /**\n * Sets or gets the URL for the current document.\n */\n readonly URL: string;\n /**\n * Gets the object that has the focus when the parent document has focus.\n */\n readonly activeElement: Element | null;\n /**\n * Sets or gets the color of all active links in the document.\n */\n /** @deprecated */\n alinkColor: string;\n /**\n * Returns a reference to the collection of elements contained by the object.\n */\n /** @deprecated */\n readonly all: HTMLAllCollection;\n /**\n * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\n */\n /** @deprecated */\n readonly anchors: HTMLCollectionOf;\n /**\n * Retrieves a collection of all applet objects in the document.\n */\n /** @deprecated */\n readonly applets: HTMLCollectionOf;\n /**\n * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\n */\n /** @deprecated */\n bgColor: string;\n /**\n * Specifies the beginning and end of the document body.\n */\n body: HTMLElement;\n /**\n * Returns document's encoding.\n */\n readonly characterSet: string;\n /**\n * Gets or sets the character set used to encode the object.\n */\n readonly charset: string;\n /**\n * Gets a value that indicates whether standards-compliant mode is switched on for the object.\n */\n readonly compatMode: string;\n /**\n * Returns document's content type.\n */\n readonly contentType: string;\n /**\n * Returns the HTTP cookies that apply to the Document. If there are no cookies or\n * cookies can't be applied to this resource, the empty string will be returned.\n * Can be set, to add a new cookie to the element's set of HTTP cookies.\n * If the contents are sandboxed into a\n * unique origin (e.g. in an iframe with the sandbox attribute), a\n * \"SecurityError\" DOMException will be thrown on getting\n * and setting.\n */\n cookie: string;\n /**\n * Returns the script element, or the SVG script element,\n * that is currently executing, as long as the element represents a classic script.\n * In the case of reentrant script execution, returns the one that most recently started executing\n * amongst those that have not yet finished executing.\n * Returns null if the Document is not currently executing a script\n * or SVG script element (e.g., because the running script is an event\n * handler, or a timeout), or if the currently executing script or SVG\n * script element represents a module script.\n */\n readonly currentScript: HTMLOrSVGScriptElement | null;\n readonly defaultView: WindowProxy | null;\n /**\n * Sets or gets a value that indicates whether the document can be edited.\n */\n designMode: string;\n /**\n * Sets or retrieves a value that indicates the reading order of the object.\n */\n dir: string;\n /**\n * Gets an object representing the document type declaration associated with the current document.\n */\n readonly doctype: DocumentType | null;\n /**\n * Gets a reference to the root node of the document.\n */\n readonly documentElement: HTMLElement;\n /**\n * Returns document's URL.\n */\n readonly documentURI: string;\n /**\n * Sets or gets the security domain of the document.\n */\n domain: string;\n /**\n * Retrieves a collection of all embed objects in the document.\n */\n readonly embeds: HTMLCollectionOf;\n /**\n * Sets or gets the foreground (text) color of the document.\n */\n /** @deprecated */\n fgColor: string;\n /**\n * Retrieves a collection, in source order, of all form objects in the document.\n */\n readonly forms: HTMLCollectionOf;\n /** @deprecated */\n readonly fullscreen: boolean;\n /**\n * Returns true if document has the ability to display elements fullscreen\n * and fullscreen is supported, or false otherwise.\n */\n readonly fullscreenEnabled: boolean;\n /**\n * Returns the head element.\n */\n readonly head: HTMLHeadElement;\n readonly hidden: boolean;\n /**\n * Retrieves a collection, in source order, of img objects in the document.\n */\n readonly images: HTMLCollectionOf;\n /**\n * Gets the implementation object of the current document.\n */\n readonly implementation: DOMImplementation;\n /**\n * Returns the character encoding used to create the webpage that is loaded into the document object.\n */\n readonly inputEncoding: string;\n /**\n * Gets the date that the page was last modified, if the page supplies one.\n */\n readonly lastModified: string;\n /**\n * Sets or gets the color of the document links.\n */\n /** @deprecated */\n linkColor: string;\n /**\n * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\n */\n readonly links: HTMLCollectionOf;\n /**\n * Contains information about the current URL.\n */\n location: Location;\n onfullscreenchange: ((this: Document, ev: Event) => any) | null;\n onfullscreenerror: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the state of the object has changed.\n * @param ev The event\n */\n onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null;\n onvisibilitychange: ((this: Document, ev: Event) => any) | null;\n /**\n * Returns document's origin.\n */\n readonly origin: string;\n /**\n * Return an HTMLCollection of the embed elements in the Document.\n */\n readonly plugins: HTMLCollectionOf;\n /**\n * Retrieves a value that indicates the current state of the object.\n */\n readonly readyState: DocumentReadyState;\n /**\n * Gets the URL of the location that referred the user to the current page.\n */\n readonly referrer: string;\n /**\n * Retrieves a collection of all script objects in the document.\n */\n readonly scripts: HTMLCollectionOf;\n readonly scrollingElement: Element | null;\n readonly timeline: DocumentTimeline;\n /**\n * Contains the title of the document.\n */\n title: string;\n readonly visibilityState: VisibilityState;\n /**\n * Sets or gets the color of the links that the user has visited.\n */\n /** @deprecated */\n vlinkColor: string;\n /**\n * Moves node from another document and returns it.\n * If node is a document, throws a \"NotSupportedError\" DOMException or, if node is a shadow root, throws a\n * \"HierarchyRequestError\" DOMException.\n */\n adoptNode(source: T): T;\n /** @deprecated */\n captureEvents(): void;\n caretPositionFromPoint(x: number, y: number): CaretPosition | null;\n /** @deprecated */\n caretRangeFromPoint(x: number, y: number): Range;\n /** @deprecated */\n clear(): void;\n /**\n * Closes an output stream and forces the sent data to display.\n */\n close(): void;\n /**\n * Creates an attribute object with a specified name.\n * @param name String that sets the attribute object's name.\n */\n createAttribute(localName: string): Attr;\n createAttributeNS(namespace: string | null, qualifiedName: string): Attr;\n /**\n * Returns a CDATASection node whose data is data.\n */\n createCDATASection(data: string): CDATASection;\n /**\n * Creates a comment object with the specified data.\n * @param data Sets the comment object's data.\n */\n createComment(data: string): Comment;\n /**\n * Creates a new document.\n */\n createDocumentFragment(): DocumentFragment;\n /**\n * Creates an instance of the element for the specified tag.\n * @param tagName The name of an element.\n */\n createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];\n /** @deprecated */\n createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K];\n createElement(tagName: string, options?: ElementCreationOptions): HTMLElement;\n /**\n * Returns an element with namespace namespace. Its namespace prefix will be everything before \":\" (U+003E) in qualifiedName or null. Its local name will be everything after\n * \":\" (U+003E) in qualifiedName or qualifiedName.\n * If localName does not match the Name production an\n * \"InvalidCharacterError\" DOMException will be thrown.\n * If one of the following conditions is true a \"NamespaceError\" DOMException will be thrown:\n * localName does not match the QName production.\n * Namespace prefix is not null and namespace is the empty string.\n * Namespace prefix is \"xml\" and namespace is not the XML namespace.\n * qualifiedName or namespace prefix is \"xmlns\" and namespace is not the XMLNS namespace.\n * namespace is the XMLNS namespace and\n * neither qualifiedName nor namespace prefix is \"xmlns\".\n * When supplied, options's is can be used to create a customized built-in element.\n */\n createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"componentTransferFunction\"): SVGComponentTransferFunctionElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"cursor\"): SVGCursorElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"defs\"): SVGDefsElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"desc\"): SVGDescElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"ellipse\"): SVGEllipseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feBlend\"): SVGFEBlendElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feColorMatrix\"): SVGFEColorMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComponentTransfer\"): SVGFEComponentTransferElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComposite\"): SVGFECompositeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feConvolveMatrix\"): SVGFEConvolveMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDiffuseLighting\"): SVGFEDiffuseLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDisplacementMap\"): SVGFEDisplacementMapElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDistantLight\"): SVGFEDistantLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFlood\"): SVGFEFloodElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncA\"): SVGFEFuncAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncB\"): SVGFEFuncBElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncG\"): SVGFEFuncGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncR\"): SVGFEFuncRElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feGaussianBlur\"): SVGFEGaussianBlurElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feImage\"): SVGFEImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMerge\"): SVGFEMergeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMergeNode\"): SVGFEMergeNodeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMorphology\"): SVGFEMorphologyElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feOffset\"): SVGFEOffsetElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"fePointLight\"): SVGFEPointLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpecularLighting\"): SVGFESpecularLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpotLight\"): SVGFESpotLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTile\"): SVGFETileElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTurbulence\"): SVGFETurbulenceElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"filter\"): SVGFilterElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"foreignObject\"): SVGForeignObjectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"g\"): SVGGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"image\"): SVGImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"gradient\"): SVGGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"line\"): SVGLineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"linearGradient\"): SVGLinearGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"marker\"): SVGMarkerElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"mask\"): SVGMaskElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"path\"): SVGPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"metadata\"): SVGMetadataElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"pattern\"): SVGPatternElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polygon\"): SVGPolygonElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polyline\"): SVGPolylineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"radialGradient\"): SVGRadialGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"rect\"): SVGRectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"svg\"): SVGSVGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"stop\"): SVGStopElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"switch\"): SVGSwitchElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"symbol\"): SVGSymbolElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"tspan\"): SVGTSpanElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textContent\"): SVGTextContentElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"text\"): SVGTextElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPath\"): SVGTextPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPositioning\"): SVGTextPositioningElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"use\"): SVGUseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"view\"): SVGViewElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement;\n createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element;\n createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element;\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AnimationPlaybackEvent\"): AnimationPlaybackEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"MSGestureEvent\"): MSGestureEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MSPointerEvent\"): MSPointerEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaQueryListEvent\"): MediaQueryListEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"PromiseRejectionEvent\"): PromiseRejectionEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDataChannelEvent\"): RTCDataChannelEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCErrorEvent\"): RTCErrorEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceErrorEvent\"): RTCPeerConnectionIceErrorEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"RTCStatsEvent\"): RTCStatsEvent;\n createEvent(eventInterface: \"RTCTrackEvent\"): RTCTrackEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"SecurityPolicyViolationEvent\"): SecurityPolicyViolationEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechRecognitionError\"): SpeechRecognitionError;\n createEvent(eventInterface: \"SpeechRecognitionEvent\"): SpeechRecognitionEvent;\n createEvent(eventInterface: \"SpeechSynthesisErrorEvent\"): SpeechSynthesisErrorEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TouchEvent\"): TouchEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"VRDisplayEvent\"): VRDisplayEvent;\n createEvent(eventInterface: \"VRDisplayEvent \"): VRDisplayEvent ;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator;\n /**\n * Returns a ProcessingInstruction node whose target is target and data is data.\n * If target does not match the Name production an\n * \"InvalidCharacterError\" DOMException will be thrown.\n * If data contains \"?>\" an\n * \"InvalidCharacterError\" DOMException will be thrown.\n */\n createProcessingInstruction(target: string, data: string): ProcessingInstruction;\n /**\n * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\n */\n createRange(): Range;\n /**\n * Creates a text string from the specified value.\n * @param data String that specifies the nodeValue property of the text node.\n */\n createTextNode(data: string): Text;\n createTouch(view: WindowProxy, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;\n createTouchList(...touches: Touch[]): TouchList;\n /**\n * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\n * @param filter A custom NodeFilter function to use.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;\n /** @deprecated */\n createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter | null, entityReferenceExpansion?: boolean): TreeWalker;\n /**\n * Returns the element for the specified x coordinate and the specified y coordinate.\n * @param x The x-offset\n * @param y The y-offset\n */\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;\n /**\n * Executes a command on the current document, current selection, or the given range.\n * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n * @param showUI Display the user interface, defaults to false.\n * @param value Value to assign.\n */\n execCommand(commandId: string, showUI?: boolean, value?: string): boolean;\n /**\n * Stops document's fullscreen element from being displayed fullscreen and\n * resolves promise when done.\n */\n exitFullscreen(): Promise;\n getAnimations(): Animation[];\n /**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\n * @param elementId String that specifies the ID value. Case-insensitive.\n */\n getElementById(elementId: string): HTMLElement | null;\n /**\n * collection = element . getElementsByClassName(classNames)\n */\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n /**\n * Gets a collection of objects based on the value of the NAME or ID attribute.\n * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\n */\n getElementsByName(elementName: string): NodeListOf;\n /**\n * Retrieves a collection of objects based on the specified element name.\n * @param name Specifies the name of an element.\n */\n getElementsByTagName(qualifiedName: K): HTMLCollectionOf;\n getElementsByTagName(qualifiedName: K): HTMLCollectionOf;\n getElementsByTagName(qualifiedName: string): HTMLCollectionOf;\n /**\n * If namespace and localName are\n * \"*\" returns a HTMLCollection of all descendant elements.\n * If only namespace is \"*\" returns a HTMLCollection of all descendant elements whose local name is localName.\n * If only localName is \"*\" returns a HTMLCollection of all descendant elements whose namespace is namespace.\n * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.\n */\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Gets a value indicating whether the object currently has focus.\n */\n hasFocus(): boolean;\n importNode(importedNode: T, deep: boolean): T;\n /**\n * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\n * @param url Specifies a MIME type for the document.\n * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\n * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \"fullscreen=yes, toolbar=yes\"). The following values are supported.\n * @param replace Specifies whether the existing entry for the document is replaced in the history list.\n */\n open(url?: string, name?: string, features?: string, replace?: boolean): Document;\n /**\n * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\n * @param commandId Specifies a command identifier.\n */\n queryCommandEnabled(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandIndeterm(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates the current state of the command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandState(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the current command is supported on the current range.\n * @param commandId Specifies a command identifier.\n */\n queryCommandSupported(commandId: string): boolean;\n /**\n * Returns the current value of the document, range, or current selection for the given command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandValue(commandId: string): string;\n /** @deprecated */\n releaseEvents(): void;\n /**\n * Writes one or more HTML expressions to a document in the specified window.\n * @param content Specifies the text and HTML tags to write.\n */\n write(...text: string[]): void;\n /**\n * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\n * @param content The text and HTML tags to write.\n */\n writeln(...text: string[]): void;\n /**\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\n */\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n};\n\ninterface DocumentAndElementEventHandlersEventMap {\n \"copy\": ClipboardEvent;\n \"cut\": ClipboardEvent;\n \"paste\": ClipboardEvent;\n}\n\ninterface DocumentAndElementEventHandlers {\n oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\n oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\n onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;\n addEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface DocumentEvent {\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AnimationPlaybackEvent\"): AnimationPlaybackEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"MSGestureEvent\"): MSGestureEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MSPointerEvent\"): MSPointerEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaQueryListEvent\"): MediaQueryListEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"PromiseRejectionEvent\"): PromiseRejectionEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDataChannelEvent\"): RTCDataChannelEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCErrorEvent\"): RTCErrorEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceErrorEvent\"): RTCPeerConnectionIceErrorEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"RTCStatsEvent\"): RTCStatsEvent;\n createEvent(eventInterface: \"RTCTrackEvent\"): RTCTrackEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"SecurityPolicyViolationEvent\"): SecurityPolicyViolationEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechRecognitionError\"): SpeechRecognitionError;\n createEvent(eventInterface: \"SpeechRecognitionEvent\"): SpeechRecognitionEvent;\n createEvent(eventInterface: \"SpeechSynthesisErrorEvent\"): SpeechSynthesisErrorEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TouchEvent\"): TouchEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"VRDisplayEvent\"): VRDisplayEvent;\n createEvent(eventInterface: \"VRDisplayEvent \"): VRDisplayEvent ;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n}\n\ninterface DocumentFragment extends Node, NonElementParentNode, ParentNode {\n getElementById(elementId: string): HTMLElement | null;\n}\n\ndeclare var DocumentFragment: {\n prototype: DocumentFragment;\n new(): DocumentFragment;\n};\n\ninterface DocumentOrShadowRoot {\n readonly activeElement: Element | null;\n /**\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\n */\n readonly styleSheets: StyleSheetList;\n caretPositionFromPoint(x: number, y: number): CaretPosition | null;\n /** @deprecated */\n caretRangeFromPoint(x: number, y: number): Range;\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n getSelection(): Selection | null;\n}\n\ninterface DocumentTimeline extends AnimationTimeline {\n}\n\ndeclare var DocumentTimeline: {\n prototype: DocumentTimeline;\n new(options?: DocumentTimelineOptions): DocumentTimeline;\n};\n\ninterface DocumentType extends Node, ChildNode {\n readonly name: string;\n readonly publicId: string;\n readonly systemId: string;\n}\n\ndeclare var DocumentType: {\n prototype: DocumentType;\n new(): DocumentType;\n};\n\ninterface DragEvent extends MouseEvent {\n /**\n * Returns the DataTransfer object for the event.\n */\n readonly dataTransfer: DataTransfer | null;\n}\n\ndeclare var DragEvent: {\n prototype: DragEvent;\n new(type: string, eventInitDict?: DragEventInit): DragEvent;\n};\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: number;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode;\n};\n\ninterface EXT_blend_minmax {\n readonly MAX_EXT: GLenum;\n readonly MIN_EXT: GLenum;\n}\n\ninterface EXT_frag_depth {\n}\n\ninterface EXT_sRGB {\n readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum;\n readonly SRGB8_ALPHA8_EXT: GLenum;\n readonly SRGB_ALPHA_EXT: GLenum;\n readonly SRGB_EXT: GLenum;\n}\n\ninterface EXT_shader_texture_lod {\n}\n\ninterface EXT_texture_filter_anisotropic {\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum;\n}\n\ninterface ElementEventMap {\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n}\n\ninterface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable, Animatable {\n readonly assignedSlot: HTMLSlotElement | null;\n readonly attributes: NamedNodeMap;\n /**\n * Allows for manipulation of element's class content attribute as a\n * set of whitespace-separated tokens through a DOMTokenList object.\n */\n readonly classList: DOMTokenList;\n /**\n * Returns the value of element's class content attribute. Can be set\n * to change it.\n */\n className: string;\n readonly clientHeight: number;\n readonly clientLeft: number;\n readonly clientTop: number;\n readonly clientWidth: number;\n /**\n * Returns the value of element's id content attribute. Can be set to\n * change it.\n */\n id: string;\n innerHTML: string;\n /**\n * Returns the local name.\n */\n readonly localName: string;\n /**\n * Returns the namespace.\n */\n readonly namespaceURI: string | null;\n onfullscreenchange: ((this: Element, ev: Event) => any) | null;\n onfullscreenerror: ((this: Element, ev: Event) => any) | null;\n outerHTML: string;\n /**\n * Returns the namespace prefix.\n */\n readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n /**\n * Returns element's shadow root, if any, and if shadow root's mode is \"open\", and null otherwise.\n */\n readonly shadowRoot: ShadowRoot | null;\n /**\n * Returns the value of element's slot content attribute. Can be set to\n * change it.\n */\n slot: string;\n /**\n * Returns the HTML-uppercased qualified name.\n */\n readonly tagName: string;\n /**\n * Creates a shadow root for element and returns it.\n */\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n /**\n * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.\n */\n closest(selector: K): HTMLElementTagNameMap[K] | null;\n closest(selector: K): SVGElementTagNameMap[K] | null;\n closest(selector: string): Element | null;\n /**\n * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.\n */\n getAttribute(qualifiedName: string): string | null;\n /**\n * Returns element's attribute whose namespace is namespace and local name is localName, and null if there is\n * no such attribute otherwise.\n */\n getAttributeNS(namespace: string | null, localName: string): string | null;\n /**\n * Returns the qualified names of all element's attributes.\n * Can contain duplicates.\n */\n getAttributeNames(): string[];\n getAttributeNode(name: string): Attr | null;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n getElementsByTagName(qualifiedName: K): HTMLCollectionOf;\n getElementsByTagName(qualifiedName: K): HTMLCollectionOf;\n getElementsByTagName(qualifiedName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.\n */\n hasAttribute(qualifiedName: string): boolean;\n /**\n * Returns true if element has an attribute whose namespace is namespace and local name is localName.\n */\n hasAttributeNS(namespace: string | null, localName: string): boolean;\n /**\n * Returns true if element has attributes, and false otherwise.\n */\n hasAttributes(): boolean;\n hasPointerCapture(pointerId: number): boolean;\n insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: InsertPosition, html: string): void;\n insertAdjacentText(where: InsertPosition, text: string): void;\n /**\n * Returns true if matching selectors against element's root yields element, and false otherwise.\n */\n matches(selectors: string): boolean;\n msGetRegionContent(): any;\n releasePointerCapture(pointerId: number): void;\n /**\n * Removes element's first attribute whose qualified name is qualifiedName.\n */\n removeAttribute(qualifiedName: string): void;\n /**\n * Removes element's attribute whose namespace is namespace and local name is localName.\n */\n removeAttributeNS(namespace: string | null, localName: string): void;\n removeAttributeNode(attr: Attr): Attr;\n /**\n * Displays element fullscreen and resolves promise when done.\n */\n requestFullscreen(): Promise;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n /**\n * Sets the value of element's first attribute whose qualified name is qualifiedName to value.\n */\n setAttribute(qualifiedName: string, value: string): void;\n /**\n * Sets the value of element's attribute whose namespace is namespace and local name is localName to value.\n */\n setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;\n setAttributeNode(attr: Attr): Attr | null;\n setAttributeNodeNS(attr: Attr): Attr | null;\n setPointerCapture(pointerId: number): void;\n /**\n * If force is not given, \"toggles\" qualifiedName, removing it if it is\n * present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.\n * Returns true if qualifiedName is now present, and false otherwise.\n */\n toggleAttribute(qualifiedName: string, force?: boolean): boolean;\n webkitMatchesSelector(selectors: string): boolean;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Element: {\n prototype: Element;\n new(): Element;\n};\n\ninterface ElementCSSInlineStyle {\n readonly style: CSSStyleDeclaration;\n}\n\ninterface ElementContentEditable {\n contentEditable: string;\n inputMode: string;\n readonly isContentEditable: boolean;\n}\n\ninterface ElementCreationOptions {\n is?: string;\n}\n\ninterface ErrorEvent extends Event {\n readonly colno: number;\n readonly error: any;\n readonly filename: string;\n readonly lineno: number;\n readonly message: string;\n}\n\ndeclare var ErrorEvent: {\n prototype: ErrorEvent;\n new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent;\n};\n\ninterface Event {\n /**\n * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.\n */\n readonly bubbles: boolean;\n cancelBubble: boolean;\n readonly cancelable: boolean;\n /**\n * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.\n */\n readonly composed: boolean;\n /**\n * Returns the object whose event listener's callback is currently being\n * invoked.\n */\n readonly currentTarget: EventTarget | null;\n readonly defaultPrevented: boolean;\n readonly eventPhase: number;\n /**\n * Returns true if event was dispatched by the user agent, and\n * false otherwise.\n */\n readonly isTrusted: boolean;\n returnValue: boolean;\n /** @deprecated */\n readonly srcElement: Element | null;\n /**\n * Returns the object to which event is dispatched (its target).\n */\n readonly target: EventTarget | null;\n /**\n * Returns the event's timestamp as the number of milliseconds measured relative to\n * the time origin.\n */\n readonly timeStamp: number;\n /**\n * Returns the type of event, e.g.\n * \"click\", \"hashchange\", or\n * \"submit\".\n */\n readonly type: string;\n composedPath(): EventTarget[];\n initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\n preventDefault(): void;\n /**\n * Invoking this method prevents event from reaching\n * any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any\n * other objects.\n */\n stopImmediatePropagation(): void;\n /**\n * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.\n */\n stopPropagation(): void;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n}\n\ndeclare var Event: {\n prototype: Event;\n new(type: string, eventInitDict?: EventInit): Event;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n};\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface EventSource extends EventTarget {\n readonly CLOSED: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n onerror: (evt: MessageEvent) => any;\n onmessage: (evt: MessageEvent) => any;\n onopen: (evt: MessageEvent) => any;\n readonly readyState: number;\n readonly url: string;\n readonly withCredentials: boolean;\n close(): void;\n}\n\ndeclare var EventSource: {\n prototype: EventSource;\n new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\n};\n\ninterface EventSourceInit {\n readonly withCredentials: boolean;\n}\n\ninterface EventTarget {\n /**\n * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.\n * The options argument sets listener-specific options. For compatibility this can be a\n * boolean, in which case the method behaves exactly as if the value was specified as options's capture.\n * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.\n * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners.\n * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will\n * be removed.\n * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.\n */\n addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;\n /**\n * Dispatches a synthetic event event to target and returns true\n * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n */\n dispatchEvent(event: Event): boolean;\n /**\n * Removes the event listener in target's event listener list with the same type, callback, and options.\n */\n removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n};\n\ninterface ExtensionScriptApis {\n extensionIdToShortId(extensionId: string): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n genericWebRuntimeCallout(to: any, from: any, payload: string): void;\n getExtensionId(): string;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericPersistentCallbackHandler(callbackHandler: Function): void;\n registerWebRuntimeCallbackHandler(handler: Function): any;\n}\n\ndeclare var ExtensionScriptApis: {\n prototype: ExtensionScriptApis;\n new(): ExtensionScriptApis;\n};\n\ninterface External {\n /** @deprecated */\n AddSearchProvider(): void;\n /** @deprecated */\n IsSearchProviderInstalled(): void;\n}\n\ninterface File extends Blob {\n readonly lastModified: number;\n readonly name: string;\n}\n\ndeclare var File: {\n prototype: File;\n new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;\n};\n\ninterface FileList {\n readonly length: number;\n item(index: number): File | null;\n [index: number]: File;\n}\n\ndeclare var FileList: {\n prototype: FileList;\n new(): FileList;\n};\n\ninterface FileReaderEventMap {\n \"abort\": ProgressEvent;\n \"error\": ProgressEvent;\n \"load\": ProgressEvent;\n \"loadend\": ProgressEvent;\n \"loadstart\": ProgressEvent;\n \"progress\": ProgressEvent;\n}\n\ninterface FileReader extends EventTarget {\n readonly error: DOMException | null;\n onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onerror: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onload: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null;\n readonly readyState: number;\n readonly result: string | ArrayBuffer | null;\n abort(): void;\n readAsArrayBuffer(blob: Blob): void;\n readAsBinaryString(blob: Blob): void;\n readAsDataURL(blob: Blob): void;\n readAsText(blob: Blob, encoding?: string): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var FileReader: {\n prototype: FileReader;\n new(): FileReader;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n};\n\ninterface FocusEvent extends UIEvent {\n readonly relatedTarget: EventTarget;\n initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;\n}\n\ndeclare var FocusEvent: {\n prototype: FocusEvent;\n new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;\n};\n\ninterface FocusNavigationEvent extends Event {\n readonly navigationReason: NavigationReason;\n readonly originHeight: number;\n readonly originLeft: number;\n readonly originTop: number;\n readonly originWidth: number;\n requestFocus(): void;\n}\n\ndeclare var FocusNavigationEvent: {\n prototype: FocusNavigationEvent;\n new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\n};\n\ninterface FormData {\n append(name: string, value: string | Blob, fileName?: string): void;\n delete(name: string): void;\n get(name: string): FormDataEntryValue | null;\n getAll(name: string): FormDataEntryValue[];\n has(name: string): boolean;\n set(name: string, value: string | Blob, fileName?: string): void;\n forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;\n}\n\ndeclare var FormData: {\n prototype: FormData;\n new(form?: HTMLFormElement): FormData;\n};\n\ninterface GainNode extends AudioNode {\n readonly gain: AudioParam;\n}\n\ndeclare var GainNode: {\n prototype: GainNode;\n new(context: BaseAudioContext, options?: GainOptions): GainNode;\n};\n\ninterface Gamepad {\n readonly axes: number[];\n readonly buttons: GamepadButton[];\n readonly connected: boolean;\n readonly displayId: number;\n readonly hand: GamepadHand;\n readonly hapticActuators: GamepadHapticActuator[];\n readonly id: string;\n readonly index: number;\n readonly mapping: GamepadMappingType;\n readonly pose: GamepadPose | null;\n readonly timestamp: number;\n}\n\ndeclare var Gamepad: {\n prototype: Gamepad;\n new(): Gamepad;\n};\n\ninterface GamepadButton {\n readonly pressed: boolean;\n readonly touched: boolean;\n readonly value: number;\n}\n\ndeclare var GamepadButton: {\n prototype: GamepadButton;\n new(): GamepadButton;\n};\n\ninterface GamepadEvent extends Event {\n readonly gamepad: Gamepad;\n}\n\ndeclare var GamepadEvent: {\n prototype: GamepadEvent;\n new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;\n};\n\ninterface GamepadHapticActuator {\n readonly type: GamepadHapticActuatorType;\n pulse(value: number, duration: number): Promise;\n}\n\ndeclare var GamepadHapticActuator: {\n prototype: GamepadHapticActuator;\n new(): GamepadHapticActuator;\n};\n\ninterface GamepadPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n}\n\ndeclare var GamepadPose: {\n prototype: GamepadPose;\n new(): GamepadPose;\n};\n\ninterface Geolocation {\n clearWatch(watchId: number): void;\n getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\n watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\n}\n\ninterface GetSVGDocument {\n getSVGDocument(): Document;\n}\n\ninterface GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"animationcancel\": AnimationEvent;\n \"animationend\": AnimationEvent;\n \"animationiteration\": AnimationEvent;\n \"animationstart\": AnimationEvent;\n \"auxclick\": Event;\n \"blur\": FocusEvent;\n \"cancel\": Event;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"close\": Event;\n \"contextmenu\": MouseEvent;\n \"cuechange\": Event;\n \"dblclick\": MouseEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragexit\": Event;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"gotpointercapture\": PointerEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"lostpointercapture\": PointerEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"pointercancel\": PointerEvent;\n \"pointerdown\": PointerEvent;\n \"pointerenter\": PointerEvent;\n \"pointerleave\": PointerEvent;\n \"pointermove\": PointerEvent;\n \"pointerout\": PointerEvent;\n \"pointerover\": PointerEvent;\n \"pointerup\": PointerEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"securitypolicyviolation\": SecurityPolicyViolationEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"toggle\": Event;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"transitioncancel\": TransitionEvent;\n \"transitionend\": TransitionEvent;\n \"transitionrun\": TransitionEvent;\n \"transitionstart\": TransitionEvent;\n \"volumechange\": Event;\n \"waiting\": Event;\n \"wheel\": WheelEvent;\n}\n\ninterface GlobalEventHandlers {\n /**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\n onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\n onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\n onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\n onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\n onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;\n onauxclick: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\n onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;\n oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\n oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\n onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\n onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\n oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\n ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\n ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\n ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\n ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n ondragexit: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\n ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\n ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\n ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;\n /**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\n ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\n onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\n onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\n onerror: ErrorEventHandler;\n /**\n * Fires when the object receives focus.\n * @param ev The event.\n */\n onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;\n ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\n onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\n onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\n onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;\n /**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\n onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\n onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\n onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;\n /**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\n onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n /**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\n onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\n onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\n onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\n onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\n onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;\n /**\n * Occurs when playback is paused.\n * @param ev The event.\n */\n onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\n onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\n onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n /**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\n onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;\n /**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\n onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the user resets a form.\n * @param ev The event.\n */\n onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\n /**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\n onscroll: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\n onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;\n /**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\n onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\n onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Fires when the current selection changes.\n * @param ev The event.\n */\n onselect: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;\n /**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\n onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\n onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\n ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n ontouchcancel: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\n ontouchend: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\n ontouchmove: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\n ontouchstart: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null;\n ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\n ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\n ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\n ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;\n /**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\n onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n /**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\n onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;\n onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;\n addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface GlobalFetch {\n fetch(input: RequestInfo, init?: RequestInit): Promise;\n}\n\ninterface HTMLAllCollection {\n /**\n * Returns the number of elements in the collection.\n */\n readonly length: number;\n /**\n * element = collection(index)\n */\n item(nameOrIndex?: string): HTMLCollection | Element | null;\n /**\n * element = collection(name)\n */\n namedItem(name: string): HTMLCollection | Element | null;\n [index: number]: Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n};\n\ninterface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n /** @deprecated */\n coords: string;\n download: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n ping: string;\n referrerPolicy: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n readonly relList: DOMTokenList;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n type: string;\n addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n};\n\ninterface HTMLAppletElement extends HTMLElement {\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n /** @deprecated */\n alt: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n /** @deprecated */\n object: string;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAppletElement: {\n prototype: HTMLAppletElement;\n new(): HTMLAppletElement;\n};\n\ninterface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Sets or gets whether clicks in this region cause action.\n */\n /** @deprecated */\n noHref: boolean;\n ping: string;\n referrerPolicy: string;\n rel: string;\n readonly relList: DOMTokenList;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n};\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAudioElement: {\n prototype: HTMLAudioElement;\n new(): HTMLAudioElement;\n};\n\ninterface HTMLBRElement extends HTMLElement {\n /**\n * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\n */\n /** @deprecated */\n clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBRElement: {\n prototype: HTMLBRElement;\n new(): HTMLBRElement;\n};\n\ninterface HTMLBaseElement extends HTMLElement {\n /**\n * Gets or sets the baseline URL on which relative links are based.\n */\n href: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseElement: {\n prototype: HTMLBaseElement;\n new(): HTMLBaseElement;\n};\n\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n /**\n * Sets or retrieves the font size of the object.\n */\n /** @deprecated */\n size: number;\n addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseFontElement: {\n prototype: HTMLBaseFontElement;\n new(): HTMLBaseFontElement;\n};\n\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n \"orientationchange\": Event;\n}\n\ninterface HTMLBodyElement extends HTMLElement, WindowEventHandlers {\n /** @deprecated */\n aLink: string;\n /** @deprecated */\n background: string;\n /** @deprecated */\n bgColor: string;\n bgProperties: string;\n /** @deprecated */\n link: string;\n /** @deprecated */\n noWrap: boolean;\n /** @deprecated */\n onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;\n /** @deprecated */\n text: string;\n /** @deprecated */\n vLink: string;\n addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBodyElement: {\n prototype: HTMLBodyElement;\n new(): HTMLBodyElement;\n};\n\ninterface HTMLButtonElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n readonly labels: NodeListOf;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets the classification and default behavior of the button.\n */\n type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the default or selected value of the control.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLButtonElement: {\n prototype: HTMLButtonElement;\n new(): HTMLButtonElement;\n};\n\ninterface HTMLCanvasElement extends HTMLElement {\n /**\n * Gets or sets the height of a canvas element on a document.\n */\n height: number;\n /**\n * Gets or sets the width of a canvas element on a document.\n */\n width: number;\n /**\n * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\n * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\"2d\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\"experimental-webgl\");\n */\n getContext(contextId: \"2d\", contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;\n getContext(contextId: \"webgl\" | \"experimental-webgl\", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;\n getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;\n toBlob(callback: BlobCallback, type?: string, quality?: any): void;\n /**\n * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\n * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\n */\n toDataURL(type?: string, quality?: any): string;\n addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n};\n\ninterface HTMLCollectionBase {\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Retrieves an object from various collections.\n */\n item(index: number): Element | null;\n [index: number]: Element;\n}\n\ninterface HTMLCollection extends HTMLCollectionBase {\n /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element | null;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n};\n\ninterface HTMLCollectionOf extends HTMLCollectionBase {\n item(index: number): T | null;\n namedItem(name: string): T | null;\n [index: number]: T;\n}\n\ninterface HTMLDListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n};\n\ninterface HTMLDataElement extends HTMLElement {\n value: string;\n addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataElement: {\n prototype: HTMLDataElement;\n new(): HTMLDataElement;\n};\n\ninterface HTMLDataListElement extends HTMLElement {\n readonly options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataListElement: {\n prototype: HTMLDataListElement;\n new(): HTMLDataListElement;\n};\n\ninterface HTMLDetailsElement extends HTMLElement {\n open: boolean;\n addEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDetailsElement: {\n prototype: HTMLDetailsElement;\n new(): HTMLDetailsElement;\n};\n\ninterface HTMLDialogElement extends HTMLElement {\n open: boolean;\n returnValue: string;\n close(returnValue?: string): void;\n show(): void;\n showModal(): void;\n addEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDialogElement: {\n prototype: HTMLDialogElement;\n new(): HTMLDialogElement;\n};\n\ninterface HTMLDirectoryElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDirectoryElement: {\n prototype: HTMLDirectoryElement;\n new(): HTMLDirectoryElement;\n};\n\ninterface HTMLDivElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n};\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDocument: {\n prototype: HTMLDocument;\n new(): HTMLDocument;\n};\n\ninterface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\n}\n\ninterface HTMLElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle {\n accessKey: string;\n readonly accessKeyLabel: string;\n autocapitalize: string;\n dir: string;\n draggable: boolean;\n hidden: boolean;\n innerText: string;\n lang: string;\n readonly offsetHeight: number;\n readonly offsetLeft: number;\n readonly offsetParent: Element | null;\n readonly offsetTop: number;\n readonly offsetWidth: number;\n spellcheck: boolean;\n title: string;\n translate: boolean;\n click(): void;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLElement: {\n prototype: HTMLElement;\n new(): HTMLElement;\n};\n\ninterface HTMLEmbedElement extends HTMLElement, GetSVGDocument {\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hidden: any;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * Retrieves the palette used for the embedded document.\n */\n readonly palette: string;\n /**\n * Retrieves the URL of the plug-in used to view an embedded document.\n */\n readonly pluginspage: string;\n readonly readyState: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the height and width units of the embed object.\n */\n units: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLEmbedElement: {\n prototype: HTMLEmbedElement;\n new(): HTMLEmbedElement;\n};\n\ninterface HTMLFieldSetElement extends HTMLElement {\n disabled: boolean;\n readonly elements: HTMLCollection;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n name: string;\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFieldSetElement: {\n prototype: HTMLFieldSetElement;\n new(): HTMLFieldSetElement;\n};\n\ninterface HTMLFontElement extends HTMLElement {\n /** @deprecated */\n color: string;\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n /** @deprecated */\n size: string;\n addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\n};\n\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\n /**\n * element = collection[name]\n */\n namedItem(name: string): RadioNodeList | Element | null;\n}\n\ndeclare var HTMLFormControlsCollection: {\n prototype: HTMLFormControlsCollection;\n new(): HTMLFormControlsCollection;\n};\n\ninterface HTMLFormElement extends HTMLElement {\n /**\n * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\n */\n acceptCharset: string;\n /**\n * Sets or retrieves the URL to which the form content is sent for processing.\n */\n action: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Retrieves a collection, in source order, of all controls in a given form.\n */\n readonly elements: HTMLFormControlsCollection;\n /**\n * Sets or retrieves the MIME encoding for the form.\n */\n encoding: string;\n /**\n * Sets or retrieves the encoding type for the form.\n */\n enctype: string;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Sets or retrieves how to send the form data to the server.\n */\n method: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Designates a form that is not validated when submitted.\n */\n noValidate: boolean;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Fires when the user resets a form.\n */\n reset(): void;\n /**\n * Fires when a FORM is about to be submitted.\n */\n submit(): void;\n addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: Element;\n [name: string]: any;\n}\n\ndeclare var HTMLFormElement: {\n prototype: HTMLFormElement;\n new(): HTMLFormElement;\n};\n\ninterface HTMLFrameElement extends HTMLElement {\n /**\n * Retrieves the document object of the page or frame.\n */\n /** @deprecated */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n /** @deprecated */\n readonly contentWindow: WindowProxy | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n /** @deprecated */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n /** @deprecated */\n noResize: boolean;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n /** @deprecated */\n src: string;\n addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n};\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n}\n\ninterface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers {\n /**\n * Sets or retrieves the frame widths of the object.\n */\n /** @deprecated */\n cols: string;\n /**\n * Sets or retrieves the frame heights of the object.\n */\n /** @deprecated */\n rows: string;\n addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameSetElement: {\n prototype: HTMLFrameSetElement;\n new(): HTMLFrameSetElement;\n};\n\ninterface HTMLHRElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n color: string;\n /**\n * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\n */\n /** @deprecated */\n noShade: boolean;\n /** @deprecated */\n size: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n};\n\ninterface HTMLHeadElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadElement: {\n prototype: HTMLHeadElement;\n new(): HTMLHeadElement;\n};\n\ninterface HTMLHeadingElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadingElement: {\n prototype: HTMLHeadingElement;\n new(): HTMLHeadingElement;\n};\n\ninterface HTMLHtmlElement extends HTMLElement {\n /**\n * Sets or retrieves the DTD version that governs the current document.\n */\n /** @deprecated */\n version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHtmlElement: {\n prototype: HTMLHtmlElement;\n new(): HTMLHtmlElement;\n};\n\ninterface HTMLHyperlinkElementUtils {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n username: string;\n}\n\ninterface HTMLIFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n allowFullscreen: boolean;\n allowPaymentRequest: boolean;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n readonly referrerPolicy: ReferrerPolicy;\n readonly sandbox: DOMTokenList;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrives the content of the page that is to contain.\n */\n srcdoc: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLIFrameElement: {\n prototype: HTMLIFrameElement;\n new(): HTMLIFrameElement;\n};\n\ninterface HTMLImageElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n crossOrigin: string | null;\n readonly currentSrc: string;\n decoding: \"async\" | \"sync\" | \"auto\";\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves whether the image is a server-side image map.\n */\n isMap: boolean;\n /**\n * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /** @deprecated */\n lowsrc: string;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * The original height of the image resource before sizing.\n */\n readonly naturalHeight: number;\n /**\n * The original width of the image resource before sizing.\n */\n readonly naturalWidth: number;\n referrerPolicy: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n readonly x: number;\n readonly y: number;\n decode(): Promise;\n addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n};\n\ninterface HTMLInputElement extends HTMLElement {\n /**\n * Sets or retrieves a comma-separated list of content types.\n */\n accept: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n checked: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n defaultChecked: boolean;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n dirName: string;\n disabled: boolean;\n /**\n * Returns a FileList object on a file type input object.\n */\n files: FileList | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n indeterminate: boolean;\n readonly labels: NodeListOf | null;\n /**\n * Specifies the ID of a pre-defined datalist of options for an input element.\n */\n readonly list: HTMLElement | null;\n /**\n * Defines the maximum acceptable value for an input element with type=\"number\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\n */\n max: string;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Defines the minimum acceptable value for an input element with type=\"number\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\n */\n min: string;\n minLength: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a string containing a regular expression that the user's input must match.\n */\n pattern: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n selectionDirection: string | null;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number | null;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number | null;\n size: number;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n /**\n * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\n */\n step: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n /** @deprecated */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns the value of the data at the cursor's current position.\n */\n value: string;\n valueAsDate: any;\n /**\n * Returns the input field value as a number.\n */\n valueAsNumber: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Makes the selection equal to the current object.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n setRangeText(replacement: string): void;\n setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n /**\n * 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.\n * @param n Value to decrement the value by.\n */\n stepDown(n?: number): void;\n /**\n * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\n * @param n Value to increment the value by.\n */\n stepUp(n?: number): void;\n addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\n};\n\ninterface HTMLLIElement extends HTMLElement {\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of a list item.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\n};\n\ninterface HTMLLabelElement extends HTMLElement {\n readonly control: HTMLElement | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the object to which the given label object is assigned.\n */\n htmlFor: string;\n addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLabelElement: {\n prototype: HTMLLabelElement;\n new(): HTMLLabelElement;\n};\n\ninterface HTMLLegendElement extends HTMLElement {\n /** @deprecated */\n align: string;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLegendElement: {\n prototype: HTMLLegendElement;\n new(): HTMLLegendElement;\n};\n\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\n as: string;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n crossOrigin: string | null;\n disabled: boolean;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n integrity: string;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n referrerPolicy: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n readonly relList: DOMTokenList;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n readonly sizes: DOMTokenList;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n /** @deprecated */\n target: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLinkElement: {\n prototype: HTMLLinkElement;\n new(): HTMLLinkElement;\n};\n\ninterface HTMLMainElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMainElement: {\n prototype: HTMLMainElement;\n new(): HTMLMainElement;\n};\n\ninterface HTMLMapElement extends HTMLElement {\n /**\n * Retrieves a collection of the area objects defined for the given map object.\n */\n readonly areas: HTMLCollection;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMapElement: {\n prototype: HTMLMapElement;\n new(): HTMLMapElement;\n};\n\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\n \"bounce\": Event;\n \"finish\": Event;\n \"start\": Event;\n}\n\ninterface HTMLMarqueeElement extends HTMLElement {\n /** @deprecated */\n behavior: string;\n /** @deprecated */\n bgColor: string;\n /** @deprecated */\n direction: string;\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /** @deprecated */\n loop: number;\n /** @deprecated */\n onbounce: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onfinish: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onstart: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n scrollAmount: number;\n /** @deprecated */\n scrollDelay: number;\n /** @deprecated */\n trueSpeed: boolean;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n /** @deprecated */\n start(): void;\n /** @deprecated */\n stop(): void;\n addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMarqueeElement: {\n prototype: HTMLMarqueeElement;\n new(): HTMLMarqueeElement;\n};\n\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\n \"encrypted\": MediaEncryptedEvent;\n \"msneedkey\": Event;\n}\n\ninterface HTMLMediaElement extends HTMLElement {\n /**\n * Returns an AudioTrackList object with the audio tracks for a given video element.\n */\n readonly audioTracks: AudioTrackList;\n /**\n * Gets or sets a value that indicates whether to start playing the media automatically.\n */\n autoplay: boolean;\n /**\n * Gets a collection of buffered time ranges.\n */\n readonly buffered: TimeRanges;\n /**\n * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\n */\n controls: boolean;\n crossOrigin: string | null;\n /**\n * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\n */\n readonly currentSrc: string;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n currentTime: number;\n defaultMuted: boolean;\n /**\n * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\n */\n defaultPlaybackRate: number;\n /**\n * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\n */\n readonly duration: number;\n /**\n * Gets information about whether the playback has ended or not.\n */\n readonly ended: boolean;\n /**\n * Returns an object representing the current error state of the audio or video element.\n */\n readonly error: MediaError | null;\n /**\n * Gets or sets a flag to specify whether playback should restart after it completes.\n */\n loop: boolean;\n readonly mediaKeys: MediaKeys | null;\n /**\n * Specifies the purpose of the audio or video media, such as background audio or alerts.\n */\n msAudioCategory: string;\n /**\n * Specifies the output device id that the audio will be sent to.\n */\n msAudioDeviceType: string;\n readonly msGraphicsTrustStatus: MSGraphicsTrust;\n /**\n * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.\n */\n /** @deprecated */\n readonly msKeys: MSMediaKeys;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Specifies whether or not to enable low-latency playback on the media element.\n */\n msRealTime: boolean;\n /**\n * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\n */\n muted: boolean;\n /**\n * Gets the current network activity for the element.\n */\n readonly networkState: number;\n onencrypted: ((this: HTMLMediaElement, ev: MediaEncryptedEvent) => any) | null;\n /** @deprecated */\n onmsneedkey: ((this: HTMLMediaElement, ev: Event) => any) | null;\n /**\n * Gets a flag that specifies whether playback is paused.\n */\n readonly paused: boolean;\n /**\n * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\n */\n playbackRate: number;\n /**\n * Gets TimeRanges for the current media resource that has been played.\n */\n readonly played: TimeRanges;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n preload: string;\n readonly readyState: number;\n /**\n * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\n */\n readonly seekable: TimeRanges;\n /**\n * Gets a flag that indicates whether the client is currently moving to a new playback position in the media resource.\n */\n readonly seeking: boolean;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcObject: MediaStream | MediaSource | Blob | null;\n readonly textTracks: TextTrackList;\n readonly videoTracks: VideoTrackList;\n /**\n * Gets or sets the volume level for audio portions of the media element.\n */\n volume: number;\n addTextTrack(kind: TextTrackKind, label?: string, language?: string): TextTrack;\n /**\n * Returns a string that specifies whether the client can play a given media resource type.\n */\n canPlayType(type: string): CanPlayTypeResult;\n /**\n * Resets the audio or video object and loads a new media resource.\n */\n load(): void;\n /**\n * Clears all effects from the media pipeline.\n */\n msClearEffects(): void;\n msGetAsCastingSource(): any;\n /**\n * Inserts the specified audio effect into media pipeline.\n */\n msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n /** @deprecated */\n msSetMediaKeys(mediaKeys: MSMediaKeys): void;\n /**\n * Specifies the media protection manager for a given media pipeline.\n */\n msSetMediaProtectionManager(mediaProtectionManager?: any): void;\n /**\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\n */\n pause(): void;\n /**\n * Loads and starts playback of a media resource.\n */\n play(): Promise;\n setMediaKeys(mediaKeys: MediaKeys | null): Promise;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMediaElement: {\n prototype: HTMLMediaElement;\n new(): HTMLMediaElement;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n};\n\ninterface HTMLMenuElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMenuElement: {\n prototype: HTMLMenuElement;\n new(): HTMLMenuElement;\n};\n\ninterface HTMLMetaElement extends HTMLElement {\n /**\n * Gets or sets meta-information to associate with httpEquiv or name.\n */\n content: string;\n /**\n * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\n */\n httpEquiv: string;\n /**\n * Sets or retrieves the value specified in the content attribute of the meta object.\n */\n name: string;\n /**\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\n */\n /** @deprecated */\n scheme: string;\n addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMetaElement: {\n prototype: HTMLMetaElement;\n new(): HTMLMetaElement;\n};\n\ninterface HTMLMeterElement extends HTMLElement {\n high: number;\n readonly labels: NodeListOf;\n low: number;\n max: number;\n min: number;\n optimum: number;\n value: number;\n addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMeterElement: {\n prototype: HTMLMeterElement;\n new(): HTMLMeterElement;\n};\n\ninterface HTMLModElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n /**\n * Sets or retrieves the date and time of a modification to the object.\n */\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\n};\n\ninterface HTMLOListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n reversed: boolean;\n /**\n * The starting number.\n */\n start: number;\n type: string;\n addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOListElement: {\n prototype: HTMLOListElement;\n new(): HTMLOListElement;\n};\n\ninterface HTMLObjectElement extends HTMLElement, GetSVGDocument {\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n border: string;\n /**\n * Sets or retrieves the URL of the file containing the compiled Java class.\n */\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n /** @deprecated */\n codeType: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n /** @deprecated */\n declare: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly readyState: number;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n /** @deprecated */\n standby: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n typemustmatch: boolean;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\n};\n\ninterface HTMLOptGroupElement extends HTMLElement {\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptGroupElement: {\n prototype: HTMLOptGroupElement;\n new(): HTMLOptGroupElement;\n};\n\ninterface HTMLOptionElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n};\n\ninterface HTMLOptionsCollection extends HTMLCollectionOf {\n /**\n * Returns the number of elements in the collection.\n * When set to a smaller number, truncates the number of option elements in the corresponding container.\n * When set to a greater number, adds new blank option elements to that container.\n */\n length: number;\n /**\n * Returns the index of the first selected item, if any, or −1 if there is no selected\n * item.\n * Can be set, to change the selection.\n */\n selectedIndex: number;\n /**\n * Inserts element before the node given by before.\n * The before argument can be a number, in which case element is inserted before the item with that number, or an element from the\n * collection, in which case element is inserted before that element.\n * If before is omitted, null, or a number out of range, then element will be added at the end of the list.\n * This method will throw a \"HierarchyRequestError\" DOMException if\n * element is an ancestor of the element into which it is to be inserted.\n */\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n /**\n * Removes the item with index index from the collection.\n */\n remove(index: number): void;\n}\n\ndeclare var HTMLOptionsCollection: {\n prototype: HTMLOptionsCollection;\n new(): HTMLOptionsCollection;\n};\n\ninterface HTMLOrSVGElement {\n readonly dataset: DOMStringMap;\n nonce: string;\n tabIndex: number;\n blur(): void;\n focus(options?: FocusOptions): void;\n}\n\ninterface HTMLOutputElement extends HTMLElement {\n defaultValue: string;\n readonly form: HTMLFormElement | null;\n readonly htmlFor: DOMTokenList;\n readonly labels: NodeListOf;\n name: string;\n readonly type: string;\n readonly validationMessage: string;\n readonly validity: ValidityState;\n value: string;\n readonly willValidate: boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOutputElement: {\n prototype: HTMLOutputElement;\n new(): HTMLOutputElement;\n};\n\ninterface HTMLParagraphElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParagraphElement: {\n prototype: HTMLParagraphElement;\n new(): HTMLParagraphElement;\n};\n\ninterface HTMLParamElement extends HTMLElement {\n /**\n * Sets or retrieves the name of an input parameter for an element.\n */\n name: string;\n /**\n * Sets or retrieves the content type of the resource designated by the value attribute.\n */\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of an input parameter for an element.\n */\n value: string;\n /**\n * Sets or retrieves the data type of the value attribute.\n */\n /** @deprecated */\n valueType: string;\n addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n};\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPictureElement: {\n prototype: HTMLPictureElement;\n new(): HTMLPictureElement;\n};\n\ninterface HTMLPreElement extends HTMLElement {\n /**\n * Sets or gets a value that you can use to implement your own width functionality for the object.\n */\n /** @deprecated */\n width: number;\n addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPreElement: {\n prototype: HTMLPreElement;\n new(): HTMLPreElement;\n};\n\ninterface HTMLProgressElement extends HTMLElement {\n readonly labels: NodeListOf;\n /**\n * Defines the maximum, or \"done\" value for a progress element.\n */\n max: number;\n /**\n * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\n */\n readonly position: number;\n /**\n * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLProgressElement: {\n prototype: HTMLProgressElement;\n new(): HTMLProgressElement;\n};\n\ninterface HTMLQuoteElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLQuoteElement: {\n prototype: HTMLQuoteElement;\n new(): HTMLQuoteElement;\n};\n\ninterface HTMLScriptElement extends HTMLElement {\n async: boolean;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n crossOrigin: string | null;\n /**\n * Sets or retrieves the status of the script.\n */\n defer: boolean;\n /**\n * Sets or retrieves the event for which the script is written.\n */\n /** @deprecated */\n event: string;\n /**\n * Sets or retrieves the object that is bound to the event script.\n */\n /** @deprecated */\n htmlFor: string;\n integrity: string;\n noModule: boolean;\n referrerPolicy: string;\n /**\n * Retrieves the URL to an external file that contains the source code or data.\n */\n src: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n /**\n * Sets or retrieves the MIME type for the associated scripting engine.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLScriptElement: {\n prototype: HTMLScriptElement;\n new(): HTMLScriptElement;\n};\n\ninterface HTMLSelectElement extends HTMLElement {\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n readonly labels: NodeListOf;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n length: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly options: HTMLOptionsCollection;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the index of the selected option in a select object.\n */\n selectedIndex: number;\n readonly selectedOptions: HTMLCollectionOf;\n /**\n * Sets or retrieves the number of rows in the list box.\n */\n size: number;\n /**\n * Retrieves the type of select control based on the value of the MULTIPLE attribute.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Adds an element to the areas, controlRange, or options collection.\n * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\n * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\n */\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(index: number): Element | null;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\n */\n namedItem(name: string): HTMLOptionElement | null;\n /**\n * Removes an element from the collection.\n * @param index Number that specifies the zero-based index of the element to remove from the collection.\n */\n remove(): void;\n remove(index: number): void;\n reportValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: number]: HTMLOptionElement | HTMLOptGroupElement;\n}\n\ndeclare var HTMLSelectElement: {\n prototype: HTMLSelectElement;\n new(): HTMLSelectElement;\n};\n\ninterface HTMLSlotElement extends HTMLElement {\n name: string;\n assignedElements(options?: AssignedNodesOptions): Element[];\n assignedNodes(options?: AssignedNodesOptions): Node[];\n addEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSlotElement: {\n prototype: HTMLSlotElement;\n new(): HTMLSlotElement;\n};\n\ninterface HTMLSourceElement extends HTMLElement {\n /**\n * Gets or sets the intended media type of the media source.\n */\n media: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Gets or sets the MIME type of a media resource.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n};\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSpanElement: {\n prototype: HTMLSpanElement;\n new(): HTMLSpanElement;\n};\n\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Retrieves the CSS language in which the style sheet is written.\n */\n /** @deprecated */\n type: string;\n addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLStyleElement: {\n prototype: HTMLStyleElement;\n new(): HTMLStyleElement;\n};\n\ninterface HTMLTableCaptionElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the caption or legend.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCaptionElement: {\n prototype: HTMLTableCaptionElement;\n new(): HTMLTableCaptionElement;\n};\n\ninterface HTMLTableCellElement extends HTMLElement {\n /**\n * Sets or retrieves abbreviated text for the object.\n */\n abbr: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\n */\n /** @deprecated */\n axis: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves the position of the object in the cells collection of a row.\n */\n readonly cellIndex: number;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number columns in the table that the object should span.\n */\n colSpan: number;\n /**\n * Sets or retrieves a list of header cells that provide information for the object.\n */\n headers: string;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n /** @deprecated */\n noWrap: boolean;\n /**\n * Sets or retrieves how many rows in a table the cell should span.\n */\n rowSpan: number;\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCellElement: {\n prototype: HTMLTableCellElement;\n new(): HTMLTableCellElement;\n};\n\ninterface HTMLTableColElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the object relative to the display or table.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of columns in the group.\n */\n span: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n};\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\n addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableDataCellElement: {\n prototype: HTMLTableDataCellElement;\n new(): HTMLTableDataCellElement;\n};\n\ninterface HTMLTableElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves the caption object of a table.\n */\n caption: HTMLTableCaptionElement | null;\n /**\n * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\n */\n /** @deprecated */\n cellPadding: string;\n /**\n * Sets or retrieves the amount of space between cells in a table.\n */\n /** @deprecated */\n cellSpacing: string;\n /**\n * Sets or retrieves the way the border frame around the table is displayed.\n */\n /** @deprecated */\n frame: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /**\n * Sets or retrieves which dividing lines (inner borders) are displayed.\n */\n /** @deprecated */\n rules: string;\n /**\n * Sets or retrieves a description and/or structure of the object.\n */\n /** @deprecated */\n summary: string;\n /**\n * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\n */\n readonly tBodies: HTMLCollectionOf;\n /**\n * Retrieves the tFoot object of the table.\n */\n tFoot: HTMLTableSectionElement | null;\n /**\n * Retrieves the tHead object of the table.\n */\n tHead: HTMLTableSectionElement | null;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n /**\n * Creates an empty caption element in the table.\n */\n createCaption(): HTMLTableCaptionElement;\n /**\n * Creates an empty tBody element in the table.\n */\n createTBody(): HTMLTableSectionElement;\n /**\n * Creates an empty tFoot element in the table.\n */\n createTFoot(): HTMLTableSectionElement;\n /**\n * Returns the tHead element object if successful, or null otherwise.\n */\n createTHead(): HTMLTableSectionElement;\n /**\n * Deletes the caption element and its contents from the table.\n */\n deleteCaption(): void;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index: number): void;\n /**\n * Deletes the tFoot element and its contents from the table.\n */\n deleteTFoot(): void;\n /**\n * Deletes the tHead element and its contents from the table.\n */\n deleteTHead(): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableElement: {\n prototype: HTMLTableElement;\n new(): HTMLTableElement;\n};\n\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\n scope: string;\n addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableHeaderCellElement: {\n prototype: HTMLTableHeaderCellElement;\n new(): HTMLTableHeaderCellElement;\n};\n\ninterface HTMLTableRowElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves a collection of all cells in the table row.\n */\n readonly cells: HTMLCollectionOf;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Retrieves the position of the object in the rows collection for the table.\n */\n readonly rowIndex: number;\n /**\n * Retrieves the position of the object in the collection.\n */\n readonly sectionRowIndex: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified cell from the table row, as well as from the cells collection.\n * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\n */\n deleteCell(index: number): void;\n /**\n * Creates a new cell in the table row, and adds the cell to the cells collection.\n * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\n */\n insertCell(index?: number): HTMLTableDataCellElement;\n addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableRowElement: {\n prototype: HTMLTableRowElement;\n new(): HTMLTableRowElement;\n};\n\ninterface HTMLTableSectionElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index: number): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableSectionElement: {\n prototype: HTMLTableSectionElement;\n new(): HTMLTableSectionElement;\n};\n\ninterface HTMLTemplateElement extends HTMLElement {\n readonly content: DocumentFragment;\n addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTemplateElement: {\n prototype: HTMLTemplateElement;\n new(): HTMLTemplateElement;\n};\n\ninterface HTMLTextAreaElement extends HTMLElement {\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n cols: number;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n dirName: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n readonly labels: NodeListOf;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n minLength: number;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n /**\n * Sets or retrieves the value indicated whether the content of the object is read-only.\n */\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: number;\n selectionDirection: string;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n readonly textLength: number;\n /**\n * Retrieves the type of control.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Retrieves or sets the text in the entry field of the textArea element.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Sets or retrieves how to handle wordwrapping in the object.\n */\n wrap: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n reportValidity(): boolean;\n /**\n * Highlights the input area of a form element.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n setRangeText(replacement: string): void;\n setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\n};\n\ninterface HTMLTimeElement extends HTMLElement {\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTimeElement: {\n prototype: HTMLTimeElement;\n new(): HTMLTimeElement;\n};\n\ninterface HTMLTitleElement extends HTMLElement {\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTitleElement: {\n prototype: HTMLTitleElement;\n new(): HTMLTitleElement;\n};\n\ninterface HTMLTrackElement extends HTMLElement {\n default: boolean;\n kind: string;\n label: string;\n readonly readyState: number;\n src: string;\n srclang: string;\n readonly track: TextTrack;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTrackElement: {\n prototype: HTMLTrackElement;\n new(): HTMLTrackElement;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n};\n\ninterface HTMLUListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n /** @deprecated */\n type: string;\n addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n};\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUnknownElement: {\n prototype: HTMLUnknownElement;\n new(): HTMLUnknownElement;\n};\n\ninterface HTMLVideoElementEventMap extends HTMLMediaElementEventMap {\n \"MSVideoFormatChanged\": Event;\n \"MSVideoFrameStepCompleted\": Event;\n \"MSVideoOptimalLayoutChanged\": Event;\n}\n\ninterface HTMLVideoElement extends HTMLMediaElement {\n /**\n * Gets or sets the height of the video element.\n */\n height: number;\n msHorizontalMirror: boolean;\n readonly msIsLayoutOptimalForPlayback: boolean;\n readonly msIsStereo3D: boolean;\n msStereo3DPackingMode: string;\n msStereo3DRenderMode: string;\n msZoom: boolean;\n onMSVideoFormatChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoFrameStepCompleted: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoOptimalLayoutChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n /**\n * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\n */\n poster: string;\n /**\n * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoHeight: number;\n /**\n * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoWidth: number;\n readonly webkitDisplayingFullscreen: boolean;\n readonly webkitSupportsFullscreen: boolean;\n /**\n * Gets or sets the width of the video element.\n */\n width: number;\n getVideoPlaybackQuality(): VideoPlaybackQuality;\n msFrameStep(forward: boolean): void;\n msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;\n webkitEnterFullScreen(): void;\n webkitEnterFullscreen(): void;\n webkitExitFullScreen(): void;\n webkitExitFullscreen(): void;\n addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\n};\n\ninterface HashChangeEvent extends Event {\n readonly newURL: string;\n readonly oldURL: string;\n}\n\ndeclare var HashChangeEvent: {\n prototype: HashChangeEvent;\n new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\n};\n\ninterface Headers {\n append(name: string, value: string): void;\n delete(name: string): void;\n get(name: string): string | null;\n has(name: string): boolean;\n set(name: string, value: string): void;\n forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;\n}\n\ndeclare var Headers: {\n prototype: Headers;\n new(init?: HeadersInit): Headers;\n};\n\ninterface History {\n readonly length: number;\n scrollRestoration: ScrollRestoration;\n readonly state: any;\n back(): void;\n forward(): void;\n go(delta?: number): void;\n pushState(data: any, title: string, url?: string | null): void;\n replaceState(data: any, title: string, url?: string | null): void;\n}\n\ndeclare var History: {\n prototype: History;\n new(): History;\n};\n\ninterface HkdfCtrParams extends Algorithm {\n context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n hash: string | Algorithm;\n label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface IDBArrayKey extends Array {\n}\n\ninterface IDBCursor {\n /**\n * Returns the direction (\"next\", \"nextunique\", \"prev\" or \"prevunique\")\n * of the cursor.\n */\n readonly direction: IDBCursorDirection;\n /**\n * Returns the key of the cursor.\n * Throws a \"InvalidStateError\" DOMException if the cursor is advancing or is finished.\n */\n readonly key: IDBValidKey | IDBKeyRange;\n /**\n * Returns the effective key of the cursor.\n * Throws a \"InvalidStateError\" DOMException if the cursor is advancing or is finished.\n */\n readonly primaryKey: IDBValidKey | IDBKeyRange;\n /**\n * Returns the IDBObjectStore or IDBIndex the cursor was opened from.\n */\n readonly source: IDBObjectStore | IDBIndex;\n /**\n * Advances the cursor through the next count records in\n * range.\n */\n advance(count: number): void;\n /**\n * Advances the cursor to the next record in range matching or\n * after key.\n */\n continue(key?: IDBValidKey | IDBKeyRange): void;\n /**\n * Advances the cursor to the next record in range matching\n * or after key and primaryKey. Throws an \"InvalidAccessError\" DOMException if the source is not an index.\n */\n continuePrimaryKey(key: IDBValidKey | IDBKeyRange, primaryKey: IDBValidKey | IDBKeyRange): void;\n /**\n * Delete the record pointed at by the cursor with a new value.\n * If successful, request's result will be undefined.\n */\n delete(): IDBRequest;\n /**\n * Updated the record pointed at by the cursor with a new value.\n * Throws a \"DataError\" DOMException if the effective object store uses in-line keys and the key would have changed.\n * If successful, request's result will be the record's key.\n */\n update(value: any): IDBRequest;\n}\n\ndeclare var IDBCursor: {\n prototype: IDBCursor;\n new(): IDBCursor;\n};\n\ninterface IDBCursorWithValue extends IDBCursor {\n /**\n * Returns the cursor's current value.\n */\n readonly value: any;\n}\n\ndeclare var IDBCursorWithValue: {\n prototype: IDBCursorWithValue;\n new(): IDBCursorWithValue;\n};\n\ninterface IDBDatabaseEventMap {\n \"abort\": Event;\n \"close\": Event;\n \"error\": Event;\n \"versionchange\": IDBVersionChangeEvent;\n}\n\ninterface IDBDatabase extends EventTarget {\n /**\n * Returns the name of the database.\n */\n readonly name: string;\n /**\n * Returns a list of the names of object stores in the database.\n */\n readonly objectStoreNames: DOMStringList;\n onabort: ((this: IDBDatabase, ev: Event) => any) | null;\n onclose: ((this: IDBDatabase, ev: Event) => any) | null;\n onerror: ((this: IDBDatabase, ev: Event) => any) | null;\n onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;\n /**\n * Returns the version of the database.\n */\n readonly version: number;\n /**\n * Closes the connection once all running transactions have finished.\n */\n close(): void;\n /**\n * Creates a new object store with the given name and options and returns a new IDBObjectStore.\n * Throws a \"InvalidStateError\" DOMException if not called within an upgrade transaction.\n */\n createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;\n /**\n * Deletes the object store with the given name.\n * Throws a \"InvalidStateError\" DOMException if not called within an upgrade transaction.\n */\n deleteObjectStore(name: string): void;\n /**\n * Returns a new transaction with the given mode (\"readonly\" or \"readwrite\")\n * and scope which can be a single object store name or an array of names.\n */\n transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBDatabase: {\n prototype: IDBDatabase;\n new(): IDBDatabase;\n};\n\ninterface IDBEnvironment {\n readonly indexedDB: IDBFactory;\n}\n\ninterface IDBFactory {\n /**\n * Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if\n * the keys are equal.\n * Throws a \"DataError\" DOMException if either input is not a valid key.\n */\n cmp(first: any, second: any): number;\n /**\n * Attempts to delete the named database. If the\n * database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request\n * is successful request's result will be null.\n */\n deleteDatabase(name: string): IDBOpenDBRequest;\n /**\n * Attempts to open a connection to the named database with the specified version. If the database already exists\n * with a lower version and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close, then an upgrade\n * will occur. If the database already exists with a higher\n * version the request will fail. If the request is\n * successful request's result will\n * be the connection.\n */\n open(name: string, version?: number): IDBOpenDBRequest;\n}\n\ndeclare var IDBFactory: {\n prototype: IDBFactory;\n new(): IDBFactory;\n};\n\ninterface IDBIndex {\n readonly keyPath: string | string[];\n readonly multiEntry: boolean;\n /**\n * Updates the name of the store to newName.\n * Throws an \"InvalidStateError\" DOMException if not called within an upgrade\n * transaction.\n */\n name: string;\n /**\n * Returns the IDBObjectStore the index belongs to.\n */\n readonly objectStore: IDBObjectStore;\n readonly unique: boolean;\n /**\n * Retrieves the number of records matching the given key or key range in query.\n * If successful, request's result will be the\n * count.\n */\n count(key?: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Retrieves the value of the first record matching the\n * given key or key range in query.\n * If successful, request's result will be the value, or undefined if there was no matching record.\n */\n get(key: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Retrieves the values of the records matching the given key or key range in query (up to count if given).\n * If successful, request's result will be an Array of the values.\n */\n getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;\n /**\n * Retrieves the keys of records matching the given key or key range in query (up to count if given).\n * If successful, request's result will be an Array of the keys.\n */\n getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;\n /**\n * Retrieves the key of the first record matching the\n * given key or key range in query.\n * If successful, request's result will be the key, or undefined if there was no matching record.\n */\n getKey(key: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Opens a cursor over the records matching query,\n * ordered by direction. If query is null, all records in index are matched.\n * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.\n */\n openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;\n /**\n * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.\n * If successful, request's result will be an IDBCursor, or null if there were no matching records.\n */\n openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;\n}\n\ndeclare var IDBIndex: {\n prototype: IDBIndex;\n new(): IDBIndex;\n};\n\ninterface IDBKeyRange {\n /**\n * Returns lower bound, or undefined if none.\n */\n readonly lower: any;\n /**\n * Returns true if the lower open flag is set, and false otherwise.\n */\n readonly lowerOpen: boolean;\n /**\n * Returns upper bound, or undefined if none.\n */\n readonly upper: any;\n /**\n * Returns true if the upper open flag is set, and false otherwise.\n */\n readonly upperOpen: boolean;\n /**\n * Returns true if key is included in the range, and false otherwise.\n */\n includes(key: any): boolean;\n}\n\ndeclare var IDBKeyRange: {\n prototype: IDBKeyRange;\n new(): IDBKeyRange;\n /**\n * Returns a new IDBKeyRange spanning from lower to upper.\n * If lowerOpen is true, lower is not included in the range.\n * If upperOpen is true, upper is not included in the range.\n */\n bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\n /**\n * Returns a new IDBKeyRange starting at key with no\n * upper bound. If open is true, key is not included in the\n * range.\n */\n lowerBound(lower: any, open?: boolean): IDBKeyRange;\n /**\n * Returns a new IDBKeyRange spanning only key.\n */\n only(value: any): IDBKeyRange;\n /**\n * Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range.\n */\n upperBound(upper: any, open?: boolean): IDBKeyRange;\n};\n\ninterface IDBObjectStore {\n /**\n * Returns true if the store has a key generator, and false otherwise.\n */\n readonly autoIncrement: boolean;\n /**\n * Returns a list of the names of indexes in the store.\n */\n readonly indexNames: DOMStringList;\n /**\n * Returns the key path of the store, or null if none.\n */\n readonly keyPath: string | string[];\n /**\n * Updates the name of the store to newName.\n * Throws \"InvalidStateError\" DOMException if not called within an upgrade\n * transaction.\n */\n name: string;\n /**\n * Returns the associated transaction.\n */\n readonly transaction: IDBTransaction;\n add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Deletes all records in store.\n * If successful, request's result will\n * be undefined.\n */\n clear(): IDBRequest;\n /**\n * Retrieves the number of records matching the\n * given key or key range in query.\n * If successful, request's result will be the count.\n */\n count(key?: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be\n * satisfied with the data already in store the upgrade\n * transaction will abort with\n * a \"ConstraintError\" DOMException.\n * Throws an \"InvalidStateError\" DOMException if not called within an upgrade\n * transaction.\n */\n createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;\n /**\n * Deletes records in store with the given key or in the given key range in query.\n * If successful, request's result will\n * be undefined.\n */\n delete(key: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Deletes the index in store with the given name.\n * Throws an \"InvalidStateError\" DOMException if not called within an upgrade\n * transaction.\n */\n deleteIndex(name: string): void;\n /**\n * Retrieves the value of the first record matching the\n * given key or key range in query.\n * If successful, request's result will be the value, or undefined if there was no matching record.\n */\n get(query: IDBValidKey | IDBKeyRange): IDBRequest;\n /**\n * Retrieves the values of the records matching the\n * given key or key range in query (up to count if given).\n * If successful, request's result will\n * be an Array of the values.\n */\n getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;\n /**\n * Retrieves the keys of records matching the\n * given key or key range in query (up to count if given).\n * If successful, request's result will\n * be an Array of the keys.\n */\n getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;\n /**\n * Retrieves the key of the first record matching the\n * given key or key range in query.\n * If successful, request's result will be the key, or undefined if there was no matching record.\n */\n getKey(query: IDBValidKey | IDBKeyRange): IDBRequest;\n index(name: string): IDBIndex;\n /**\n * Opens a cursor over the records matching query,\n * ordered by direction. If query is null, all records in store are matched.\n * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.\n */\n openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;\n /**\n * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.\n * If successful, request's result will be an IDBCursor pointing at the first matching record, or\n * null if there were no matching records.\n */\n openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;\n put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;\n}\n\ndeclare var IDBObjectStore: {\n prototype: IDBObjectStore;\n new(): IDBObjectStore;\n};\n\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\n \"blocked\": Event;\n \"upgradeneeded\": IDBVersionChangeEvent;\n}\n\ninterface IDBOpenDBRequest extends IDBRequest {\n onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;\n onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;\n addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n};\n\ninterface IDBRequestEventMap {\n \"error\": Event;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n /**\n * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws\n * a \"InvalidStateError\" DOMException if the request is still pending.\n */\n readonly error: DOMException | null;\n onerror: ((this: IDBRequest, ev: Event) => any) | null;\n onsuccess: ((this: IDBRequest, ev: Event) => any) | null;\n /**\n * Returns \"pending\" until a request is complete,\n * then returns \"done\".\n */\n readonly readyState: IDBRequestReadyState;\n /**\n * When a request is completed, returns the result,\n * or undefined if the request failed. Throws a\n * \"InvalidStateError\" DOMException if the request is still pending.\n */\n readonly result: T;\n /**\n * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open\n * request.\n */\n readonly source: IDBObjectStore | IDBIndex | IDBCursor;\n /**\n * Returns the IDBTransaction the request was made within.\n * If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.\n */\n readonly transaction: IDBTransaction | null;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n};\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface IDBTransaction extends EventTarget {\n /**\n * Returns the transaction's connection.\n */\n readonly db: IDBDatabase;\n /**\n * If the transaction was aborted, returns the\n * error (a DOMException) providing the reason.\n */\n readonly error: DOMException;\n /**\n * Returns the mode the transaction was created with\n * (\"readonly\" or \"readwrite\"), or \"versionchange\" for\n * an upgrade transaction.\n */\n readonly mode: IDBTransactionMode;\n /**\n * Returns a list of the names of object stores in the\n * transaction's scope. For an upgrade transaction this is all object stores in the database.\n */\n readonly objectStoreNames: DOMStringList;\n onabort: ((this: IDBTransaction, ev: Event) => any) | null;\n oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;\n onerror: ((this: IDBTransaction, ev: Event) => any) | null;\n /**\n * Aborts the transaction. All pending requests will fail with\n * a \"AbortError\" DOMException and all changes made to the database will be\n * reverted.\n */\n abort(): void;\n /**\n * Returns an IDBObjectStore in the transaction's scope.\n */\n objectStore(name: string): IDBObjectStore;\n addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBTransaction: {\n prototype: IDBTransaction;\n new(): IDBTransaction;\n};\n\ninterface IDBVersionChangeEvent extends Event {\n readonly newVersion: number | null;\n readonly oldVersion: number;\n}\n\ndeclare var IDBVersionChangeEvent: {\n prototype: IDBVersionChangeEvent;\n new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;\n};\n\ninterface IIRFilterNode extends AudioNode {\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var IIRFilterNode: {\n prototype: IIRFilterNode;\n new(context: BaseAudioContext, options: IIRFilterOptions): IIRFilterNode;\n};\n\ninterface ImageBitmap {\n /**\n * Returns the intrinsic height of the image, in CSS\n * pixels.\n */\n readonly height: number;\n /**\n * Returns the intrinsic width of the image, in CSS\n * pixels.\n */\n readonly width: number;\n /**\n * Releases imageBitmap's underlying bitmap data.\n */\n close(): void;\n}\n\ndeclare var ImageBitmap: {\n prototype: ImageBitmap;\n new(): ImageBitmap;\n};\n\ninterface ImageBitmapOptions {\n colorSpaceConversion?: \"none\" | \"default\";\n imageOrientation?: \"none\" | \"flipY\";\n premultiplyAlpha?: \"none\" | \"premultiply\" | \"default\";\n resizeHeight?: number;\n resizeQuality?: \"pixelated\" | \"low\" | \"medium\" | \"high\";\n resizeWidth?: number;\n}\n\ninterface ImageBitmapRenderingContext {\n /**\n * Returns the canvas element that the context is bound to.\n */\n readonly canvas: HTMLCanvasElement;\n /**\n * Replaces contents of the canvas element to which context\n * is bound with a transparent black bitmap whose size corresponds to the width and height\n * content attributes of the canvas element.\n */\n transferFromImageBitmap(bitmap: ImageBitmap | null): void;\n}\n\ndeclare var ImageBitmapRenderingContext: {\n prototype: ImageBitmapRenderingContext;\n new(): ImageBitmapRenderingContext;\n};\n\ninterface ImageData {\n /**\n * Returns the one-dimensional array containing the data in RGBA order, as integers in the\n * range 0 to 255.\n */\n readonly data: Uint8ClampedArray;\n /**\n * Returns the actual dimensions of the data in the ImageData object, in\n * pixels.\n */\n readonly height: number;\n readonly width: number;\n}\n\ndeclare var ImageData: {\n prototype: ImageData;\n new(width: number, height: number): ImageData;\n new(array: Uint8ClampedArray, width: number, height: number): ImageData;\n};\n\ninterface IntersectionObserver {\n readonly root: Element | null;\n readonly rootMargin: string;\n readonly thresholds: number[];\n disconnect(): void;\n observe(target: Element): void;\n takeRecords(): IntersectionObserverEntry[];\n unobserve(target: Element): void;\n}\n\ndeclare var IntersectionObserver: {\n prototype: IntersectionObserver;\n new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\n};\n\ninterface IntersectionObserverEntry {\n readonly boundingClientRect: ClientRect | DOMRect;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect | DOMRect;\n readonly isIntersecting: boolean;\n readonly rootBounds: ClientRect | DOMRect;\n readonly target: Element;\n readonly time: number;\n}\n\ndeclare var IntersectionObserverEntry: {\n prototype: IntersectionObserverEntry;\n new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\n};\n\ninterface KeyboardEvent extends UIEvent {\n readonly altKey: boolean;\n /** @deprecated */\n char: string;\n /** @deprecated */\n readonly charCode: number;\n readonly code: string;\n readonly ctrlKey: boolean;\n readonly key: string;\n /** @deprecated */\n readonly keyCode: number;\n readonly location: number;\n readonly metaKey: boolean;\n readonly repeat: boolean;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly which: number;\n getModifierState(keyArg: string): boolean;\n /** @deprecated */\n initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n}\n\ndeclare var KeyboardEvent: {\n prototype: KeyboardEvent;\n new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n};\n\ninterface KeyframeEffect extends AnimationEffect {\n composite: CompositeOperation;\n iterationComposite: IterationCompositeOperation;\n target: Element | null;\n getKeyframes(): ComputedKeyframe[];\n setKeyframes(keyframes: Keyframe[] | PropertyIndexedKeyframes | null): void;\n}\n\ndeclare var KeyframeEffect: {\n prototype: KeyframeEffect;\n new(target: Element | null, keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeEffectOptions): KeyframeEffect;\n new(source: KeyframeEffect): KeyframeEffect;\n};\n\ninterface LinkStyle {\n readonly sheet: StyleSheet | null;\n}\n\ninterface ListeningStateChangedEvent extends Event {\n readonly label: string;\n readonly state: ListeningState;\n}\n\ndeclare var ListeningStateChangedEvent: {\n prototype: ListeningStateChangedEvent;\n new(): ListeningStateChangedEvent;\n};\n\ninterface Location {\n /**\n * Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing\n * context to the top-level browsing context.\n */\n readonly ancestorOrigins: DOMStringList;\n /**\n * Returns the Location object's URL's fragment (includes leading \"#\" if non-empty).\n * Can be set, to navigate to the same URL with a changed fragment (ignores leading \"#\").\n */\n hash: string;\n /**\n * Returns the Location object's URL's host and port (if different from the default\n * port for the scheme).\n * Can be set, to navigate to the same URL with a changed host and port.\n */\n host: string;\n /**\n * Returns the Location object's URL's host.\n * Can be set, to navigate to the same URL with a changed host.\n */\n hostname: string;\n /**\n * Returns the Location object's URL.\n * Can be set, to navigate to the given URL.\n */\n href: string;\n /**\n * Returns the Location object's URL's origin.\n */\n readonly origin: string;\n /**\n * Returns the Location object's URL's path.\n * Can be set, to navigate to the same URL with a changed path.\n */\n pathname: string;\n /**\n * Returns the Location object's URL's port.\n * Can be set, to navigate to the same URL with a changed port.\n */\n port: string;\n /**\n * Returns the Location object's URL's scheme.\n * Can be set, to navigate to the same URL with a changed scheme.\n */\n protocol: string;\n /**\n * Returns the Location object's URL's query (includes leading \"?\" if non-empty).\n * Can be set, to navigate to the same URL with a changed query (ignores leading \"?\").\n */\n search: string;\n /**\n * Navigates to the given URL.\n */\n assign(url: string): void;\n /**\n * Reloads the current page.\n */\n reload(): void;\n /** @deprecated */\n reload(forcedReload: boolean): void;\n /**\n * Removes the current page from the session history and navigates to the given URL.\n */\n replace(url: string): void;\n}\n\ndeclare var Location: {\n prototype: Location;\n new(): Location;\n};\n\ninterface MSAssertion {\n readonly id: string;\n readonly type: MSCredentialType;\n}\n\ndeclare var MSAssertion: {\n prototype: MSAssertion;\n new(): MSAssertion;\n};\n\ninterface MSBlobBuilder {\n append(data: any, endings?: string): void;\n getBlob(contentType?: string): Blob;\n}\n\ndeclare var MSBlobBuilder: {\n prototype: MSBlobBuilder;\n new(): MSBlobBuilder;\n};\n\ninterface MSFIDOCredentialAssertion extends MSAssertion {\n readonly algorithm: string | Algorithm;\n readonly attestation: any;\n readonly publicKey: string;\n readonly transportHints: MSTransportType[];\n}\n\ndeclare var MSFIDOCredentialAssertion: {\n prototype: MSFIDOCredentialAssertion;\n new(): MSFIDOCredentialAssertion;\n};\n\ninterface MSFIDOSignature {\n readonly authnrData: string;\n readonly clientData: string;\n readonly signature: string;\n}\n\ndeclare var MSFIDOSignature: {\n prototype: MSFIDOSignature;\n new(): MSFIDOSignature;\n};\n\ninterface MSFIDOSignatureAssertion extends MSAssertion {\n readonly signature: MSFIDOSignature;\n}\n\ndeclare var MSFIDOSignatureAssertion: {\n prototype: MSFIDOSignatureAssertion;\n new(): MSFIDOSignatureAssertion;\n};\n\ninterface MSFileSaver {\n msSaveBlob(blob: any, defaultName?: string): boolean;\n msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\n}\n\ninterface MSGesture {\n target: Element;\n addPointer(pointerId: number): void;\n stop(): void;\n}\n\ndeclare var MSGesture: {\n prototype: MSGesture;\n new(): MSGesture;\n};\n\ninterface MSGestureEvent extends UIEvent {\n readonly clientX: number;\n readonly clientY: number;\n readonly expansion: number;\n readonly gestureObject: any;\n readonly hwTimestamp: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly rotation: number;\n readonly scale: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityAngular: number;\n readonly velocityExpansion: number;\n readonly velocityX: number;\n readonly velocityY: number;\n initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n}\n\ndeclare var MSGestureEvent: {\n prototype: MSGestureEvent;\n new(): MSGestureEvent;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n};\n\ninterface MSGraphicsTrust {\n readonly constrictionActive: boolean;\n readonly status: string;\n}\n\ndeclare var MSGraphicsTrust: {\n prototype: MSGraphicsTrust;\n new(): MSGraphicsTrust;\n};\n\ninterface MSInputMethodContextEventMap {\n \"MSCandidateWindowHide\": Event;\n \"MSCandidateWindowShow\": Event;\n \"MSCandidateWindowUpdate\": Event;\n}\n\ninterface MSInputMethodContext extends EventTarget {\n readonly compositionEndOffset: number;\n readonly compositionStartOffset: number;\n oncandidatewindowhide: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowshow: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowupdate: ((this: MSInputMethodContext, ev: Event) => any) | null;\n readonly target: HTMLElement;\n getCandidateWindowClientRect(): ClientRect;\n getCompositionAlternatives(): string[];\n hasComposition(): boolean;\n isCandidateWindowVisible(): boolean;\n addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSInputMethodContext: {\n prototype: MSInputMethodContext;\n new(): MSInputMethodContext;\n};\n\ninterface MSMediaKeyError {\n readonly code: number;\n readonly systemCode: number;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n}\n\ndeclare var MSMediaKeyError: {\n prototype: MSMediaKeyError;\n new(): MSMediaKeyError;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n};\n\ninterface MSMediaKeyMessageEvent extends Event {\n readonly destinationURL: string | null;\n readonly message: Uint8Array;\n}\n\ndeclare var MSMediaKeyMessageEvent: {\n prototype: MSMediaKeyMessageEvent;\n new(): MSMediaKeyMessageEvent;\n};\n\ninterface MSMediaKeyNeededEvent extends Event {\n readonly initData: Uint8Array | null;\n}\n\ndeclare var MSMediaKeyNeededEvent: {\n prototype: MSMediaKeyNeededEvent;\n new(): MSMediaKeyNeededEvent;\n};\n\ninterface MSMediaKeySession extends EventTarget {\n readonly error: MSMediaKeyError | null;\n readonly keySystem: string;\n readonly sessionId: string;\n close(): void;\n update(key: Uint8Array): void;\n}\n\ndeclare var MSMediaKeySession: {\n prototype: MSMediaKeySession;\n new(): MSMediaKeySession;\n};\n\ninterface MSMediaKeys {\n readonly keySystem: string;\n createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array | null): MSMediaKeySession;\n}\n\ndeclare var MSMediaKeys: {\n prototype: MSMediaKeys;\n new(keySystem: string): MSMediaKeys;\n isTypeSupported(keySystem: string, type?: string | null): boolean;\n isTypeSupportedWithFeatures(keySystem: string, type?: string | null): string;\n};\n\ninterface MSNavigatorDoNotTrack {\n confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\n confirmWebWideTrackingException(args: ExceptionInformation): boolean;\n removeSiteSpecificTrackingException(args: ExceptionInformation): void;\n removeWebWideTrackingException(args: ExceptionInformation): void;\n storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\n storeWebWideTrackingException(args: StoreExceptionsInformation): void;\n}\n\ninterface MSPointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var MSPointerEvent: {\n prototype: MSPointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\n};\n\ninterface MSStream {\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n}\n\ndeclare var MSStream: {\n prototype: MSStream;\n new(): MSStream;\n};\n\ninterface MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: MediaDeviceKind;\n readonly label: string;\n}\n\ndeclare var MediaDeviceInfo: {\n prototype: MediaDeviceInfo;\n new(): MediaDeviceInfo;\n};\n\ninterface MediaDevicesEventMap {\n \"devicechange\": Event;\n}\n\ninterface MediaDevices extends EventTarget {\n ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;\n enumerateDevices(): Promise;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaDevices: {\n prototype: MediaDevices;\n new(): MediaDevices;\n};\n\ninterface MediaElementAudioSourceNode extends AudioNode {\n readonly mediaElement: HTMLMediaElement;\n}\n\ndeclare var MediaElementAudioSourceNode: {\n prototype: MediaElementAudioSourceNode;\n new(context: AudioContext, options: MediaElementAudioSourceOptions): MediaElementAudioSourceNode;\n};\n\ninterface MediaEncryptedEvent extends Event {\n readonly initData: ArrayBuffer | null;\n readonly initDataType: string;\n}\n\ndeclare var MediaEncryptedEvent: {\n prototype: MediaEncryptedEvent;\n new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\n};\n\ninterface MediaError {\n readonly code: number;\n readonly message: string;\n readonly msExtendedCode: number;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n}\n\ndeclare var MediaError: {\n prototype: MediaError;\n new(): MediaError;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n};\n\ninterface MediaKeyMessageEvent extends Event {\n readonly message: ArrayBuffer;\n readonly messageType: MediaKeyMessageType;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n};\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: Promise;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): Promise;\n generateRequest(initDataType: string, initData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeySession: {\n prototype: MediaKeySession;\n new(): MediaKeySession;\n};\n\ninterface MediaKeyStatusMap {\n readonly size: number;\n forEach(callback: Function, thisArg?: any): void;\n get(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): MediaKeyStatus;\n has(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n};\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): Promise;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n};\n\ninterface MediaKeys {\n createSession(sessionType?: MediaKeySessionType): MediaKeySession;\n setServerCertificate(serverCertificate: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\n};\n\ninterface MediaList {\n readonly length: number;\n mediaText: string;\n appendMedium(medium: string): void;\n deleteMedium(medium: string): void;\n item(index: number): string | null;\n toString(): number;\n [index: number]: string;\n}\n\ndeclare var MediaList: {\n prototype: MediaList;\n new(): MediaList;\n};\n\ninterface MediaQueryListEventMap {\n \"change\": MediaQueryListEvent;\n}\n\ninterface MediaQueryList extends EventTarget {\n readonly matches: boolean;\n readonly media: string;\n onchange: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null;\n /** @deprecated */\n addListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;\n /** @deprecated */\n removeListener(listener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null): void;\n addEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaQueryList: {\n prototype: MediaQueryList;\n new(): MediaQueryList;\n};\n\ninterface MediaQueryListEvent extends Event {\n readonly matches: boolean;\n readonly media: string;\n}\n\ndeclare var MediaQueryListEvent: {\n prototype: MediaQueryListEvent;\n new(type: string, eventInitDict?: MediaQueryListEventInit): MediaQueryListEvent;\n};\n\ninterface MediaSource extends EventTarget {\n readonly activeSourceBuffers: SourceBufferList;\n duration: number;\n readonly readyState: ReadyState;\n readonly sourceBuffers: SourceBufferList;\n addSourceBuffer(type: string): SourceBuffer;\n endOfStream(error?: EndOfStreamError): void;\n removeSourceBuffer(sourceBuffer: SourceBuffer): void;\n}\n\ndeclare var MediaSource: {\n prototype: MediaSource;\n new(): MediaSource;\n isTypeSupported(type: string): boolean;\n};\n\ninterface MediaStreamEventMap {\n \"active\": Event;\n \"addtrack\": MediaStreamTrackEvent;\n \"inactive\": Event;\n \"removetrack\": MediaStreamTrackEvent;\n}\n\ninterface MediaStream extends EventTarget {\n readonly active: boolean;\n readonly id: string;\n onactive: ((this: MediaStream, ev: Event) => any) | null;\n onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n oninactive: ((this: MediaStream, ev: Event) => any) | null;\n onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n addTrack(track: MediaStreamTrack): void;\n clone(): MediaStream;\n getAudioTracks(): MediaStreamTrack[];\n getTrackById(trackId: string): MediaStreamTrack | null;\n getTracks(): MediaStreamTrack[];\n getVideoTracks(): MediaStreamTrack[];\n removeTrack(track: MediaStreamTrack): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStream: {\n prototype: MediaStream;\n new(): MediaStream;\n new(stream: MediaStream): MediaStream;\n new(tracks: MediaStreamTrack[]): MediaStream;\n};\n\ninterface MediaStreamAudioDestinationNode extends AudioNode {\n readonly stream: MediaStream;\n}\n\ndeclare var MediaStreamAudioDestinationNode: {\n prototype: MediaStreamAudioDestinationNode;\n new(context: AudioContext, options?: AudioNodeOptions): MediaStreamAudioDestinationNode;\n};\n\ninterface MediaStreamAudioSourceNode extends AudioNode {\n readonly mediaStream: MediaStream;\n}\n\ndeclare var MediaStreamAudioSourceNode: {\n prototype: MediaStreamAudioSourceNode;\n new(context: AudioContext, options: MediaStreamAudioSourceOptions): MediaStreamAudioSourceNode;\n};\n\ninterface MediaStreamError {\n readonly constraintName: string | null;\n readonly message: string | null;\n readonly name: string;\n}\n\ndeclare var MediaStreamError: {\n prototype: MediaStreamError;\n new(): MediaStreamError;\n};\n\ninterface MediaStreamErrorEvent extends Event {\n readonly error: MediaStreamError | null;\n}\n\ndeclare var MediaStreamErrorEvent: {\n prototype: MediaStreamErrorEvent;\n new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\n};\n\ninterface MediaStreamEvent extends Event {\n readonly stream: MediaStream | null;\n}\n\ndeclare var MediaStreamEvent: {\n prototype: MediaStreamEvent;\n new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\n};\n\ninterface MediaStreamTrackEventMap {\n \"ended\": MediaStreamErrorEvent;\n \"isolationchange\": Event;\n \"mute\": Event;\n \"overconstrained\": MediaStreamErrorEvent;\n \"unmute\": Event;\n}\n\ninterface MediaStreamTrack extends EventTarget {\n enabled: boolean;\n readonly id: string;\n readonly isolated: boolean;\n readonly kind: string;\n readonly label: string;\n readonly muted: boolean;\n onended: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;\n onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n readonly readonly: boolean;\n readonly readyState: MediaStreamTrackState;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): Promise;\n clone(): MediaStreamTrack;\n getCapabilities(): MediaTrackCapabilities;\n getConstraints(): MediaTrackConstraints;\n getSettings(): MediaTrackSettings;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStreamTrack: {\n prototype: MediaStreamTrack;\n new(): MediaStreamTrack;\n};\n\ninterface MediaStreamTrackAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaStreamTrackAudioSourceNode: {\n prototype: MediaStreamTrackAudioSourceNode;\n new(context: AudioContext, options: MediaStreamTrackAudioSourceOptions): MediaStreamTrackAudioSourceNode;\n};\n\ninterface MediaStreamTrackEvent extends Event {\n readonly track: MediaStreamTrack;\n}\n\ndeclare var MediaStreamTrackEvent: {\n prototype: MediaStreamTrackEvent;\n new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;\n};\n\ninterface MessageChannel {\n readonly port1: MessagePort;\n readonly port2: MessagePort;\n}\n\ndeclare var MessageChannel: {\n prototype: MessageChannel;\n new(): MessageChannel;\n};\n\ninterface MessageEvent extends Event {\n /**\n * Returns the data of the message.\n */\n readonly data: any;\n /**\n * Returns the last event ID string, for\n * server-sent events.\n */\n readonly lastEventId: string;\n /**\n * Returns the origin of the message, for server-sent events and\n * cross-document messaging.\n */\n readonly origin: string;\n /**\n * Returns the MessagePort array sent with the message, for cross-document\n * messaging and channel messaging.\n */\n readonly ports: ReadonlyArray;\n /**\n * Returns the WindowProxy of the source window, for cross-document\n * messaging, and the MessagePort being attached, in the connect event fired at\n * SharedWorkerGlobalScope objects.\n */\n readonly source: MessageEventSource | null;\n}\n\ndeclare var MessageEvent: {\n prototype: MessageEvent;\n new(type: string, eventInitDict?: MessageEventInit): MessageEvent;\n};\n\ninterface MessagePortEventMap {\n \"message\": MessageEvent;\n \"messageerror\": MessageEvent;\n}\n\ninterface MessagePort extends EventTarget {\n onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;\n onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;\n /**\n * Disconnects the port, so that it is no longer active.\n */\n close(): void;\n /**\n * Posts a message through the channel. Objects listed in transfer are\n * transferred, not just cloned, meaning that they are no longer usable on the sending side.\n * Throws a \"DataCloneError\" DOMException if\n * transfer contains duplicate objects or port, or if message\n * could not be cloned.\n */\n postMessage(message: any, transfer?: Transferable[]): void;\n /**\n * Begins dispatching messages received on the port.\n */\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MessagePort: {\n prototype: MessagePort;\n new(): MessagePort;\n};\n\ninterface MimeType {\n readonly description: string;\n readonly enabledPlugin: Plugin;\n readonly suffixes: string;\n readonly type: string;\n}\n\ndeclare var MimeType: {\n prototype: MimeType;\n new(): MimeType;\n};\n\ninterface MimeTypeArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(type: string): Plugin;\n [index: number]: Plugin;\n}\n\ndeclare var MimeTypeArray: {\n prototype: MimeTypeArray;\n new(): MimeTypeArray;\n};\n\ninterface MouseEvent extends UIEvent {\n readonly altKey: boolean;\n readonly button: number;\n readonly buttons: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly ctrlKey: boolean;\n /** @deprecated */\n readonly fromElement: Element;\n readonly layerX: number;\n readonly layerY: number;\n readonly metaKey: boolean;\n readonly movementX: number;\n readonly movementY: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly relatedTarget: EventTarget;\n readonly screenX: number;\n readonly screenY: number;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly toElement: Element;\n /** @deprecated */\n readonly which: number;\n readonly x: number;\n readonly y: number;\n getModifierState(keyArg: string): boolean;\n initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\n}\n\ndeclare var MouseEvent: {\n prototype: MouseEvent;\n new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;\n};\n\ninterface MutationEvent extends Event {\n readonly attrChange: number;\n readonly attrName: string;\n readonly newValue: string;\n readonly prevValue: string;\n readonly relatedNode: Node;\n initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n}\n\ndeclare var MutationEvent: {\n prototype: MutationEvent;\n new(): MutationEvent;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n};\n\ninterface MutationObserver {\n disconnect(): void;\n /**\n * Instructs the user agent to observe a given target (a node) and report any mutations based on\n * the criteria given by options (an object).\n * The options argument allows for setting mutation\n * observation options via object members. These are the object members that\n * can be used:\n * childList\n * Set to true if mutations to target's children are to be observed.\n * attributes\n * Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is\n * specified.\n * characterData\n * Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified.\n * subtree\n * Set to true if mutations to not just target, but\n * also target's descendants are to be\n * observed.\n * attributeOldValue\n * Set to true if attributes is true or omitted\n * and target's attribute value before the mutation\n * needs to be recorded.\n * characterDataOldValue\n * Set to true if characterData is set to true or omitted and target's data before the mutation\n * needs to be recorded.\n * attributeFilter\n * Set to a list of attribute local names (without namespace) if not all attribute mutations need to be\n * observed and attributes is true\n * or omitted.\n */\n observe(target: Node, options?: MutationObserverInit): void;\n /**\n * Empties the record queue and\n * returns what was in there.\n */\n takeRecords(): MutationRecord[];\n}\n\ndeclare var MutationObserver: {\n prototype: MutationObserver;\n new(callback: MutationCallback): MutationObserver;\n};\n\ninterface MutationRecord {\n readonly addedNodes: NodeList;\n /**\n * Returns the local name of the\n * changed attribute, and null otherwise.\n */\n readonly attributeName: string | null;\n /**\n * Returns the namespace of the\n * changed attribute, and null otherwise.\n */\n readonly attributeNamespace: string | null;\n /**\n * Return the previous and next sibling respectively\n * of the added or removed nodes, and null otherwise.\n */\n readonly nextSibling: Node | null;\n /**\n * The return value depends on type. For\n * \"attributes\", it is the value of the\n * changed attribute before the change.\n * For \"characterData\", it is the data of the changed node before the change. For\n * \"childList\", it is null.\n */\n readonly oldValue: string | null;\n readonly previousSibling: Node | null;\n /**\n * Return the nodes added and removed\n * respectively.\n */\n readonly removedNodes: NodeList;\n readonly target: Node;\n /**\n * Returns \"attributes\" if it was an attribute mutation.\n * \"characterData\" if it was a mutation to a CharacterData node. And\n * \"childList\" if it was a mutation to the tree of nodes.\n */\n readonly type: MutationRecordType;\n}\n\ndeclare var MutationRecord: {\n prototype: MutationRecord;\n new(): MutationRecord;\n};\n\ninterface NamedNodeMap {\n readonly length: number;\n getNamedItem(qualifiedName: string): Attr | null;\n getNamedItemNS(namespace: string | null, localName: string): Attr | null;\n item(index: number): Attr | null;\n removeNamedItem(qualifiedName: string): Attr;\n removeNamedItemNS(namespace: string | null, localName: string): Attr;\n setNamedItem(attr: Attr): Attr | null;\n setNamedItemNS(attr: Attr): Attr | null;\n [index: number]: Attr;\n}\n\ndeclare var NamedNodeMap: {\n prototype: NamedNodeMap;\n new(): NamedNodeMap;\n};\n\ninterface NavigationPreloadManager {\n disable(): Promise;\n enable(): Promise;\n getState(): Promise;\n setHeaderValue(value: string): Promise;\n}\n\ndeclare var NavigationPreloadManager: {\n prototype: NavigationPreloadManager;\n new(): NavigationPreloadManager;\n};\n\ninterface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation {\n readonly activeVRDisplays: ReadonlyArray;\n readonly authentication: WebAuthentication;\n readonly cookieEnabled: boolean;\n readonly doNotTrack: string | null;\n gamepadInputEmulation: GamepadInputEmulationType;\n readonly geolocation: Geolocation;\n readonly maxTouchPoints: number;\n readonly mimeTypes: MimeTypeArray;\n readonly msManipulationViewsEnabled: boolean;\n readonly msMaxTouchPoints: number;\n readonly msPointerEnabled: boolean;\n readonly plugins: PluginArray;\n readonly pointerEnabled: boolean;\n readonly serviceWorker: ServiceWorkerContainer;\n readonly webdriver: boolean;\n getGamepads(): (Gamepad | null)[];\n getVRDisplays(): Promise;\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise;\n vibrate(pattern: number | number[]): boolean;\n}\n\ndeclare var Navigator: {\n prototype: Navigator;\n new(): Navigator;\n};\n\ninterface NavigatorAutomationInformation {\n readonly webdriver: boolean;\n}\n\ninterface NavigatorBeacon {\n sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;\n}\n\ninterface NavigatorConcurrentHardware {\n readonly hardwareConcurrency: number;\n}\n\ninterface NavigatorContentUtils {\n}\n\ninterface NavigatorID {\n readonly appCodeName: string;\n readonly appName: string;\n readonly appVersion: string;\n readonly platform: string;\n readonly product: string;\n readonly productSub: string;\n readonly userAgent: string;\n readonly vendor: string;\n readonly vendorSub: string;\n}\n\ninterface NavigatorLanguage {\n readonly language: string;\n readonly languages: ReadonlyArray;\n}\n\ninterface NavigatorOnLine {\n readonly onLine: boolean;\n}\n\ninterface NavigatorStorage {\n readonly storage: StorageManager;\n}\n\ninterface NavigatorStorageUtils {\n}\n\ninterface NavigatorUserMedia {\n readonly mediaDevices: MediaDevices;\n getDisplayMedia(constraints: MediaStreamConstraints): Promise;\n getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\n}\n\ninterface Node extends EventTarget {\n /**\n * Returns node's node document's document base URL.\n */\n readonly baseURI: string;\n /**\n * Returns the children.\n */\n readonly childNodes: NodeListOf;\n /**\n * Returns the first child.\n */\n readonly firstChild: ChildNode | null;\n /**\n * Returns true if node is connected and false otherwise.\n */\n readonly isConnected: boolean;\n /**\n * Returns the last child.\n */\n readonly lastChild: ChildNode | null;\n /** @deprecated */\n readonly namespaceURI: string | null;\n /**\n * Returns the next sibling.\n */\n readonly nextSibling: Node | null;\n /**\n * Returns a string appropriate for the type of node, as\n * follows:\n * Element\n * Its HTML-uppercased qualified name.\n * Attr\n * Its qualified name.\n * Text\n * \"#text\".\n * CDATASection\n * \"#cdata-section\".\n * ProcessingInstruction\n * Its target.\n * Comment\n * \"#comment\".\n * Document\n * \"#document\".\n * DocumentType\n * Its name.\n * DocumentFragment\n * \"#document-fragment\".\n */\n readonly nodeName: string;\n readonly nodeType: number;\n nodeValue: string | null;\n /**\n * Returns the node document.\n * Returns null for documents.\n */\n readonly ownerDocument: Document | null;\n /**\n * Returns the parent element.\n */\n readonly parentElement: HTMLElement | null;\n /**\n * Returns the parent.\n */\n readonly parentNode: Node & ParentNode | null;\n /**\n * Returns the previous sibling.\n */\n readonly previousSibling: Node | null;\n textContent: string | null;\n appendChild(newChild: T): T;\n /**\n * Returns a copy of node. If deep is true, the copy also includes the node's descendants.\n */\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n /**\n * Returns true if other is an inclusive descendant of node, and false otherwise.\n */\n contains(other: Node | null): boolean;\n /**\n * Returns node's shadow-including root.\n */\n getRootNode(options?: GetRootNodeOptions): Node;\n /**\n * Returns whether node has children.\n */\n hasChildNodes(): boolean;\n insertBefore(newChild: T, refChild: Node | null): T;\n isDefaultNamespace(namespace: string | null): boolean;\n /**\n * Returns whether node and otherNode have the same properties.\n */\n isEqualNode(otherNode: Node | null): boolean;\n isSameNode(otherNode: Node | null): boolean;\n lookupNamespaceURI(prefix: string | null): string | null;\n lookupPrefix(namespace: string | null): string | null;\n /**\n * Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.\n */\n normalize(): void;\n removeChild(oldChild: T): T;\n replaceChild(newChild: Node, oldChild: T): T;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n}\n\ndeclare var Node: {\n prototype: Node;\n new(): Node;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n};\n\ninterface NodeFilter {\n acceptNode(node: Node): number;\n}\n\ndeclare var NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_NOTATION: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_TEXT: number;\n};\n\ninterface NodeIterator {\n readonly filter: NodeFilter | null;\n readonly pointerBeforeReferenceNode: boolean;\n readonly referenceNode: Node;\n readonly root: Node;\n readonly whatToShow: number;\n detach(): void;\n nextNode(): Node | null;\n previousNode(): Node | null;\n}\n\ndeclare var NodeIterator: {\n prototype: NodeIterator;\n new(): NodeIterator;\n};\n\ninterface NodeList {\n /**\n * Returns the number of nodes in the collection.\n */\n readonly length: number;\n /**\n * element = collection[index]\n */\n item(index: number): Node | null;\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: Node, key: number, parent: NodeList) => void, thisArg?: any): void;\n [index: number]: Node;\n}\n\ndeclare var NodeList: {\n prototype: NodeList;\n new(): NodeList;\n};\n\ninterface NodeListOf extends NodeList {\n length: number;\n item(index: number): TNode;\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: TNode, key: number, parent: NodeListOf) => void, thisArg?: any): void;\n [index: number]: TNode;\n}\n\ninterface NodeSelector {\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface NonDocumentTypeChildNode {\n /**\n * Returns the first following sibling that\n * is an element, and null otherwise.\n */\n readonly nextElementSibling: Element | null;\n /**\n * Returns the first preceding sibling that\n * is an element, and null otherwise.\n */\n readonly previousElementSibling: Element | null;\n}\n\ninterface NonElementParentNode {\n /**\n * Returns the first element within node's descendants whose ID is elementId.\n */\n getElementById(elementId: string): Element | null;\n}\n\ninterface NotificationEventMap {\n \"click\": Event;\n \"close\": Event;\n \"error\": Event;\n \"show\": Event;\n}\n\ninterface Notification extends EventTarget {\n readonly actions: ReadonlyArray;\n readonly badge: string;\n readonly body: string;\n readonly data: any;\n readonly dir: NotificationDirection;\n readonly icon: string;\n readonly image: string;\n readonly lang: string;\n onclick: ((this: Notification, ev: Event) => any) | null;\n onclose: ((this: Notification, ev: Event) => any) | null;\n onerror: ((this: Notification, ev: Event) => any) | null;\n onshow: ((this: Notification, ev: Event) => any) | null;\n readonly renotify: boolean;\n readonly requireInteraction: boolean;\n readonly silent: boolean;\n readonly tag: string;\n readonly timestamp: number;\n readonly title: string;\n readonly vibrate: ReadonlyArray;\n close(): void;\n addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Notification: {\n prototype: Notification;\n new(title: string, options?: NotificationOptions): Notification;\n readonly maxActions: number;\n readonly permission: NotificationPermission;\n requestPermission(deprecatedCallback?: NotificationPermissionCallback): Promise;\n};\n\ninterface OES_element_index_uint {\n}\n\ninterface OES_standard_derivatives {\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum;\n}\n\ninterface OES_texture_float {\n}\n\ninterface OES_texture_float_linear {\n}\n\ninterface OES_texture_half_float {\n readonly HALF_FLOAT_OES: GLenum;\n}\n\ninterface OES_texture_half_float_linear {\n}\n\ninterface OES_vertex_array_object {\n bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\n createVertexArrayOES(): WebGLVertexArrayObjectOES | null;\n deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void;\n isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): GLboolean;\n readonly VERTEX_ARRAY_BINDING_OES: GLenum;\n}\n\ninterface OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(type: string, eventInitDict: OfflineAudioCompletionEventInit): OfflineAudioCompletionEvent;\n};\n\ninterface OfflineAudioContextEventMap extends BaseAudioContextEventMap {\n \"complete\": OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContext extends BaseAudioContext {\n readonly length: number;\n oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;\n startRendering(): Promise;\n suspend(suspendTime: number): Promise;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OfflineAudioContext: {\n prototype: OfflineAudioContext;\n new(contextOptions: OfflineAudioContextOptions): OfflineAudioContext;\n new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\n};\n\ninterface OscillatorNode extends AudioScheduledSourceNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n type: OscillatorType;\n setPeriodicWave(periodicWave: PeriodicWave): void;\n addEventListener(type: K, listener: (this: OscillatorNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OscillatorNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OscillatorNode: {\n prototype: OscillatorNode;\n new(context: BaseAudioContext, options?: OscillatorOptions): OscillatorNode;\n};\n\ninterface OverflowEvent extends UIEvent {\n readonly horizontalOverflow: boolean;\n readonly orient: number;\n readonly verticalOverflow: boolean;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n}\n\ndeclare var OverflowEvent: {\n prototype: OverflowEvent;\n new(): OverflowEvent;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n};\n\ninterface PageTransitionEvent extends Event {\n readonly persisted: boolean;\n}\n\ndeclare var PageTransitionEvent: {\n prototype: PageTransitionEvent;\n new(): PageTransitionEvent;\n};\n\ninterface PannerNode extends AudioNode {\n coneInnerAngle: number;\n coneOuterAngle: number;\n coneOuterGain: number;\n distanceModel: DistanceModelType;\n maxDistance: number;\n readonly orientationX: AudioParam;\n readonly orientationY: AudioParam;\n readonly orientationZ: AudioParam;\n panningModel: PanningModelType;\n readonly positionX: AudioParam;\n readonly positionY: AudioParam;\n readonly positionZ: AudioParam;\n refDistance: number;\n rolloffFactor: number;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n}\n\ndeclare var PannerNode: {\n prototype: PannerNode;\n new(context: BaseAudioContext, options?: PannerOptions): PannerNode;\n};\n\ninterface ParentNode {\n readonly childElementCount: number;\n /**\n * Returns the child elements.\n */\n readonly children: HTMLCollection;\n /**\n * Returns the first child that is an element, and null otherwise.\n */\n readonly firstElementChild: Element | null;\n /**\n * Returns the last child that is an element, and null otherwise.\n */\n readonly lastElementChild: Element | null;\n /**\n * Inserts nodes after the last child of node, while replacing\n * strings in nodes with equivalent Text nodes.\n * Throws a \"HierarchyRequestError\" DOMException if the constraints of\n * the node tree are violated.\n */\n append(...nodes: (Node | string)[]): void;\n /**\n * Inserts nodes before the first child of node, while\n * replacing strings in nodes with equivalent Text nodes.\n * Throws a \"HierarchyRequestError\" DOMException if the constraints of\n * the node tree are violated.\n */\n prepend(...nodes: (Node | string)[]): void;\n /**\n * Returns the first element that is a descendant of node that\n * matches selectors.\n */\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n /**\n * Returns all element descendants of node that\n * match selectors.\n */\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface Path2D extends CanvasPath {\n addPath(path: Path2D, transform?: DOMMatrix2DInit): void;\n}\n\ndeclare var Path2D: {\n prototype: Path2D;\n new(path?: Path2D | string): Path2D;\n};\n\ninterface PaymentAddress {\n readonly addressLine: string[];\n readonly city: string;\n readonly country: string;\n readonly dependentLocality: string;\n readonly languageCode: string;\n readonly organization: string;\n readonly phone: string;\n readonly postalCode: string;\n readonly recipient: string;\n readonly region: string;\n readonly sortingCode: string;\n toJSON(): any;\n}\n\ndeclare var PaymentAddress: {\n prototype: PaymentAddress;\n new(): PaymentAddress;\n};\n\ninterface PaymentRequestEventMap {\n \"shippingaddresschange\": Event;\n \"shippingoptionchange\": Event;\n}\n\ninterface PaymentRequest extends EventTarget {\n readonly id: string;\n onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;\n onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n readonly shippingType: PaymentShippingType | null;\n abort(): Promise;\n canMakePayment(): Promise;\n show(): Promise;\n addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var PaymentRequest: {\n prototype: PaymentRequest;\n new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest;\n};\n\ninterface PaymentRequestUpdateEvent extends Event {\n updateWith(detailsPromise: Promise): void;\n}\n\ndeclare var PaymentRequestUpdateEvent: {\n prototype: PaymentRequestUpdateEvent;\n new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\n};\n\ninterface PaymentResponse {\n readonly details: any;\n readonly methodName: string;\n readonly payerEmail: string | null;\n readonly payerName: string | null;\n readonly payerPhone: string | null;\n readonly requestId: string;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n complete(result?: PaymentComplete): Promise;\n toJSON(): any;\n}\n\ndeclare var PaymentResponse: {\n prototype: PaymentResponse;\n new(): PaymentResponse;\n};\n\ninterface PerfWidgetExternal {\n readonly activeNetworkRequestCount: number;\n readonly averageFrameTime: number;\n readonly averagePaintTime: number;\n readonly extraInformationEnabled: boolean;\n readonly independentRenderingEnabled: boolean;\n readonly irDisablingContentString: string;\n readonly irStatusAvailable: boolean;\n readonly maxCpuSpeed: number;\n readonly paintRequestsPerSecond: number;\n readonly performanceCounter: number;\n readonly performanceCounterFrequency: number;\n addEventListener(eventType: string, callback: Function): void;\n getMemoryUsage(): number;\n getProcessCpuUsage(): number;\n getRecentCpuUsage(last: number | null): any;\n getRecentFrames(last: number | null): any;\n getRecentMemoryUsage(last: number | null): any;\n getRecentPaintRequests(last: number | null): any;\n removeEventListener(eventType: string, callback: Function): void;\n repositionWindow(x: number, y: number): void;\n resizeWindow(width: number, height: number): void;\n}\n\ndeclare var PerfWidgetExternal: {\n prototype: PerfWidgetExternal;\n new(): PerfWidgetExternal;\n};\n\ninterface PerformanceEventMap {\n \"resourcetimingbufferfull\": Event;\n}\n\ninterface Performance extends EventTarget {\n /** @deprecated */\n readonly navigation: PerformanceNavigation;\n onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;\n readonly timeOrigin: number;\n /** @deprecated */\n readonly timing: PerformanceTiming;\n clearMarks(markName?: string): void;\n clearMeasures(measureName?: string): void;\n clearResourceTimings(): void;\n getEntries(): PerformanceEntryList;\n getEntriesByName(name: string, type?: string): PerformanceEntryList;\n getEntriesByType(type: string): PerformanceEntryList;\n mark(markName: string): void;\n measure(measureName: string, startMark?: string, endMark?: string): void;\n now(): number;\n setResourceTimingBufferSize(maxSize: number): void;\n toJSON(): any;\n addEventListener(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Performance: {\n prototype: Performance;\n new(): Performance;\n};\n\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceEntry: {\n prototype: PerformanceEntry;\n new(): PerformanceEntry;\n};\n\ninterface PerformanceMark extends PerformanceEntry {\n}\n\ndeclare var PerformanceMark: {\n prototype: PerformanceMark;\n new(): PerformanceMark;\n};\n\ninterface PerformanceMeasure extends PerformanceEntry {\n}\n\ndeclare var PerformanceMeasure: {\n prototype: PerformanceMeasure;\n new(): PerformanceMeasure;\n};\n\ninterface PerformanceNavigation {\n readonly redirectCount: number;\n readonly type: number;\n toJSON(): any;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n}\n\ndeclare var PerformanceNavigation: {\n prototype: PerformanceNavigation;\n new(): PerformanceNavigation;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n};\n\ninterface PerformanceNavigationTiming extends PerformanceResourceTiming {\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly redirectCount: number;\n readonly type: NavigationType;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceNavigationTiming: {\n prototype: PerformanceNavigationTiming;\n new(): PerformanceNavigationTiming;\n};\n\ninterface PerformanceObserver {\n disconnect(): void;\n observe(options: PerformanceObserverInit): void;\n takeRecords(): PerformanceEntryList;\n}\n\ndeclare var PerformanceObserver: {\n prototype: PerformanceObserver;\n new(callback: PerformanceObserverCallback): PerformanceObserver;\n};\n\ninterface PerformanceObserverEntryList {\n getEntries(): PerformanceEntryList;\n getEntriesByName(name: string, type?: string): PerformanceEntryList;\n getEntriesByType(type: string): PerformanceEntryList;\n}\n\ndeclare var PerformanceObserverEntryList: {\n prototype: PerformanceObserverEntryList;\n new(): PerformanceObserverEntryList;\n};\n\ninterface PerformanceResourceTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly decodedBodySize: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly encodedBodySize: number;\n readonly fetchStart: number;\n readonly initiatorType: string;\n readonly nextHopProtocol: string;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly secureConnectionStart: number;\n readonly transferSize: number;\n readonly workerStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceResourceTiming: {\n prototype: PerformanceResourceTiming;\n new(): PerformanceResourceTiming;\n};\n\ninterface PerformanceTiming {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly navigationStart: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly secureConnectionStart: number;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceTiming: {\n prototype: PerformanceTiming;\n new(): PerformanceTiming;\n};\n\ninterface PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(context: BaseAudioContext, options?: PeriodicWaveOptions): PeriodicWave;\n};\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: MSWebViewPermissionState;\n defer(): void;\n}\n\ndeclare var PermissionRequest: {\n prototype: PermissionRequest;\n new(): PermissionRequest;\n};\n\ninterface PermissionRequestedEvent extends Event {\n readonly permissionRequest: PermissionRequest;\n}\n\ndeclare var PermissionRequestedEvent: {\n prototype: PermissionRequestedEvent;\n new(): PermissionRequestedEvent;\n};\n\ninterface Plugin {\n readonly description: string;\n readonly filename: string;\n readonly length: number;\n readonly name: string;\n readonly version: string;\n item(index: number): MimeType;\n namedItem(type: string): MimeType;\n [index: number]: MimeType;\n}\n\ndeclare var Plugin: {\n prototype: Plugin;\n new(): Plugin;\n};\n\ninterface PluginArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(name: string): Plugin;\n refresh(reload?: boolean): void;\n [index: number]: Plugin;\n}\n\ndeclare var PluginArray: {\n prototype: PluginArray;\n new(): PluginArray;\n};\n\ninterface PointerEvent extends MouseEvent {\n readonly height: number;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: string;\n readonly pressure: number;\n readonly tangentialPressure: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly twist: number;\n readonly width: number;\n}\n\ndeclare var PointerEvent: {\n prototype: PointerEvent;\n new(type: string, eventInitDict?: PointerEventInit): PointerEvent;\n};\n\ninterface PopStateEvent extends Event {\n readonly state: any;\n}\n\ndeclare var PopStateEvent: {\n prototype: PopStateEvent;\n new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent;\n};\n\ninterface Position {\n readonly coords: Coordinates;\n readonly timestamp: number;\n}\n\ninterface PositionError {\n readonly code: number;\n readonly message: string;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n}\n\ninterface ProcessingInstruction extends CharacterData {\n readonly target: string;\n}\n\ndeclare var ProcessingInstruction: {\n prototype: ProcessingInstruction;\n new(): ProcessingInstruction;\n};\n\ninterface ProgressEvent extends Event {\n readonly lengthComputable: boolean;\n readonly loaded: number;\n readonly total: number;\n}\n\ndeclare var ProgressEvent: {\n prototype: ProgressEvent;\n new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;\n};\n\ninterface PromiseRejectionEvent extends Event {\n readonly promise: Promise;\n readonly reason: any;\n}\n\ndeclare var PromiseRejectionEvent: {\n prototype: PromiseRejectionEvent;\n new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;\n};\n\ninterface PushManager {\n getSubscription(): Promise;\n permissionState(options?: PushSubscriptionOptionsInit): Promise;\n subscribe(options?: PushSubscriptionOptionsInit): Promise;\n}\n\ndeclare var PushManager: {\n prototype: PushManager;\n new(): PushManager;\n readonly supportedContentEncodings: ReadonlyArray;\n};\n\ninterface PushSubscription {\n readonly endpoint: string;\n readonly expirationTime: number | null;\n readonly options: PushSubscriptionOptions;\n getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\n toJSON(): PushSubscriptionJSON;\n unsubscribe(): Promise;\n}\n\ndeclare var PushSubscription: {\n prototype: PushSubscription;\n new(): PushSubscription;\n};\n\ninterface PushSubscriptionOptions {\n readonly applicationServerKey: ArrayBuffer | null;\n readonly userVisibleOnly: boolean;\n}\n\ndeclare var PushSubscriptionOptions: {\n prototype: PushSubscriptionOptions;\n new(): PushSubscriptionOptions;\n};\n\ninterface RTCCertificate {\n readonly expires: number;\n getFingerprints(): RTCDtlsFingerprint[];\n}\n\ndeclare var RTCCertificate: {\n prototype: RTCCertificate;\n new(): RTCCertificate;\n getSupportedAlgorithms(): AlgorithmIdentifier[];\n};\n\ninterface RTCDTMFSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDTMFSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n ontonechange: ((this: RTCDTMFSender, ev: RTCDTMFToneChangeEvent) => any) | null;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDTMFSender: {\n prototype: RTCDTMFSender;\n new(): RTCDTMFSender;\n};\n\ninterface RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n};\n\ninterface RTCDataChannelEventMap {\n \"bufferedamountlow\": Event;\n \"close\": Event;\n \"error\": RTCErrorEvent;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface RTCDataChannel extends EventTarget {\n binaryType: string;\n readonly bufferedAmount: number;\n bufferedAmountLowThreshold: number;\n readonly id: number | null;\n readonly label: string;\n readonly maxPacketLifeTime: number | null;\n readonly maxRetransmits: number | null;\n readonly negotiated: boolean;\n onbufferedamountlow: ((this: RTCDataChannel, ev: Event) => any) | null;\n onclose: ((this: RTCDataChannel, ev: Event) => any) | null;\n onerror: ((this: RTCDataChannel, ev: RTCErrorEvent) => any) | null;\n onmessage: ((this: RTCDataChannel, ev: MessageEvent) => any) | null;\n onopen: ((this: RTCDataChannel, ev: Event) => any) | null;\n readonly ordered: boolean;\n readonly priority: RTCPriorityType;\n readonly protocol: string;\n readonly readyState: RTCDataChannelState;\n close(): void;\n send(data: string): void;\n send(data: Blob): void;\n send(data: ArrayBuffer): void;\n send(data: ArrayBufferView): void;\n addEventListener(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDataChannel: {\n prototype: RTCDataChannel;\n new(): RTCDataChannel;\n};\n\ninterface RTCDataChannelEvent extends Event {\n readonly channel: RTCDataChannel;\n}\n\ndeclare var RTCDataChannelEvent: {\n prototype: RTCDataChannelEvent;\n new(type: string, eventInitDict: RTCDataChannelEventInit): RTCDataChannelEvent;\n};\n\ninterface RTCDtlsTransportEventMap {\n \"error\": RTCErrorEvent;\n \"statechange\": Event;\n}\n\ninterface RTCDtlsTransport extends EventTarget {\n onerror: ((this: RTCDtlsTransport, ev: RTCErrorEvent) => any) | null;\n onstatechange: ((this: RTCDtlsTransport, ev: Event) => any) | null;\n readonly state: RTCDtlsTransportState;\n readonly transport: RTCIceTransport;\n getRemoteCertificates(): ArrayBuffer[];\n addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(): RTCDtlsTransport;\n};\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: RTCDtlsTransportState;\n}\n\ndeclare var RTCDtlsTransportStateChangedEvent: {\n prototype: RTCDtlsTransportStateChangedEvent;\n new(): RTCDtlsTransportStateChangedEvent;\n};\n\ninterface RTCDtmfSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtmfSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n readonly duration: number;\n readonly interToneGap: number;\n ontonechange: ((this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any) | null;\n readonly sender: RTCRtpSender;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\n};\n\ninterface RTCError extends Error {\n errorDetail: string;\n httpRequestStatusCode: number;\n message: string;\n name: string;\n receivedAlert: number | null;\n sctpCauseCode: number;\n sdpLineNumber: number;\n sentAlert: number | null;\n}\n\ndeclare var RTCError: {\n prototype: RTCError;\n new(errorDetail?: string, message?: string): RTCError;\n};\n\ninterface RTCErrorEvent extends Event {\n readonly error: RTCError | null;\n}\n\ndeclare var RTCErrorEvent: {\n prototype: RTCErrorEvent;\n new(type: string, eventInitDict: RTCErrorEventInit): RTCErrorEvent;\n};\n\ninterface RTCIceCandidate {\n readonly candidate: string;\n readonly component: RTCIceComponent | null;\n readonly foundation: string | null;\n readonly ip: string | null;\n readonly port: number | null;\n readonly priority: number | null;\n readonly protocol: RTCIceProtocol | null;\n readonly relatedAddress: string | null;\n readonly relatedPort: number | null;\n readonly sdpMLineIndex: number | null;\n readonly sdpMid: string | null;\n readonly tcpType: RTCIceTcpCandidateType | null;\n readonly type: RTCIceCandidateType | null;\n readonly usernameFragment: string | null;\n toJSON(): RTCIceCandidateInit;\n}\n\ndeclare var RTCIceCandidate: {\n prototype: RTCIceCandidate;\n new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\n};\n\ninterface RTCIceCandidatePairChangedEvent extends Event {\n readonly pair: RTCIceCandidatePair;\n}\n\ndeclare var RTCIceCandidatePairChangedEvent: {\n prototype: RTCIceCandidatePairChangedEvent;\n new(): RTCIceCandidatePairChangedEvent;\n};\n\ninterface RTCIceGathererEventMap {\n \"error\": Event;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidateDictionary[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n};\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\n}\n\ndeclare var RTCIceGathererEvent: {\n prototype: RTCIceGathererEvent;\n new(): RTCIceGathererEvent;\n};\n\ninterface RTCIceTransportEventMap {\n \"gatheringstatechange\": Event;\n \"selectedcandidatepairchange\": Event;\n \"statechange\": Event;\n}\n\ninterface RTCIceTransport extends EventTarget {\n readonly component: RTCIceComponent;\n readonly gatheringState: RTCIceGathererState;\n ongatheringstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;\n onselectedcandidatepairchange: ((this: RTCIceTransport, ev: Event) => any) | null;\n onstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;\n readonly role: RTCIceRole;\n readonly state: RTCIceTransportState;\n getLocalCandidates(): RTCIceCandidate[];\n getLocalParameters(): RTCIceParameters | null;\n getRemoteCandidates(): RTCIceCandidate[];\n getRemoteParameters(): RTCIceParameters | null;\n getSelectedCandidatePair(): RTCIceCandidatePair | null;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n};\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: RTCIceTransportState;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n};\n\ninterface RTCIdentityAssertion {\n idp: string;\n name: string;\n}\n\ndeclare var RTCIdentityAssertion: {\n prototype: RTCIdentityAssertion;\n new(idp: string, name: string): RTCIdentityAssertion;\n};\n\ninterface RTCPeerConnectionEventMap {\n \"connectionstatechange\": Event;\n \"datachannel\": RTCDataChannelEvent;\n \"icecandidate\": RTCPeerConnectionIceEvent;\n \"icecandidateerror\": RTCPeerConnectionIceErrorEvent;\n \"iceconnectionstatechange\": Event;\n \"icegatheringstatechange\": Event;\n \"negotiationneeded\": Event;\n \"signalingstatechange\": Event;\n \"statsended\": RTCStatsEvent;\n \"track\": RTCTrackEvent;\n}\n\ninterface RTCPeerConnection extends EventTarget {\n readonly canTrickleIceCandidates: boolean | null;\n readonly connectionState: RTCPeerConnectionState;\n readonly currentLocalDescription: RTCSessionDescription | null;\n readonly currentRemoteDescription: RTCSessionDescription | null;\n readonly iceConnectionState: RTCIceConnectionState;\n readonly iceGatheringState: RTCIceGatheringState;\n readonly idpErrorInfo: string | null;\n readonly idpLoginUrl: string | null;\n readonly localDescription: RTCSessionDescription | null;\n onconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n ondatachannel: ((this: RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null;\n onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;\n onicecandidateerror: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceErrorEvent) => any) | null;\n oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onstatsended: ((this: RTCPeerConnection, ev: RTCStatsEvent) => any) | null;\n ontrack: ((this: RTCPeerConnection, ev: RTCTrackEvent) => any) | null;\n readonly peerIdentity: Promise;\n readonly pendingLocalDescription: RTCSessionDescription | null;\n readonly pendingRemoteDescription: RTCSessionDescription | null;\n readonly remoteDescription: RTCSessionDescription | null;\n readonly sctp: RTCSctpTransport | null;\n readonly signalingState: RTCSignalingState;\n addIceCandidate(candidate: RTCIceCandidateInit | RTCIceCandidate): Promise;\n addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender;\n addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver;\n close(): void;\n createAnswer(options?: RTCOfferOptions): Promise;\n createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel;\n createOffer(options?: RTCOfferOptions): Promise;\n getConfiguration(): RTCConfiguration;\n getIdentityAssertion(): Promise;\n getReceivers(): RTCRtpReceiver[];\n getSenders(): RTCRtpSender[];\n getStats(selector?: MediaStreamTrack | null): Promise;\n getTransceivers(): RTCRtpTransceiver[];\n removeTrack(sender: RTCRtpSender): void;\n setConfiguration(configuration: RTCConfiguration): void;\n setIdentityProvider(provider: string, options?: RTCIdentityProviderOptions): void;\n setLocalDescription(description: RTCSessionDescriptionInit): Promise;\n setRemoteDescription(description: RTCSessionDescriptionInit): Promise;\n addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCPeerConnection: {\n prototype: RTCPeerConnection;\n new(configuration?: RTCConfiguration): RTCPeerConnection;\n generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise;\n getDefaultIceServers(): RTCIceServer[];\n};\n\ninterface RTCPeerConnectionIceErrorEvent extends Event {\n readonly errorCode: number;\n readonly errorText: string;\n readonly hostCandidate: string;\n readonly url: string;\n}\n\ndeclare var RTCPeerConnectionIceErrorEvent: {\n prototype: RTCPeerConnectionIceErrorEvent;\n new(type: string, eventInitDict: RTCPeerConnectionIceErrorEventInit): RTCPeerConnectionIceErrorEvent;\n};\n\ninterface RTCPeerConnectionIceEvent extends Event {\n readonly candidate: RTCIceCandidate | null;\n readonly url: string | null;\n}\n\ndeclare var RTCPeerConnectionIceEvent: {\n prototype: RTCPeerConnectionIceEvent;\n new(type: string, eventInitDict?: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\n};\n\ninterface RTCRtpReceiver {\n readonly rtcpTransport: RTCDtlsTransport | null;\n readonly track: MediaStreamTrack;\n readonly transport: RTCDtlsTransport | null;\n getContributingSources(): RTCRtpContributingSource[];\n getParameters(): RTCRtpReceiveParameters;\n getStats(): Promise;\n getSynchronizationSources(): RTCRtpSynchronizationSource[];\n}\n\ndeclare var RTCRtpReceiver: {\n prototype: RTCRtpReceiver;\n new(): RTCRtpReceiver;\n getCapabilities(kind: string): RTCRtpCapabilities | null;\n};\n\ninterface RTCRtpSender {\n readonly dtmf: RTCDTMFSender | null;\n readonly rtcpTransport: RTCDtlsTransport | null;\n readonly track: MediaStreamTrack | null;\n readonly transport: RTCDtlsTransport | null;\n getParameters(): RTCRtpSendParameters;\n getStats(): Promise;\n replaceTrack(withTrack: MediaStreamTrack | null): Promise;\n setParameters(parameters: RTCRtpSendParameters): Promise;\n setStreams(...streams: MediaStream[]): void;\n}\n\ndeclare var RTCRtpSender: {\n prototype: RTCRtpSender;\n new(): RTCRtpSender;\n getCapabilities(kind: string): RTCRtpCapabilities | null;\n};\n\ninterface RTCRtpTransceiver {\n readonly currentDirection: RTCRtpTransceiverDirection | null;\n direction: RTCRtpTransceiverDirection;\n readonly mid: string | null;\n readonly receiver: RTCRtpReceiver;\n readonly sender: RTCRtpSender;\n readonly stopped: boolean;\n setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;\n stop(): void;\n}\n\ndeclare var RTCRtpTransceiver: {\n prototype: RTCRtpTransceiver;\n new(): RTCRtpTransceiver;\n};\n\ninterface RTCSctpTransportEventMap {\n \"statechange\": Event;\n}\n\ninterface RTCSctpTransport {\n readonly maxChannels: number | null;\n readonly maxMessageSize: number;\n onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null;\n readonly state: RTCSctpTransportState;\n readonly transport: RTCDtlsTransport;\n addEventListener(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSctpTransport: {\n prototype: RTCSctpTransport;\n new(): RTCSctpTransport;\n};\n\ninterface RTCSessionDescription {\n readonly sdp: string;\n readonly type: RTCSdpType;\n toJSON(): any;\n}\n\ndeclare var RTCSessionDescription: {\n prototype: RTCSessionDescription;\n new(descriptionInitDict: RTCSessionDescriptionInit): RTCSessionDescription;\n};\n\ninterface RTCSrtpSdesTransportEventMap {\n \"error\": Event;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSrtpSdesTransport: {\n prototype: RTCSrtpSdesTransport;\n new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\n getLocalParameters(): RTCSrtpSdesParameters[];\n};\n\ninterface RTCSsrcConflictEvent extends Event {\n readonly ssrc: number;\n}\n\ndeclare var RTCSsrcConflictEvent: {\n prototype: RTCSsrcConflictEvent;\n new(): RTCSsrcConflictEvent;\n};\n\ninterface RTCStatsEvent extends Event {\n readonly report: RTCStatsReport;\n}\n\ndeclare var RTCStatsEvent: {\n prototype: RTCStatsEvent;\n new(type: string, eventInitDict: RTCStatsEventInit): RTCStatsEvent;\n};\n\ninterface RTCStatsProvider extends EventTarget {\n getStats(): Promise;\n msGetStats(): Promise;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\n};\n\ninterface RTCStatsReport {\n forEach(callbackfn: (value: any, key: string, parent: RTCStatsReport) => void, thisArg?: any): void;\n}\n\ndeclare var RTCStatsReport: {\n prototype: RTCStatsReport;\n new(): RTCStatsReport;\n};\n\ninterface RTCTrackEvent extends Event {\n readonly receiver: RTCRtpReceiver;\n readonly streams: ReadonlyArray;\n readonly track: MediaStreamTrack;\n readonly transceiver: RTCRtpTransceiver;\n}\n\ndeclare var RTCTrackEvent: {\n prototype: RTCTrackEvent;\n new(type: string, eventInitDict: RTCTrackEventInit): RTCTrackEvent;\n};\n\ninterface RadioNodeList extends NodeList {\n value: string;\n}\n\ndeclare var RadioNodeList: {\n prototype: RadioNodeList;\n new(): RadioNodeList;\n};\n\ninterface RandomSource {\n getRandomValues(array: T): T;\n}\n\ndeclare var RandomSource: {\n prototype: RandomSource;\n new(): RandomSource;\n};\n\ninterface Range extends AbstractRange {\n /**\n * Returns the node, furthest away from\n * the document, that is an ancestor of both range's start node and end node.\n */\n readonly commonAncestorContainer: Node;\n cloneContents(): DocumentFragment;\n cloneRange(): Range;\n collapse(toStart?: boolean): void;\n compareBoundaryPoints(how: number, sourceRange: Range): number;\n /**\n * Returns −1 if the point is before the range, 0 if the point is\n * in the range, and 1 if the point is after the range.\n */\n comparePoint(node: Node, offset: number): number;\n createContextualFragment(fragment: string): DocumentFragment;\n deleteContents(): void;\n detach(): void;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n insertNode(node: Node): void;\n /**\n * Returns whether range intersects node.\n */\n intersectsNode(node: Node): boolean;\n isPointInRange(node: Node, offset: number): boolean;\n selectNode(node: Node): void;\n selectNodeContents(node: Node): void;\n setEnd(node: Node, offset: number): void;\n setEndAfter(node: Node): void;\n setEndBefore(node: Node): void;\n setStart(node: Node, offset: number): void;\n setStartAfter(node: Node): void;\n setStartBefore(node: Node): void;\n surroundContents(newParent: Node): void;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n}\n\ndeclare var Range: {\n prototype: Range;\n new(): Range;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n};\n\ninterface ReadableByteStreamController {\n readonly byobRequest: ReadableStreamBYOBRequest | undefined;\n readonly desiredSize: number | null;\n close(): void;\n enqueue(chunk: ArrayBufferView): void;\n error(error?: any): void;\n}\n\ninterface ReadableStream {\n readonly locked: boolean;\n cancel(reason?: any): Promise;\n getReader(options: { mode: \"byob\" }): ReadableStreamBYOBReader;\n getReader(): ReadableStreamDefaultReader;\n pipeThrough({ writable, readable }: { writable: WritableStream, readable: ReadableStream }, options?: PipeOptions): ReadableStream;\n pipeTo(dest: WritableStream, options?: PipeOptions): Promise;\n tee(): [ReadableStream, ReadableStream];\n}\n\ndeclare var ReadableStream: {\n prototype: ReadableStream;\n new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number, size?: undefined }): ReadableStream;\n new(underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream;\n};\n\ninterface ReadableStreamBYOBReader {\n readonly closed: Promise;\n cancel(reason?: any): Promise;\n read(view: T): Promise>;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamBYOBReader: {\n prototype: ReadableStreamBYOBReader;\n new(stream: ReadableStream): ReadableStreamBYOBReader;\n};\n\ninterface ReadableStreamBYOBRequest {\n readonly view: ArrayBufferView;\n respond(bytesWritten: number): void;\n respondWithNewView(view: ArrayBufferView): void;\n}\n\ninterface ReadableStreamDefaultController {\n readonly desiredSize: number | null;\n close(): void;\n enqueue(chunk: R): void;\n error(error?: any): void;\n}\n\ninterface ReadableStreamDefaultReader {\n readonly closed: Promise;\n cancel(reason?: any): Promise;\n read(): Promise>;\n releaseLock(): void;\n}\n\ninterface ReadableStreamReadResult {\n done: boolean;\n value: T;\n}\n\ninterface ReadableStreamReader {\n cancel(): Promise;\n read(): Promise>;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamReader: {\n prototype: ReadableStreamReader;\n new(): ReadableStreamReader;\n};\n\ninterface Request extends Body {\n /**\n * Returns the cache mode associated with request, which is a string indicating\n * how the request will interact with the browser's cache when fetching.\n */\n readonly cache: RequestCache;\n /**\n * Returns the credentials mode associated with request, which is a string\n * indicating whether credentials will be sent with the request always, never, or only when sent to a\n * same-origin URL.\n */\n readonly credentials: RequestCredentials;\n /**\n * Returns the kind of resource requested by request, e.g., \"document\" or\n * \"script\".\n */\n readonly destination: RequestDestination;\n /**\n * Returns a Headers object consisting of the headers associated with request.\n * Note that headers added in the network layer by the user agent will not be accounted for in this\n * object, e.g., the \"Host\" header.\n */\n readonly headers: Headers;\n /**\n * Returns request's subresource integrity metadata, which is a cryptographic hash of\n * the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\n */\n readonly integrity: string;\n /**\n * Returns a boolean indicating whether or not request is for a history\n * navigation (a.k.a. back-foward navigation).\n */\n readonly isHistoryNavigation: boolean;\n /**\n * Returns a boolean indicating whether or not request is for a reload navigation.\n */\n readonly isReloadNavigation: boolean;\n /**\n * Returns a boolean indicating whether or not request can outlive the global in which\n * it was created.\n */\n readonly keepalive: boolean;\n /**\n * Returns request's HTTP method, which is \"GET\" by default.\n */\n readonly method: string;\n /**\n * Returns the mode associated with request, which is a string indicating\n * whether the request will use CORS, or will be restricted to same-origin URLs.\n */\n readonly mode: RequestMode;\n /**\n * Returns the redirect mode associated with request, which is a string\n * indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\n */\n readonly redirect: RequestRedirect;\n /**\n * Returns the referrer of request. Its value can be a same-origin URL if\n * explicitly set in init, the empty string to indicate no referrer, and\n * \"about:client\" when defaulting to the global's default. This is used during\n * fetching to determine the value of the `Referer` header of the request being made.\n */\n readonly referrer: string;\n /**\n * Returns the referrer policy associated with request. This is used during\n * fetching to compute the value of the request's referrer.\n */\n readonly referrerPolicy: ReferrerPolicy;\n /**\n * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort\n * event handler.\n */\n readonly signal: AbortSignal;\n /**\n * Returns the URL of request as a string.\n */\n readonly url: string;\n clone(): Request;\n}\n\ndeclare var Request: {\n prototype: Request;\n new(input: RequestInfo, init?: RequestInit): Request;\n};\n\ninterface Response extends Body {\n readonly headers: Headers;\n readonly ok: boolean;\n readonly redirected: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly trailer: Promise;\n readonly type: ResponseType;\n readonly url: string;\n clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: BodyInit | null, init?: ResponseInit): Response;\n error(): Response;\n redirect(url: string, status?: number): Response;\n};\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAElement: {\n prototype: SVGAElement;\n new(): SVGAElement;\n};\n\ninterface SVGAngle {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n}\n\ndeclare var SVGAngle: {\n prototype: SVGAngle;\n new(): SVGAngle;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n};\n\ninterface SVGAnimateElement extends SVGAnimationElement {\n addEventListener(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAnimateElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAnimateElement: {\n prototype: SVGAnimateElement;\n new(): SVGAnimateElement;\n};\n\ninterface SVGAnimateMotionElement extends SVGAnimationElement {\n addEventListener(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAnimateMotionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAnimateMotionElement: {\n prototype: SVGAnimateMotionElement;\n new(): SVGAnimateMotionElement;\n};\n\ninterface SVGAnimateTransformElement extends SVGAnimationElement {\n addEventListener(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAnimateTransformElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAnimateTransformElement: {\n prototype: SVGAnimateTransformElement;\n new(): SVGAnimateTransformElement;\n};\n\ninterface SVGAnimatedAngle {\n readonly animVal: SVGAngle;\n readonly baseVal: SVGAngle;\n}\n\ndeclare var SVGAnimatedAngle: {\n prototype: SVGAnimatedAngle;\n new(): SVGAnimatedAngle;\n};\n\ninterface SVGAnimatedBoolean {\n readonly animVal: boolean;\n baseVal: boolean;\n}\n\ndeclare var SVGAnimatedBoolean: {\n prototype: SVGAnimatedBoolean;\n new(): SVGAnimatedBoolean;\n};\n\ninterface SVGAnimatedEnumeration {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedEnumeration: {\n prototype: SVGAnimatedEnumeration;\n new(): SVGAnimatedEnumeration;\n};\n\ninterface SVGAnimatedInteger {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedInteger: {\n prototype: SVGAnimatedInteger;\n new(): SVGAnimatedInteger;\n};\n\ninterface SVGAnimatedLength {\n readonly animVal: SVGLength;\n readonly baseVal: SVGLength;\n}\n\ndeclare var SVGAnimatedLength: {\n prototype: SVGAnimatedLength;\n new(): SVGAnimatedLength;\n};\n\ninterface SVGAnimatedLengthList {\n readonly animVal: SVGLengthList;\n readonly baseVal: SVGLengthList;\n}\n\ndeclare var SVGAnimatedLengthList: {\n prototype: SVGAnimatedLengthList;\n new(): SVGAnimatedLengthList;\n};\n\ninterface SVGAnimatedNumber {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedNumber: {\n prototype: SVGAnimatedNumber;\n new(): SVGAnimatedNumber;\n};\n\ninterface SVGAnimatedNumberList {\n readonly animVal: SVGNumberList;\n readonly baseVal: SVGNumberList;\n}\n\ndeclare var SVGAnimatedNumberList: {\n prototype: SVGAnimatedNumberList;\n new(): SVGAnimatedNumberList;\n};\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGAnimatedPreserveAspectRatio {\n readonly animVal: SVGPreserveAspectRatio;\n readonly baseVal: SVGPreserveAspectRatio;\n}\n\ndeclare var SVGAnimatedPreserveAspectRatio: {\n prototype: SVGAnimatedPreserveAspectRatio;\n new(): SVGAnimatedPreserveAspectRatio;\n};\n\ninterface SVGAnimatedRect {\n readonly animVal: DOMRectReadOnly;\n readonly baseVal: DOMRect;\n}\n\ndeclare var SVGAnimatedRect: {\n prototype: SVGAnimatedRect;\n new(): SVGAnimatedRect;\n};\n\ninterface SVGAnimatedString {\n readonly animVal: string;\n baseVal: string;\n}\n\ndeclare var SVGAnimatedString: {\n prototype: SVGAnimatedString;\n new(): SVGAnimatedString;\n};\n\ninterface SVGAnimatedTransformList {\n readonly animVal: SVGTransformList;\n readonly baseVal: SVGTransformList;\n}\n\ndeclare var SVGAnimatedTransformList: {\n prototype: SVGAnimatedTransformList;\n new(): SVGAnimatedTransformList;\n};\n\ninterface SVGAnimationElement extends SVGElement {\n readonly targetElement: SVGElement;\n getCurrentTime(): number;\n getSimpleDuration(): number;\n getStartTime(): number;\n addEventListener(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAnimationElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAnimationElement: {\n prototype: SVGAnimationElement;\n new(): SVGAnimationElement;\n};\n\ninterface SVGCircleElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n};\n\ninterface SVGClipPathElement extends SVGGraphicsElement {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGClipPathElement: {\n prototype: SVGClipPathElement;\n new(): SVGClipPathElement;\n};\n\ninterface SVGComponentTransferFunctionElement extends SVGElement {\n readonly amplitude: SVGAnimatedNumber;\n readonly exponent: SVGAnimatedNumber;\n readonly intercept: SVGAnimatedNumber;\n readonly offset: SVGAnimatedNumber;\n readonly slope: SVGAnimatedNumber;\n readonly tableValues: SVGAnimatedNumberList;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGComponentTransferFunctionElement: {\n prototype: SVGComponentTransferFunctionElement;\n new(): SVGComponentTransferFunctionElement;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n};\n\ninterface SVGCursorElement extends SVGElement {\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCursorElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCursorElement: {\n prototype: SVGCursorElement;\n new(): SVGCursorElement;\n};\n\ninterface SVGDefsElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n};\n\ninterface SVGDescElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDescElement: {\n prototype: SVGDescElement;\n new(): SVGDescElement;\n};\n\ninterface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap {\n}\n\ninterface SVGElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle {\n /** @deprecated */\n readonly className: any;\n readonly ownerSVGElement: SVGSVGElement | null;\n readonly viewportElement: SVGElement | null;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGElement: {\n prototype: SVGElement;\n new(): SVGElement;\n};\n\ninterface SVGElementInstance extends EventTarget {\n readonly correspondingElement: SVGElement;\n readonly correspondingUseElement: SVGUseElement;\n}\n\ndeclare var SVGElementInstance: {\n prototype: SVGElementInstance;\n new(): SVGElementInstance;\n};\n\ninterface SVGElementInstanceList {\n /** @deprecated */\n readonly length: number;\n /** @deprecated */\n item(index: number): SVGElementInstance;\n}\n\ndeclare var SVGElementInstanceList: {\n prototype: SVGElementInstanceList;\n new(): SVGElementInstanceList;\n};\n\ninterface SVGEllipseElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGEllipseElement: {\n prototype: SVGEllipseElement;\n new(): SVGEllipseElement;\n};\n\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly mode: SVGAnimatedEnumeration;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEBlendElement: {\n prototype: SVGFEBlendElement;\n new(): SVGFEBlendElement;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n};\n\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly type: SVGAnimatedEnumeration;\n readonly values: SVGAnimatedNumberList;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEColorMatrixElement: {\n prototype: SVGFEColorMatrixElement;\n new(): SVGFEColorMatrixElement;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEComponentTransferElement: {\n prototype: SVGFEComponentTransferElement;\n new(): SVGFEComponentTransferElement;\n};\n\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly k1: SVGAnimatedNumber;\n readonly k2: SVGAnimatedNumber;\n readonly k3: SVGAnimatedNumber;\n readonly k4: SVGAnimatedNumber;\n readonly operator: SVGAnimatedEnumeration;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFECompositeElement: {\n prototype: SVGFECompositeElement;\n new(): SVGFECompositeElement;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n};\n\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly bias: SVGAnimatedNumber;\n readonly divisor: SVGAnimatedNumber;\n readonly edgeMode: SVGAnimatedEnumeration;\n readonly in1: SVGAnimatedString;\n readonly kernelMatrix: SVGAnimatedNumberList;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly orderX: SVGAnimatedInteger;\n readonly orderY: SVGAnimatedInteger;\n readonly preserveAlpha: SVGAnimatedBoolean;\n readonly targetX: SVGAnimatedInteger;\n readonly targetY: SVGAnimatedInteger;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEConvolveMatrixElement: {\n prototype: SVGFEConvolveMatrixElement;\n new(): SVGFEConvolveMatrixElement;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n};\n\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly diffuseConstant: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDiffuseLightingElement: {\n prototype: SVGFEDiffuseLightingElement;\n new(): SVGFEDiffuseLightingElement;\n};\n\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly scale: SVGAnimatedNumber;\n readonly xChannelSelector: SVGAnimatedEnumeration;\n readonly yChannelSelector: SVGAnimatedEnumeration;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDisplacementMapElement: {\n prototype: SVGFEDisplacementMapElement;\n new(): SVGFEDisplacementMapElement;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n};\n\ninterface SVGFEDistantLightElement extends SVGElement {\n readonly azimuth: SVGAnimatedNumber;\n readonly elevation: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDistantLightElement: {\n prototype: SVGFEDistantLightElement;\n new(): SVGFEDistantLightElement;\n};\n\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n};\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n};\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n};\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n};\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncRElement: {\n prototype: SVGFEFuncRElement;\n new(): SVGFEFuncRElement;\n};\n\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly stdDeviationX: SVGAnimatedNumber;\n readonly stdDeviationY: SVGAnimatedNumber;\n setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\n addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n};\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEImageElement: {\n prototype: SVGFEImageElement;\n new(): SVGFEImageElement;\n};\n\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeElement: {\n prototype: SVGFEMergeElement;\n new(): SVGFEMergeElement;\n};\n\ninterface SVGFEMergeNodeElement extends SVGElement {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeNodeElement: {\n prototype: SVGFEMergeNodeElement;\n new(): SVGFEMergeNodeElement;\n};\n\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly operator: SVGAnimatedEnumeration;\n readonly radiusX: SVGAnimatedNumber;\n readonly radiusY: SVGAnimatedNumber;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMorphologyElement: {\n prototype: SVGFEMorphologyElement;\n new(): SVGFEMorphologyElement;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n};\n\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly dx: SVGAnimatedNumber;\n readonly dy: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEOffsetElement: {\n prototype: SVGFEOffsetElement;\n new(): SVGFEOffsetElement;\n};\n\ninterface SVGFEPointLightElement extends SVGElement {\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEPointLightElement: {\n prototype: SVGFEPointLightElement;\n new(): SVGFEPointLightElement;\n};\n\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly specularConstant: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpecularLightingElement: {\n prototype: SVGFESpecularLightingElement;\n new(): SVGFESpecularLightingElement;\n};\n\ninterface SVGFESpotLightElement extends SVGElement {\n readonly limitingConeAngle: SVGAnimatedNumber;\n readonly pointsAtX: SVGAnimatedNumber;\n readonly pointsAtY: SVGAnimatedNumber;\n readonly pointsAtZ: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpotLightElement: {\n prototype: SVGFESpotLightElement;\n new(): SVGFESpotLightElement;\n};\n\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETileElement: {\n prototype: SVGFETileElement;\n new(): SVGFETileElement;\n};\n\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly baseFrequencyX: SVGAnimatedNumber;\n readonly baseFrequencyY: SVGAnimatedNumber;\n readonly numOctaves: SVGAnimatedInteger;\n readonly seed: SVGAnimatedNumber;\n readonly stitchTiles: SVGAnimatedEnumeration;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETurbulenceElement: {\n prototype: SVGFETurbulenceElement;\n new(): SVGFETurbulenceElement;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFilterElement extends SVGElement, SVGURIReference {\n /** @deprecated */\n readonly filterResX: SVGAnimatedInteger;\n /** @deprecated */\n readonly filterResY: SVGAnimatedInteger;\n readonly filterUnits: SVGAnimatedEnumeration;\n readonly height: SVGAnimatedLength;\n readonly primitiveUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n /** @deprecated */\n setFilterRes(filterResX: number, filterResY: number): void;\n addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n};\n\ninterface SVGFilterPrimitiveStandardAttributes {\n readonly height: SVGAnimatedLength;\n readonly result: SVGAnimatedString;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n}\n\ninterface SVGFitToViewBox {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly viewBox: SVGAnimatedRect;\n}\n\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n};\n\ninterface SVGGElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n};\n\ninterface SVGGeometryElement extends SVGGraphicsElement {\n readonly pathLength: SVGAnimatedNumber;\n getPointAtLength(distance: number): DOMPoint;\n getTotalLength(): number;\n isPointInFill(point?: DOMPointInit): boolean;\n isPointInStroke(point?: DOMPointInit): boolean;\n addEventListener(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGeometryElement: {\n prototype: SVGGeometryElement;\n new(): SVGGeometryElement;\n};\n\ninterface SVGGradientElement extends SVGElement, SVGURIReference {\n readonly gradientTransform: SVGAnimatedTransformList;\n readonly gradientUnits: SVGAnimatedEnumeration;\n readonly spreadMethod: SVGAnimatedEnumeration;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGradientElement: {\n prototype: SVGGradientElement;\n new(): SVGGradientElement;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n};\n\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\n readonly transform: SVGAnimatedTransformList;\n getBBox(options?: SVGBoundingBoxOptions): DOMRect;\n getCTM(): DOMMatrix | null;\n getScreenCTM(): DOMMatrix | null;\n addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGraphicsElement: {\n prototype: SVGGraphicsElement;\n new(): SVGGraphicsElement;\n};\n\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGImageElement: {\n prototype: SVGImageElement;\n new(): SVGImageElement;\n};\n\ninterface SVGLength {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n}\n\ndeclare var SVGLength: {\n prototype: SVGLength;\n new(): SVGLength;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n};\n\ninterface SVGLengthList {\n readonly length: number;\n readonly numberOfItems: number;\n appendItem(newItem: SVGLength): SVGLength;\n clear(): void;\n getItem(index: number): SVGLength;\n initialize(newItem: SVGLength): SVGLength;\n insertItemBefore(newItem: SVGLength, index: number): SVGLength;\n removeItem(index: number): SVGLength;\n replaceItem(newItem: SVGLength, index: number): SVGLength;\n [index: number]: SVGLength;\n}\n\ndeclare var SVGLengthList: {\n prototype: SVGLengthList;\n new(): SVGLengthList;\n};\n\ninterface SVGLineElement extends SVGGraphicsElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLineElement: {\n prototype: SVGLineElement;\n new(): SVGLineElement;\n};\n\ninterface SVGLinearGradientElement extends SVGGradientElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n};\n\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\n readonly markerHeight: SVGAnimatedLength;\n readonly markerUnits: SVGAnimatedEnumeration;\n readonly markerWidth: SVGAnimatedLength;\n readonly orientAngle: SVGAnimatedAngle;\n readonly orientType: SVGAnimatedEnumeration;\n readonly refX: SVGAnimatedLength;\n readonly refY: SVGAnimatedLength;\n setOrientToAngle(angle: SVGAngle): void;\n setOrientToAuto(): void;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMarkerElement: {\n prototype: SVGMarkerElement;\n new(): SVGMarkerElement;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n};\n\ninterface SVGMaskElement extends SVGElement, SVGTests {\n readonly height: SVGAnimatedLength;\n readonly maskContentUnits: SVGAnimatedEnumeration;\n readonly maskUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMaskElement: {\n prototype: SVGMaskElement;\n new(): SVGMaskElement;\n};\n\ninterface SVGMetadataElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMetadataElement: {\n prototype: SVGMetadataElement;\n new(): SVGMetadataElement;\n};\n\ninterface SVGNumber {\n value: number;\n}\n\ndeclare var SVGNumber: {\n prototype: SVGNumber;\n new(): SVGNumber;\n};\n\ninterface SVGNumberList {\n readonly length: number;\n readonly numberOfItems: number;\n appendItem(newItem: SVGNumber): SVGNumber;\n clear(): void;\n getItem(index: number): SVGNumber;\n initialize(newItem: SVGNumber): SVGNumber;\n insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\n removeItem(index: number): SVGNumber;\n replaceItem(newItem: SVGNumber, index: number): SVGNumber;\n [index: number]: SVGNumber;\n}\n\ndeclare var SVGNumberList: {\n prototype: SVGNumberList;\n new(): SVGNumberList;\n};\n\ninterface SVGPathElement extends SVGGraphicsElement {\n /** @deprecated */\n readonly pathSegList: SVGPathSegList;\n /** @deprecated */\n createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\n /** @deprecated */\n createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\n /** @deprecated */\n createSVGPathSegClosePath(): SVGPathSegClosePath;\n /** @deprecated */\n createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\n /** @deprecated */\n createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\n /** @deprecated */\n createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\n /** @deprecated */\n createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\n /** @deprecated */\n createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\n /** @deprecated */\n createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\n /** @deprecated */\n createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\n /** @deprecated */\n getPathSegAtLength(distance: number): number;\n getPointAtLength(distance: number): SVGPoint;\n getTotalLength(): number;\n addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPathElement: {\n prototype: SVGPathElement;\n new(): SVGPathElement;\n};\n\ninterface SVGPathSeg {\n readonly pathSegType: number;\n readonly pathSegTypeAsLetter: string;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n}\n\ndeclare var SVGPathSeg: {\n prototype: SVGPathSeg;\n new(): SVGPathSeg;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n};\n\ninterface SVGPathSegArcAbs extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcAbs: {\n prototype: SVGPathSegArcAbs;\n new(): SVGPathSegArcAbs;\n};\n\ninterface SVGPathSegArcRel extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcRel: {\n prototype: SVGPathSegArcRel;\n new(): SVGPathSegArcRel;\n};\n\ninterface SVGPathSegClosePath extends SVGPathSeg {\n}\n\ndeclare var SVGPathSegClosePath: {\n prototype: SVGPathSegClosePath;\n new(): SVGPathSegClosePath;\n};\n\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicAbs: {\n prototype: SVGPathSegCurvetoCubicAbs;\n new(): SVGPathSegCurvetoCubicAbs;\n};\n\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicRel: {\n prototype: SVGPathSegCurvetoCubicRel;\n new(): SVGPathSegCurvetoCubicRel;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\n prototype: SVGPathSegCurvetoCubicSmoothAbs;\n new(): SVGPathSegCurvetoCubicSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\n prototype: SVGPathSegCurvetoCubicSmoothRel;\n new(): SVGPathSegCurvetoCubicSmoothRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\n prototype: SVGPathSegCurvetoQuadraticAbs;\n new(): SVGPathSegCurvetoQuadraticAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticRel: {\n prototype: SVGPathSegCurvetoQuadraticRel;\n new(): SVGPathSegCurvetoQuadraticRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\n prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\n new(): SVGPathSegCurvetoQuadraticSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\n prototype: SVGPathSegCurvetoQuadraticSmoothRel;\n new(): SVGPathSegCurvetoQuadraticSmoothRel;\n};\n\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoAbs: {\n prototype: SVGPathSegLinetoAbs;\n new(): SVGPathSegLinetoAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalAbs: {\n prototype: SVGPathSegLinetoHorizontalAbs;\n new(): SVGPathSegLinetoHorizontalAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalRel: {\n prototype: SVGPathSegLinetoHorizontalRel;\n new(): SVGPathSegLinetoHorizontalRel;\n};\n\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoRel: {\n prototype: SVGPathSegLinetoRel;\n new(): SVGPathSegLinetoRel;\n};\n\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalAbs: {\n prototype: SVGPathSegLinetoVerticalAbs;\n new(): SVGPathSegLinetoVerticalAbs;\n};\n\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalRel: {\n prototype: SVGPathSegLinetoVerticalRel;\n new(): SVGPathSegLinetoVerticalRel;\n};\n\ninterface SVGPathSegList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPathSeg): SVGPathSeg;\n clear(): void;\n getItem(index: number): SVGPathSeg;\n initialize(newItem: SVGPathSeg): SVGPathSeg;\n insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\n removeItem(index: number): SVGPathSeg;\n replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\n}\n\ndeclare var SVGPathSegList: {\n prototype: SVGPathSegList;\n new(): SVGPathSegList;\n};\n\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoAbs: {\n prototype: SVGPathSegMovetoAbs;\n new(): SVGPathSegMovetoAbs;\n};\n\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoRel: {\n prototype: SVGPathSegMovetoRel;\n new(): SVGPathSegMovetoRel;\n};\n\ninterface SVGPatternElement extends SVGElement, SVGTests, SVGFitToViewBox, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly patternContentUnits: SVGAnimatedEnumeration;\n readonly patternTransform: SVGAnimatedTransformList;\n readonly patternUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPatternElement: {\n prototype: SVGPatternElement;\n new(): SVGPatternElement;\n};\n\ninterface SVGPointList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPoint): SVGPoint;\n clear(): void;\n getItem(index: number): SVGPoint;\n initialize(newItem: SVGPoint): SVGPoint;\n insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;\n removeItem(index: number): SVGPoint;\n replaceItem(newItem: SVGPoint, index: number): SVGPoint;\n}\n\ndeclare var SVGPointList: {\n prototype: SVGPointList;\n new(): SVGPointList;\n};\n\ninterface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n};\n\ninterface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolylineElement: {\n prototype: SVGPolylineElement;\n new(): SVGPolylineElement;\n};\n\ninterface SVGPreserveAspectRatio {\n align: number;\n meetOrSlice: number;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n}\n\ndeclare var SVGPreserveAspectRatio: {\n prototype: SVGPreserveAspectRatio;\n new(): SVGPreserveAspectRatio;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n};\n\ninterface SVGRadialGradientElement extends SVGGradientElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly fx: SVGAnimatedLength;\n readonly fy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRadialGradientElement: {\n prototype: SVGRadialGradientElement;\n new(): SVGRadialGradientElement;\n};\n\ninterface SVGRectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRectElement: {\n prototype: SVGRectElement;\n new(): SVGRectElement;\n};\n\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\n \"SVGUnload\": Event;\n \"SVGZoom\": SVGZoomEvent;\n}\n\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n contentScriptType: string;\n /** @deprecated */\n contentStyleType: string;\n currentScale: number;\n readonly currentTranslate: SVGPoint;\n readonly height: SVGAnimatedLength;\n onunload: ((this: SVGSVGElement, ev: Event) => any) | null;\n onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null;\n /** @deprecated */\n readonly pixelUnitToMillimeterX: number;\n /** @deprecated */\n readonly pixelUnitToMillimeterY: number;\n /** @deprecated */\n readonly screenPixelToMillimeterX: number;\n /** @deprecated */\n readonly screenPixelToMillimeterY: number;\n /** @deprecated */\n readonly viewport: SVGRect;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\n checkIntersection(element: SVGElement, rect: SVGRect): boolean;\n createSVGAngle(): SVGAngle;\n createSVGLength(): SVGLength;\n createSVGMatrix(): SVGMatrix;\n createSVGNumber(): SVGNumber;\n createSVGPoint(): SVGPoint;\n createSVGRect(): SVGRect;\n createSVGTransform(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n deselectAll(): void;\n /** @deprecated */\n forceRedraw(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n /** @deprecated */\n getCurrentTime(): number;\n getElementById(elementId: string): Element;\n getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n /** @deprecated */\n pauseAnimations(): void;\n /** @deprecated */\n setCurrentTime(seconds: number): void;\n /** @deprecated */\n suspendRedraw(maxWaitMilliseconds: number): number;\n /** @deprecated */\n unpauseAnimations(): void;\n /** @deprecated */\n unsuspendRedraw(suspendHandleID: number): void;\n /** @deprecated */\n unsuspendRedrawAll(): void;\n addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n};\n\ninterface SVGStopElement extends SVGElement {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStopElement: {\n prototype: SVGStopElement;\n new(): SVGStopElement;\n};\n\ninterface SVGStringList {\n readonly length: number;\n readonly numberOfItems: number;\n appendItem(newItem: string): string;\n clear(): void;\n getItem(index: number): string;\n initialize(newItem: string): string;\n insertItemBefore(newItem: string, index: number): string;\n removeItem(index: number): string;\n replaceItem(newItem: string, index: number): string;\n [index: number]: string;\n}\n\ndeclare var SVGStringList: {\n prototype: SVGStringList;\n new(): SVGStringList;\n};\n\ninterface SVGStyleElement extends SVGElement {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n};\n\ninterface SVGSwitchElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n};\n\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n};\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n};\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n readonly systemLanguage: SVGStringList;\n}\n\ninterface SVGTextContentElement extends SVGGraphicsElement {\n readonly lengthAdjust: SVGAnimatedEnumeration;\n readonly textLength: SVGAnimatedLength;\n getCharNumAtPosition(point: SVGPoint): number;\n getComputedTextLength(): number;\n getEndPositionOfChar(charnum: number): SVGPoint;\n getExtentOfChar(charnum: number): SVGRect;\n getNumberOfChars(): number;\n getRotationOfChar(charnum: number): number;\n getStartPositionOfChar(charnum: number): SVGPoint;\n getSubStringLength(charnum: number, nchars: number): number;\n selectSubString(charnum: number, nchars: number): void;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextContentElement: {\n prototype: SVGTextContentElement;\n new(): SVGTextContentElement;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n};\n\ninterface SVGTextElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextElement: {\n prototype: SVGTextElement;\n new(): SVGTextElement;\n};\n\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\n readonly method: SVGAnimatedEnumeration;\n readonly spacing: SVGAnimatedEnumeration;\n readonly startOffset: SVGAnimatedLength;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPathElement: {\n prototype: SVGTextPathElement;\n new(): SVGTextPathElement;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n};\n\ninterface SVGTextPositioningElement extends SVGTextContentElement {\n readonly dx: SVGAnimatedLengthList;\n readonly dy: SVGAnimatedLengthList;\n readonly rotate: SVGAnimatedNumberList;\n readonly x: SVGAnimatedLengthList;\n readonly y: SVGAnimatedLengthList;\n addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n};\n\ninterface SVGTitleElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTitleElement: {\n prototype: SVGTitleElement;\n new(): SVGTitleElement;\n};\n\ninterface SVGTransform {\n readonly angle: number;\n readonly matrix: SVGMatrix;\n readonly type: number;\n setMatrix(matrix: SVGMatrix): void;\n setRotate(angle: number, cx: number, cy: number): void;\n setScale(sx: number, sy: number): void;\n setSkewX(angle: number): void;\n setSkewY(angle: number): void;\n setTranslate(tx: number, ty: number): void;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n}\n\ndeclare var SVGTransform: {\n prototype: SVGTransform;\n new(): SVGTransform;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n};\n\ninterface SVGTransformList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGTransform): SVGTransform;\n clear(): void;\n consolidate(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n getItem(index: number): SVGTransform;\n initialize(newItem: SVGTransform): SVGTransform;\n insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\n removeItem(index: number): SVGTransform;\n replaceItem(newItem: SVGTransform, index: number): SVGTransform;\n}\n\ndeclare var SVGTransformList: {\n prototype: SVGTransformList;\n new(): SVGTransformList;\n};\n\ninterface SVGURIReference {\n readonly href: SVGAnimatedString;\n}\n\ninterface SVGUnitTypes {\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n}\n\ndeclare var SVGUnitTypes: {\n prototype: SVGUnitTypes;\n new(): SVGUnitTypes;\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n};\n\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\n readonly animatedInstanceRoot: SVGElementInstance | null;\n readonly height: SVGAnimatedLength;\n readonly instanceRoot: SVGElementInstance | null;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n};\n\ninterface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGViewElement: {\n prototype: SVGViewElement;\n new(): SVGViewElement;\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomAndPan {\n readonly zoomAndPan: number;\n}\n\ndeclare var SVGZoomAndPan: {\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomEvent extends UIEvent {\n readonly newScale: number;\n readonly newTranslate: SVGPoint;\n readonly previousScale: number;\n readonly previousTranslate: SVGPoint;\n readonly zoomRectScreen: SVGRect;\n}\n\ndeclare var SVGZoomEvent: {\n prototype: SVGZoomEvent;\n new(): SVGZoomEvent;\n};\n\ninterface ScopedCredential {\n readonly id: ArrayBuffer;\n readonly type: ScopedCredentialType;\n}\n\ndeclare var ScopedCredential: {\n prototype: ScopedCredential;\n new(): ScopedCredential;\n};\n\ninterface ScopedCredentialInfo {\n readonly credential: ScopedCredential;\n readonly publicKey: CryptoKey;\n}\n\ndeclare var ScopedCredentialInfo: {\n prototype: ScopedCredentialInfo;\n new(): ScopedCredentialInfo;\n};\n\ninterface Screen {\n readonly availHeight: number;\n readonly availWidth: number;\n readonly colorDepth: number;\n readonly height: number;\n readonly orientation: ScreenOrientation;\n readonly pixelDepth: number;\n readonly width: number;\n}\n\ndeclare var Screen: {\n prototype: Screen;\n new(): Screen;\n};\n\ninterface ScreenOrientationEventMap {\n \"change\": Event;\n}\n\ninterface ScreenOrientation extends EventTarget {\n readonly angle: number;\n onchange: ((this: ScreenOrientation, ev: Event) => any) | null;\n readonly type: OrientationType;\n lock(orientation: OrientationLockType): Promise;\n unlock(): void;\n addEventListener(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScreenOrientation: {\n prototype: ScreenOrientation;\n new(): ScreenOrientation;\n};\n\ninterface ScriptProcessorNodeEventMap {\n \"audioprocess\": AudioProcessingEvent;\n}\n\ninterface ScriptProcessorNode extends AudioNode {\n /** @deprecated */\n readonly bufferSize: number;\n /** @deprecated */\n onaudioprocess: ((this: ScriptProcessorNode, ev: AudioProcessingEvent) => any) | null;\n addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScriptProcessorNode: {\n prototype: ScriptProcessorNode;\n new(): ScriptProcessorNode;\n};\n\ninterface SecurityPolicyViolationEvent extends Event {\n readonly blockedURI: string;\n readonly columnNumber: number;\n readonly documentURI: string;\n readonly effectiveDirective: string;\n readonly lineNumber: number;\n readonly originalPolicy: string;\n readonly referrer: string;\n readonly sourceFile: string;\n readonly statusCode: number;\n readonly violatedDirective: string;\n}\n\ndeclare var SecurityPolicyViolationEvent: {\n prototype: SecurityPolicyViolationEvent;\n new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;\n};\n\ninterface Selection {\n readonly anchorNode: Node;\n readonly anchorOffset: number;\n readonly baseNode: Node;\n readonly baseOffset: number;\n readonly extentNode: Node;\n readonly extentOffset: number;\n readonly focusNode: Node;\n readonly focusOffset: number;\n readonly isCollapsed: boolean;\n readonly rangeCount: number;\n readonly type: string;\n addRange(range: Range): void;\n collapse(parentNode: Node, offset: number): void;\n collapseToEnd(): void;\n collapseToStart(): void;\n containsNode(node: Node, partlyContained: boolean): boolean;\n deleteFromDocument(): void;\n empty(): void;\n extend(newNode: Node, offset: number): void;\n getRangeAt(index: number): Range;\n removeAllRanges(): void;\n removeRange(range: Range): void;\n selectAllChildren(parentNode: Node): void;\n setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;\n setPosition(parentNode: Node, offset: number): void;\n toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n};\n\ninterface ServiceUIFrameContext {\n getCachedFrameMessage(key: string): string;\n postFrameMessage(key: string, data: string): void;\n}\ndeclare var ServiceUIFrameContext: ServiceUIFrameContext;\n\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\n \"statechange\": Event;\n}\n\ninterface ServiceWorker extends EventTarget, AbstractWorker {\n onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;\n readonly scriptURL: string;\n readonly state: ServiceWorkerState;\n postMessage(message: any, transfer?: Transferable[]): void;\n addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorker: {\n prototype: ServiceWorker;\n new(): ServiceWorker;\n};\n\ninterface ServiceWorkerContainerEventMap {\n \"controllerchange\": Event;\n \"message\": MessageEvent;\n \"messageerror\": MessageEvent;\n}\n\ninterface ServiceWorkerContainer extends EventTarget {\n readonly controller: ServiceWorker | null;\n oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;\n onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\n onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\n readonly ready: Promise;\n getRegistration(clientURL?: string): Promise;\n getRegistrations(): Promise>;\n register(scriptURL: string, options?: RegistrationOptions): Promise;\n startMessages(): void;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerContainer: {\n prototype: ServiceWorkerContainer;\n new(): ServiceWorkerContainer;\n};\n\ninterface ServiceWorkerMessageEvent extends Event {\n readonly data: any;\n readonly lastEventId: string;\n readonly origin: string;\n readonly ports: ReadonlyArray | null;\n readonly source: ServiceWorker | MessagePort | null;\n}\n\ndeclare var ServiceWorkerMessageEvent: {\n prototype: ServiceWorkerMessageEvent;\n new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\n};\n\ninterface ServiceWorkerRegistrationEventMap {\n \"updatefound\": Event;\n}\n\ninterface ServiceWorkerRegistration extends EventTarget {\n readonly active: ServiceWorker | null;\n readonly installing: ServiceWorker | null;\n readonly navigationPreload: NavigationPreloadManager;\n onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;\n readonly pushManager: PushManager;\n readonly scope: string;\n readonly sync: SyncManager;\n readonly updateViaCache: ServiceWorkerUpdateViaCache;\n readonly waiting: ServiceWorker | null;\n getNotifications(filter?: GetNotificationOptions): Promise;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerRegistration: {\n prototype: ServiceWorkerRegistration;\n new(): ServiceWorkerRegistration;\n};\n\ninterface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment, DocumentOrShadowRoot {\n readonly host: Element;\n innerHTML: string;\n readonly mode: ShadowRootMode;\n}\n\ninterface ShadowRootInit {\n delegatesFocus?: boolean;\n mode: \"open\" | \"closed\";\n}\n\ninterface Slotable {\n readonly assignedSlot: HTMLSlotElement | null;\n}\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: AppendMode;\n readonly textTracks: TextTrackList;\n timestampOffset: number;\n readonly updating: boolean;\n readonly videoTracks: VideoTrackList;\n abort(): void;\n appendBuffer(data: ArrayBuffer | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n appendStream(stream: MSStream, maxSize?: number): void;\n remove(start: number, end: number): void;\n}\n\ndeclare var SourceBuffer: {\n prototype: SourceBuffer;\n new(): SourceBuffer;\n};\n\ninterface SourceBufferList extends EventTarget {\n readonly length: number;\n item(index: number): SourceBuffer;\n [index: number]: SourceBuffer;\n}\n\ndeclare var SourceBufferList: {\n prototype: SourceBufferList;\n new(): SourceBufferList;\n};\n\ninterface SpeechGrammar {\n src: string;\n weight: number;\n}\n\ndeclare var SpeechGrammar: {\n prototype: SpeechGrammar;\n new(): SpeechGrammar;\n};\n\ninterface SpeechGrammarList {\n readonly length: number;\n addFromString(string: string, weight?: number): void;\n addFromURI(src: string, weight?: number): void;\n item(index: number): SpeechGrammar;\n [index: number]: SpeechGrammar;\n}\n\ndeclare var SpeechGrammarList: {\n prototype: SpeechGrammarList;\n new(): SpeechGrammarList;\n};\n\ninterface SpeechRecognitionEventMap {\n \"audioend\": Event;\n \"audiostart\": Event;\n \"end\": Event;\n \"error\": SpeechRecognitionError;\n \"nomatch\": SpeechRecognitionEvent;\n \"result\": SpeechRecognitionEvent;\n \"soundend\": Event;\n \"soundstart\": Event;\n \"speechend\": Event;\n \"speechstart\": Event;\n \"start\": Event;\n}\n\ninterface SpeechRecognition extends EventTarget {\n continuous: boolean;\n grammars: SpeechGrammarList;\n interimResults: boolean;\n lang: string;\n maxAlternatives: number;\n onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;\n onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;\n onend: ((this: SpeechRecognition, ev: Event) => any) | null;\n onerror: ((this: SpeechRecognition, ev: SpeechRecognitionError) => any) | null;\n onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;\n onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;\n onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;\n onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null;\n onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null;\n onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null;\n onstart: ((this: SpeechRecognition, ev: Event) => any) | null;\n serviceURI: string;\n abort(): void;\n start(): void;\n stop(): void;\n addEventListener(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechRecognition: {\n prototype: SpeechRecognition;\n new(): SpeechRecognition;\n};\n\ninterface SpeechRecognitionAlternative {\n readonly confidence: number;\n readonly transcript: string;\n}\n\ndeclare var SpeechRecognitionAlternative: {\n prototype: SpeechRecognitionAlternative;\n new(): SpeechRecognitionAlternative;\n};\n\ninterface SpeechRecognitionError extends Event {\n readonly error: SpeechRecognitionErrorCode;\n readonly message: string;\n}\n\ndeclare var SpeechRecognitionError: {\n prototype: SpeechRecognitionError;\n new(): SpeechRecognitionError;\n};\n\ninterface SpeechRecognitionEvent extends Event {\n readonly emma: Document | null;\n readonly interpretation: any;\n readonly resultIndex: number;\n readonly results: SpeechRecognitionResultList;\n}\n\ndeclare var SpeechRecognitionEvent: {\n prototype: SpeechRecognitionEvent;\n new(): SpeechRecognitionEvent;\n};\n\ninterface SpeechRecognitionResult {\n readonly isFinal: boolean;\n readonly length: number;\n item(index: number): SpeechRecognitionAlternative;\n [index: number]: SpeechRecognitionAlternative;\n}\n\ndeclare var SpeechRecognitionResult: {\n prototype: SpeechRecognitionResult;\n new(): SpeechRecognitionResult;\n};\n\ninterface SpeechRecognitionResultList {\n readonly length: number;\n item(index: number): SpeechRecognitionResult;\n [index: number]: SpeechRecognitionResult;\n}\n\ndeclare var SpeechRecognitionResultList: {\n prototype: SpeechRecognitionResultList;\n new(): SpeechRecognitionResultList;\n};\n\ninterface SpeechSynthesisEventMap {\n \"voiceschanged\": Event;\n}\n\ninterface SpeechSynthesis extends EventTarget {\n onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;\n readonly paused: boolean;\n readonly pending: boolean;\n readonly speaking: boolean;\n cancel(): void;\n getVoices(): SpeechSynthesisVoice[];\n pause(): void;\n resume(): void;\n speak(utterance: SpeechSynthesisUtterance): void;\n addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesis: {\n prototype: SpeechSynthesis;\n new(): SpeechSynthesis;\n};\n\ninterface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent {\n readonly error: SpeechSynthesisErrorCode;\n}\n\ndeclare var SpeechSynthesisErrorEvent: {\n prototype: SpeechSynthesisErrorEvent;\n new(): SpeechSynthesisErrorEvent;\n};\n\ninterface SpeechSynthesisEvent extends Event {\n readonly charIndex: number;\n readonly elapsedTime: number;\n readonly name: string;\n readonly utterance: SpeechSynthesisUtterance;\n}\n\ndeclare var SpeechSynthesisEvent: {\n prototype: SpeechSynthesisEvent;\n new(): SpeechSynthesisEvent;\n};\n\ninterface SpeechSynthesisUtteranceEventMap {\n \"boundary\": SpeechSynthesisEvent;\n \"end\": SpeechSynthesisEvent;\n \"error\": SpeechSynthesisErrorEvent;\n \"mark\": SpeechSynthesisEvent;\n \"pause\": SpeechSynthesisEvent;\n \"resume\": SpeechSynthesisEvent;\n \"start\": SpeechSynthesisEvent;\n}\n\ninterface SpeechSynthesisUtterance extends EventTarget {\n lang: string;\n onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n onend: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n onerror: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) => any) | null;\n onmark: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n onpause: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n onresume: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n onstart: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null;\n pitch: number;\n rate: number;\n text: string;\n voice: SpeechSynthesisVoice;\n volume: number;\n addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesisUtterance: {\n prototype: SpeechSynthesisUtterance;\n new(): SpeechSynthesisUtterance;\n new(text: string): SpeechSynthesisUtterance;\n};\n\ninterface SpeechSynthesisVoice {\n readonly default: boolean;\n readonly lang: string;\n readonly localService: boolean;\n readonly name: string;\n readonly voiceURI: string;\n}\n\ndeclare var SpeechSynthesisVoice: {\n prototype: SpeechSynthesisVoice;\n new(): SpeechSynthesisVoice;\n};\n\ninterface StaticRange extends AbstractRange {\n}\n\ndeclare var StaticRange: {\n prototype: StaticRange;\n new(): StaticRange;\n};\n\ninterface StereoPannerNode extends AudioNode {\n readonly pan: AudioParam;\n}\n\ndeclare var StereoPannerNode: {\n prototype: StereoPannerNode;\n new(context: BaseAudioContext, options?: StereoPannerOptions): StereoPannerNode;\n};\n\ninterface Storage {\n /**\n * Returns the number of key/value pairs currently present in the list associated with the\n * object.\n */\n readonly length: number;\n /**\n * Empties the list associated with the object of all key/value pairs, if there are any.\n */\n clear(): void;\n /**\n * value = storage[key]\n */\n getItem(key: string): string | null;\n /**\n * Returns the name of the nth key in the list, or null if n is greater\n * than or equal to the number of key/value pairs in the object.\n */\n key(index: number): string | null;\n /**\n * delete storage[key]\n */\n removeItem(key: string): void;\n /**\n * storage[key] = value\n */\n setItem(key: string, value: string): void;\n [name: string]: any;\n}\n\ndeclare var Storage: {\n prototype: Storage;\n new(): Storage;\n};\n\ninterface StorageEvent extends Event {\n /**\n * Returns the key of the storage item being changed.\n */\n readonly key: string | null;\n /**\n * Returns the new value of the key of the storage item whose value is being changed.\n */\n readonly newValue: string | null;\n /**\n * Returns the old value of the key of the storage item whose value is being changed.\n */\n readonly oldValue: string | null;\n /**\n * Returns the Storage object that was affected.\n */\n readonly storageArea: Storage | null;\n /**\n * Returns the URL of the document whose storage item changed.\n */\n readonly url: string;\n}\n\ndeclare var StorageEvent: {\n prototype: StorageEvent;\n new(type: string, eventInitDict?: StorageEventInit): StorageEvent;\n};\n\ninterface StorageManager {\n estimate(): Promise;\n persist(): Promise;\n persisted(): Promise;\n}\n\ndeclare var StorageManager: {\n prototype: StorageManager;\n new(): StorageManager;\n};\n\ninterface StyleMedia {\n readonly type: string;\n matchMedium(mediaquery: string): boolean;\n}\n\ndeclare var StyleMedia: {\n prototype: StyleMedia;\n new(): StyleMedia;\n};\n\ninterface StyleSheet {\n disabled: boolean;\n readonly href: string | null;\n readonly media: MediaList;\n readonly ownerNode: Node;\n readonly parentStyleSheet: StyleSheet | null;\n readonly title: string | null;\n readonly type: string;\n}\n\ndeclare var StyleSheet: {\n prototype: StyleSheet;\n new(): StyleSheet;\n};\n\ninterface StyleSheetList {\n readonly length: number;\n item(index: number): StyleSheet | null;\n [index: number]: StyleSheet;\n}\n\ndeclare var StyleSheetList: {\n prototype: StyleSheetList;\n new(): StyleSheetList;\n};\n\ninterface SubtleCrypto {\n decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;\n deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n digest(algorithm: string | Algorithm, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n exportKey(format: \"jwk\", key: CryptoKey): PromiseLike;\n exportKey(format: \"raw\" | \"pkcs8\" | \"spki\", key: CryptoKey): PromiseLike;\n exportKey(format: string, key: CryptoKey): PromiseLike;\n generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"jwk\", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"raw\" | \"pkcs8\" | \"spki\", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n unwrapKey(format: string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): PromiseLike;\n}\n\ndeclare var SubtleCrypto: {\n prototype: SubtleCrypto;\n new(): SubtleCrypto;\n};\n\ninterface SyncManager {\n getTags(): Promise;\n register(tag: string): Promise;\n}\n\ndeclare var SyncManager: {\n prototype: SyncManager;\n new(): SyncManager;\n};\n\ninterface Text extends CharacterData, Slotable {\n readonly assignedSlot: HTMLSlotElement | null;\n /**\n * Returns the combined data of all direct Text node siblings.\n */\n readonly wholeText: string;\n /**\n * Splits data at the given offset and returns the remainder as Text node.\n */\n splitText(offset: number): Text;\n}\n\ndeclare var Text: {\n prototype: Text;\n new(data?: string): Text;\n};\n\ninterface TextDecoder {\n /**\n * Returns encoding's name, lowercased.\n */\n readonly encoding: string;\n /**\n * Returns true if error mode is \"fatal\", and false\n * otherwise.\n */\n readonly fatal: boolean;\n /**\n * Returns true if ignore BOM flag is set, and false otherwise.\n */\n readonly ignoreBOM: boolean;\n /**\n * Returns the result of running encoding's decoder. The\n * method can be invoked zero or more times with options's stream set to\n * true, and then once without options's stream (or set to false), to process\n * a fragmented stream. If the invocation without options's stream (or set to\n * false) has no input, it's clearest to omit both arguments.\n * var string = \"\", decoder = new TextDecoder(encoding), buffer;\n * while(buffer = next_chunk()) {\n * string += decoder.decode(buffer, {stream:true});\n * }\n * string += decoder.decode(); // end-of-stream\n * If the error mode is \"fatal\" and encoding's decoder returns error, throws a TypeError.\n */\n decode(input?: BufferSource, options?: TextDecodeOptions): string;\n}\n\ndeclare var TextDecoder: {\n prototype: TextDecoder;\n new(label?: string, options?: TextDecoderOptions): TextDecoder;\n};\n\ninterface TextEncoder {\n /**\n * Returns \"utf-8\".\n */\n readonly encoding: string;\n /**\n * Returns the result of running UTF-8's encoder.\n */\n encode(input?: string): Uint8Array;\n}\n\ndeclare var TextEncoder: {\n prototype: TextEncoder;\n new(): TextEncoder;\n};\n\ninterface TextEvent extends UIEvent {\n readonly data: string;\n initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n}\n\ndeclare var TextEvent: {\n prototype: TextEvent;\n new(): TextEvent;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n};\n\ninterface TextMetrics {\n readonly actualBoundingBoxAscent: number;\n readonly actualBoundingBoxDescent: number;\n readonly actualBoundingBoxLeft: number;\n readonly actualBoundingBoxRight: number;\n readonly alphabeticBaseline: number;\n readonly emHeightAscent: number;\n readonly emHeightDescent: number;\n readonly fontBoundingBoxAscent: number;\n readonly fontBoundingBoxDescent: number;\n readonly hangingBaseline: number;\n /**\n * Returns the measurement described below.\n */\n readonly ideographicBaseline: number;\n readonly width: number;\n}\n\ndeclare var TextMetrics: {\n prototype: TextMetrics;\n new(): TextMetrics;\n};\n\ninterface TextTrackEventMap {\n \"cuechange\": Event;\n \"error\": Event;\n \"load\": Event;\n}\n\ninterface TextTrack extends EventTarget {\n readonly activeCues: TextTrackCueList;\n readonly cues: TextTrackCueList;\n readonly inBandMetadataTrackDispatchType: string;\n readonly kind: string;\n readonly label: string;\n readonly language: string;\n mode: TextTrackMode | number;\n oncuechange: ((this: TextTrack, ev: Event) => any) | null;\n onerror: ((this: TextTrack, ev: Event) => any) | null;\n onload: ((this: TextTrack, ev: Event) => any) | null;\n readonly readyState: number;\n addCue(cue: TextTrackCue): void;\n removeCue(cue: TextTrackCue): void;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrack: {\n prototype: TextTrack;\n new(): TextTrack;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n};\n\ninterface TextTrackCueEventMap {\n \"enter\": Event;\n \"exit\": Event;\n}\n\ninterface TextTrackCue extends EventTarget {\n endTime: number;\n id: string;\n onenter: ((this: TextTrackCue, ev: Event) => any) | null;\n onexit: ((this: TextTrackCue, ev: Event) => any) | null;\n pauseOnExit: boolean;\n startTime: number;\n text: string;\n readonly track: TextTrack;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrackCue: {\n prototype: TextTrackCue;\n new(startTime: number, endTime: number, text: string): TextTrackCue;\n};\n\ninterface TextTrackCueList {\n readonly length: number;\n getCueById(id: string): TextTrackCue;\n item(index: number): TextTrackCue;\n [index: number]: TextTrackCue;\n}\n\ndeclare var TextTrackCueList: {\n prototype: TextTrackCueList;\n new(): TextTrackCueList;\n};\n\ninterface TextTrackListEventMap {\n \"addtrack\": TrackEvent;\n}\n\ninterface TextTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\n item(index: number): TextTrack;\n addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: TextTrack;\n}\n\ndeclare var TextTrackList: {\n prototype: TextTrackList;\n new(): TextTrackList;\n};\n\ninterface TimeRanges {\n readonly length: number;\n end(index: number): number;\n start(index: number): number;\n}\n\ndeclare var TimeRanges: {\n prototype: TimeRanges;\n new(): TimeRanges;\n};\n\ninterface Touch {\n readonly altitudeAngle: number;\n readonly azimuthAngle: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly force: number;\n readonly identifier: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly radiusX: number;\n readonly radiusY: number;\n readonly rotationAngle: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly target: EventTarget;\n readonly touchType: TouchType;\n}\n\ndeclare var Touch: {\n prototype: Touch;\n new(touchInitDict: TouchInit): Touch;\n};\n\ninterface TouchEvent extends UIEvent {\n readonly altKey: boolean;\n readonly changedTouches: TouchList;\n readonly ctrlKey: boolean;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(type: string, eventInitDict?: TouchEventInit): TouchEvent;\n};\n\ninterface TouchList {\n readonly length: number;\n item(index: number): Touch | null;\n [index: number]: Touch;\n}\n\ndeclare var TouchList: {\n prototype: TouchList;\n new(): TouchList;\n};\n\ninterface TrackEvent extends Event {\n readonly track: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;\n};\n\ninterface TransformStream {\n readonly readable: ReadableStream;\n readonly writable: WritableStream;\n}\n\ndeclare var TransformStream: {\n prototype: TransformStream;\n new(transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream;\n};\n\ninterface TransformStreamDefaultController {\n readonly desiredSize: number | null;\n enqueue(chunk: O): void;\n error(reason?: any): void;\n terminate(): void;\n}\n\ninterface TransitionEvent extends Event {\n readonly elapsedTime: number;\n readonly propertyName: string;\n readonly pseudoElement: string;\n}\n\ndeclare var TransitionEvent: {\n prototype: TransitionEvent;\n new(type: string, transitionEventInitDict?: TransitionEventInit): TransitionEvent;\n};\n\ninterface TreeWalker {\n currentNode: Node;\n readonly filter: NodeFilter | null;\n readonly root: Node;\n readonly whatToShow: number;\n firstChild(): Node | null;\n lastChild(): Node | null;\n nextNode(): Node | null;\n nextSibling(): Node | null;\n parentNode(): Node | null;\n previousNode(): Node | null;\n previousSibling(): Node | null;\n}\n\ndeclare var TreeWalker: {\n prototype: TreeWalker;\n new(): TreeWalker;\n};\n\ninterface UIEvent extends Event {\n readonly detail: number;\n readonly view: Window;\n initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;\n}\n\ndeclare var UIEvent: {\n prototype: UIEvent;\n new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;\n};\n\ninterface URL {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n readonly searchParams: URLSearchParams;\n username: string;\n toJSON(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string | URL): URL;\n createObjectURL(object: any): string;\n revokeObjectURL(url: string): void;\n};\n\ntype webkitURL = URL;\ndeclare var webkitURL: typeof URL;\n\ninterface URLSearchParams {\n /**\n * Appends a specified key/value pair as a new search parameter.\n */\n append(name: string, value: string): void;\n /**\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\n */\n delete(name: string): void;\n /**\n * Returns the first value associated to the given search parameter.\n */\n get(name: string): string | null;\n /**\n * Returns all the values association with a given search parameter.\n */\n getAll(name: string): string[];\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n */\n has(name: string): boolean;\n /**\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\n */\n set(name: string, value: string): void;\n sort(): void;\n forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;\n}\n\ndeclare var URLSearchParams: {\n prototype: URLSearchParams;\n new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams;\n};\n\ninterface VRDisplay extends EventTarget {\n readonly capabilities: VRDisplayCapabilities;\n depthFar: number;\n depthNear: number;\n readonly displayId: number;\n readonly displayName: string;\n readonly isConnected: boolean;\n readonly isPresenting: boolean;\n readonly stageParameters: VRStageParameters | null;\n cancelAnimationFrame(handle: number): void;\n exitPresent(): Promise;\n getEyeParameters(whichEye: string): VREyeParameters;\n getFrameData(frameData: VRFrameData): boolean;\n getLayers(): VRLayer[];\n /** @deprecated */\n getPose(): VRPose;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n requestPresent(layers: VRLayer[]): Promise;\n resetPose(): void;\n submitFrame(pose?: VRPose): void;\n}\n\ndeclare var VRDisplay: {\n prototype: VRDisplay;\n new(): VRDisplay;\n};\n\ninterface VRDisplayCapabilities {\n readonly canPresent: boolean;\n readonly hasExternalDisplay: boolean;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly maxLayers: number;\n}\n\ndeclare var VRDisplayCapabilities: {\n prototype: VRDisplayCapabilities;\n new(): VRDisplayCapabilities;\n};\n\ninterface VRDisplayEvent extends Event {\n readonly display: VRDisplay;\n readonly reason: VRDisplayEventReason | null;\n}\n\ndeclare var VRDisplayEvent: {\n prototype: VRDisplayEvent;\n new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent;\n};\n\ninterface VREyeParameters {\n /** @deprecated */\n readonly fieldOfView: VRFieldOfView;\n readonly offset: Float32Array;\n readonly renderHeight: number;\n readonly renderWidth: number;\n}\n\ndeclare var VREyeParameters: {\n prototype: VREyeParameters;\n new(): VREyeParameters;\n};\n\ninterface VRFieldOfView {\n readonly downDegrees: number;\n readonly leftDegrees: number;\n readonly rightDegrees: number;\n readonly upDegrees: number;\n}\n\ndeclare var VRFieldOfView: {\n prototype: VRFieldOfView;\n new(): VRFieldOfView;\n};\n\ninterface VRFrameData {\n readonly leftProjectionMatrix: Float32Array;\n readonly leftViewMatrix: Float32Array;\n readonly pose: VRPose;\n readonly rightProjectionMatrix: Float32Array;\n readonly rightViewMatrix: Float32Array;\n readonly timestamp: number;\n}\n\ndeclare var VRFrameData: {\n prototype: VRFrameData;\n new(): VRFrameData;\n};\n\ninterface VRPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n readonly timestamp: number;\n}\n\ndeclare var VRPose: {\n prototype: VRPose;\n new(): VRPose;\n};\n\ninterface VTTCue extends TextTrackCue {\n align: AlignSetting;\n line: LineAndPositionSetting;\n lineAlign: LineAlignSetting;\n position: LineAndPositionSetting;\n positionAlign: PositionAlignSetting;\n region: VTTRegion | null;\n size: number;\n snapToLines: boolean;\n text: string;\n vertical: DirectionSetting;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var VTTCue: {\n prototype: VTTCue;\n new(startTime: number, endTime: number, text: string): VTTCue;\n};\n\ninterface VTTRegion {\n id: string;\n lines: number;\n regionAnchorX: number;\n regionAnchorY: number;\n scroll: ScrollSetting;\n viewportAnchorX: number;\n viewportAnchorY: number;\n width: number;\n}\n\ndeclare var VTTRegion: {\n prototype: VTTRegion;\n new(): VTTRegion;\n};\n\ninterface ValidityState {\n readonly badInput: boolean;\n readonly customError: boolean;\n readonly patternMismatch: boolean;\n readonly rangeOverflow: boolean;\n readonly rangeUnderflow: boolean;\n readonly stepMismatch: boolean;\n readonly tooLong: boolean;\n readonly tooShort: boolean;\n readonly typeMismatch: boolean;\n readonly valid: boolean;\n readonly valueMissing: boolean;\n}\n\ndeclare var ValidityState: {\n prototype: ValidityState;\n new(): ValidityState;\n};\n\ninterface VideoPlaybackQuality {\n readonly corruptedVideoFrames: number;\n readonly creationTime: number;\n readonly droppedVideoFrames: number;\n readonly totalFrameDelay: number;\n readonly totalVideoFrames: number;\n}\n\ndeclare var VideoPlaybackQuality: {\n prototype: VideoPlaybackQuality;\n new(): VideoPlaybackQuality;\n};\n\ninterface VideoTrack {\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n selected: boolean;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var VideoTrack: {\n prototype: VideoTrack;\n new(): VideoTrack;\n};\n\ninterface VideoTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface VideoTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: VideoTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n readonly selectedIndex: number;\n getTrackById(id: string): VideoTrack | null;\n item(index: number): VideoTrack;\n addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\n};\n\ninterface WEBGL_color_buffer_float {\n readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;\n readonly RGBA32F_EXT: GLenum;\n readonly UNSIGNED_NORMALIZED_EXT: GLenum;\n}\n\ninterface WEBGL_compressed_texture_astc {\n getSupportedProfiles(): string[];\n readonly COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum;\n readonly COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum;\n}\n\ninterface WEBGL_compressed_texture_s3tc {\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum;\n}\n\ninterface WEBGL_compressed_texture_s3tc_srgb {\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum;\n readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum;\n}\n\ninterface WEBGL_debug_renderer_info {\n readonly UNMASKED_RENDERER_WEBGL: GLenum;\n readonly UNMASKED_VENDOR_WEBGL: GLenum;\n}\n\ninterface WEBGL_debug_shaders {\n getTranslatedShaderSource(shader: WebGLShader): string;\n}\n\ninterface WEBGL_depth_texture {\n readonly UNSIGNED_INT_24_8_WEBGL: GLenum;\n}\n\ninterface WEBGL_draw_buffers {\n drawBuffersWEBGL(buffers: GLenum[]): void;\n readonly COLOR_ATTACHMENT0_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT10_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT11_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT12_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT13_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT14_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT15_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT1_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT2_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT3_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT4_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT5_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT6_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT7_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT8_WEBGL: GLenum;\n readonly COLOR_ATTACHMENT9_WEBGL: GLenum;\n readonly DRAW_BUFFER0_WEBGL: GLenum;\n readonly DRAW_BUFFER10_WEBGL: GLenum;\n readonly DRAW_BUFFER11_WEBGL: GLenum;\n readonly DRAW_BUFFER12_WEBGL: GLenum;\n readonly DRAW_BUFFER13_WEBGL: GLenum;\n readonly DRAW_BUFFER14_WEBGL: GLenum;\n readonly DRAW_BUFFER15_WEBGL: GLenum;\n readonly DRAW_BUFFER1_WEBGL: GLenum;\n readonly DRAW_BUFFER2_WEBGL: GLenum;\n readonly DRAW_BUFFER3_WEBGL: GLenum;\n readonly DRAW_BUFFER4_WEBGL: GLenum;\n readonly DRAW_BUFFER5_WEBGL: GLenum;\n readonly DRAW_BUFFER6_WEBGL: GLenum;\n readonly DRAW_BUFFER7_WEBGL: GLenum;\n readonly DRAW_BUFFER8_WEBGL: GLenum;\n readonly DRAW_BUFFER9_WEBGL: GLenum;\n readonly MAX_COLOR_ATTACHMENTS_WEBGL: GLenum;\n readonly MAX_DRAW_BUFFERS_WEBGL: GLenum;\n}\n\ninterface WEBGL_lose_context {\n loseContext(): void;\n restoreContext(): void;\n}\n\ninterface WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: OverSampleType;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(context: BaseAudioContext, options?: WaveShaperOptions): WaveShaperNode;\n};\n\ninterface WebAuthentication {\n getAssertion(assertionChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise;\n}\n\ndeclare var WebAuthentication: {\n prototype: WebAuthentication;\n new(): WebAuthentication;\n};\n\ninterface WebAuthnAssertion {\n readonly authenticatorData: ArrayBuffer;\n readonly clientData: ArrayBuffer;\n readonly credential: ScopedCredential;\n readonly signature: ArrayBuffer;\n}\n\ndeclare var WebAuthnAssertion: {\n prototype: WebAuthnAssertion;\n new(): WebAuthnAssertion;\n};\n\ninterface WebGLActiveInfo {\n readonly name: string;\n readonly size: GLint;\n readonly type: GLenum;\n}\n\ndeclare var WebGLActiveInfo: {\n prototype: WebGLActiveInfo;\n new(): WebGLActiveInfo;\n};\n\ninterface WebGLBuffer extends WebGLObject {\n}\n\ndeclare var WebGLBuffer: {\n prototype: WebGLBuffer;\n new(): WebGLBuffer;\n};\n\ninterface WebGLContextEvent extends Event {\n readonly statusMessage: string;\n}\n\ndeclare var WebGLContextEvent: {\n prototype: WebGLContextEvent;\n new(type: string, eventInit?: WebGLContextEventInit): WebGLContextEvent;\n};\n\ninterface WebGLFramebuffer extends WebGLObject {\n}\n\ndeclare var WebGLFramebuffer: {\n prototype: WebGLFramebuffer;\n new(): WebGLFramebuffer;\n};\n\ninterface WebGLObject {\n}\n\ndeclare var WebGLObject: {\n prototype: WebGLObject;\n new(): WebGLObject;\n};\n\ninterface WebGLProgram extends WebGLObject {\n}\n\ndeclare var WebGLProgram: {\n prototype: WebGLProgram;\n new(): WebGLProgram;\n};\n\ninterface WebGLRenderbuffer extends WebGLObject {\n}\n\ndeclare var WebGLRenderbuffer: {\n prototype: WebGLRenderbuffer;\n new(): WebGLRenderbuffer;\n};\n\ninterface WebGLRenderingContext extends WebGLRenderingContextBase {\n}\n\ndeclare var WebGLRenderingContext: {\n prototype: WebGLRenderingContext;\n new(): WebGLRenderingContext;\n readonly ACTIVE_ATTRIBUTES: GLenum;\n readonly ACTIVE_TEXTURE: GLenum;\n readonly ACTIVE_UNIFORMS: GLenum;\n readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\n readonly ALIASED_POINT_SIZE_RANGE: GLenum;\n readonly ALPHA: GLenum;\n readonly ALPHA_BITS: GLenum;\n readonly ALWAYS: GLenum;\n readonly ARRAY_BUFFER: GLenum;\n readonly ARRAY_BUFFER_BINDING: GLenum;\n readonly ATTACHED_SHADERS: GLenum;\n readonly BACK: GLenum;\n readonly BLEND: GLenum;\n readonly BLEND_COLOR: GLenum;\n readonly BLEND_DST_ALPHA: GLenum;\n readonly BLEND_DST_RGB: GLenum;\n readonly BLEND_EQUATION: GLenum;\n readonly BLEND_EQUATION_ALPHA: GLenum;\n readonly BLEND_EQUATION_RGB: GLenum;\n readonly BLEND_SRC_ALPHA: GLenum;\n readonly BLEND_SRC_RGB: GLenum;\n readonly BLUE_BITS: GLenum;\n readonly BOOL: GLenum;\n readonly BOOL_VEC2: GLenum;\n readonly BOOL_VEC3: GLenum;\n readonly BOOL_VEC4: GLenum;\n readonly BROWSER_DEFAULT_WEBGL: GLenum;\n readonly BUFFER_SIZE: GLenum;\n readonly BUFFER_USAGE: GLenum;\n readonly BYTE: GLenum;\n readonly CCW: GLenum;\n readonly CLAMP_TO_EDGE: GLenum;\n readonly COLOR_ATTACHMENT0: GLenum;\n readonly COLOR_BUFFER_BIT: GLenum;\n readonly COLOR_CLEAR_VALUE: GLenum;\n readonly COLOR_WRITEMASK: GLenum;\n readonly COMPILE_STATUS: GLenum;\n readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\n readonly CONSTANT_ALPHA: GLenum;\n readonly CONSTANT_COLOR: GLenum;\n readonly CONTEXT_LOST_WEBGL: GLenum;\n readonly CULL_FACE: GLenum;\n readonly CULL_FACE_MODE: GLenum;\n readonly CURRENT_PROGRAM: GLenum;\n readonly CURRENT_VERTEX_ATTRIB: GLenum;\n readonly CW: GLenum;\n readonly DECR: GLenum;\n readonly DECR_WRAP: GLenum;\n readonly DELETE_STATUS: GLenum;\n readonly DEPTH_ATTACHMENT: GLenum;\n readonly DEPTH_BITS: GLenum;\n readonly DEPTH_BUFFER_BIT: GLenum;\n readonly DEPTH_CLEAR_VALUE: GLenum;\n readonly DEPTH_COMPONENT: GLenum;\n readonly DEPTH_COMPONENT16: GLenum;\n readonly DEPTH_FUNC: GLenum;\n readonly DEPTH_RANGE: GLenum;\n readonly DEPTH_STENCIL: GLenum;\n readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\n readonly DEPTH_TEST: GLenum;\n readonly DEPTH_WRITEMASK: GLenum;\n readonly DITHER: GLenum;\n readonly DONT_CARE: GLenum;\n readonly DST_ALPHA: GLenum;\n readonly DST_COLOR: GLenum;\n readonly DYNAMIC_DRAW: GLenum;\n readonly ELEMENT_ARRAY_BUFFER: GLenum;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\n readonly EQUAL: GLenum;\n readonly FASTEST: GLenum;\n readonly FLOAT: GLenum;\n readonly FLOAT_MAT2: GLenum;\n readonly FLOAT_MAT3: GLenum;\n readonly FLOAT_MAT4: GLenum;\n readonly FLOAT_VEC2: GLenum;\n readonly FLOAT_VEC3: GLenum;\n readonly FLOAT_VEC4: GLenum;\n readonly FRAGMENT_SHADER: GLenum;\n readonly FRAMEBUFFER: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\n readonly FRAMEBUFFER_BINDING: GLenum;\n readonly FRAMEBUFFER_COMPLETE: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\n readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\n readonly FRONT: GLenum;\n readonly FRONT_AND_BACK: GLenum;\n readonly FRONT_FACE: GLenum;\n readonly FUNC_ADD: GLenum;\n readonly FUNC_REVERSE_SUBTRACT: GLenum;\n readonly FUNC_SUBTRACT: GLenum;\n readonly GENERATE_MIPMAP_HINT: GLenum;\n readonly GEQUAL: GLenum;\n readonly GREATER: GLenum;\n readonly GREEN_BITS: GLenum;\n readonly HIGH_FLOAT: GLenum;\n readonly HIGH_INT: GLenum;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\n readonly INCR: GLenum;\n readonly INCR_WRAP: GLenum;\n readonly INT: GLenum;\n readonly INT_VEC2: GLenum;\n readonly INT_VEC3: GLenum;\n readonly INT_VEC4: GLenum;\n readonly INVALID_ENUM: GLenum;\n readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\n readonly INVALID_OPERATION: GLenum;\n readonly INVALID_VALUE: GLenum;\n readonly INVERT: GLenum;\n readonly KEEP: GLenum;\n readonly LEQUAL: GLenum;\n readonly LESS: GLenum;\n readonly LINEAR: GLenum;\n readonly LINEAR_MIPMAP_LINEAR: GLenum;\n readonly LINEAR_MIPMAP_NEAREST: GLenum;\n readonly LINES: GLenum;\n readonly LINE_LOOP: GLenum;\n readonly LINE_STRIP: GLenum;\n readonly LINE_WIDTH: GLenum;\n readonly LINK_STATUS: GLenum;\n readonly LOW_FLOAT: GLenum;\n readonly LOW_INT: GLenum;\n readonly LUMINANCE: GLenum;\n readonly LUMINANCE_ALPHA: GLenum;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\n readonly MAX_RENDERBUFFER_SIZE: GLenum;\n readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_TEXTURE_SIZE: GLenum;\n readonly MAX_VARYING_VECTORS: GLenum;\n readonly MAX_VERTEX_ATTRIBS: GLenum;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\n readonly MAX_VIEWPORT_DIMS: GLenum;\n readonly MEDIUM_FLOAT: GLenum;\n readonly MEDIUM_INT: GLenum;\n readonly MIRRORED_REPEAT: GLenum;\n readonly NEAREST: GLenum;\n readonly NEAREST_MIPMAP_LINEAR: GLenum;\n readonly NEAREST_MIPMAP_NEAREST: GLenum;\n readonly NEVER: GLenum;\n readonly NICEST: GLenum;\n readonly NONE: GLenum;\n readonly NOTEQUAL: GLenum;\n readonly NO_ERROR: GLenum;\n readonly ONE: GLenum;\n readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\n readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\n readonly ONE_MINUS_DST_ALPHA: GLenum;\n readonly ONE_MINUS_DST_COLOR: GLenum;\n readonly ONE_MINUS_SRC_ALPHA: GLenum;\n readonly ONE_MINUS_SRC_COLOR: GLenum;\n readonly OUT_OF_MEMORY: GLenum;\n readonly PACK_ALIGNMENT: GLenum;\n readonly POINTS: GLenum;\n readonly POLYGON_OFFSET_FACTOR: GLenum;\n readonly POLYGON_OFFSET_FILL: GLenum;\n readonly POLYGON_OFFSET_UNITS: GLenum;\n readonly RED_BITS: GLenum;\n readonly RENDERBUFFER: GLenum;\n readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\n readonly RENDERBUFFER_BINDING: GLenum;\n readonly RENDERBUFFER_BLUE_SIZE: GLenum;\n readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\n readonly RENDERBUFFER_GREEN_SIZE: GLenum;\n readonly RENDERBUFFER_HEIGHT: GLenum;\n readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\n readonly RENDERBUFFER_RED_SIZE: GLenum;\n readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\n readonly RENDERBUFFER_WIDTH: GLenum;\n readonly RENDERER: GLenum;\n readonly REPEAT: GLenum;\n readonly REPLACE: GLenum;\n readonly RGB: GLenum;\n readonly RGB565: GLenum;\n readonly RGB5_A1: GLenum;\n readonly RGBA: GLenum;\n readonly RGBA4: GLenum;\n readonly SAMPLER_2D: GLenum;\n readonly SAMPLER_CUBE: GLenum;\n readonly SAMPLES: GLenum;\n readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\n readonly SAMPLE_BUFFERS: GLenum;\n readonly SAMPLE_COVERAGE: GLenum;\n readonly SAMPLE_COVERAGE_INVERT: GLenum;\n readonly SAMPLE_COVERAGE_VALUE: GLenum;\n readonly SCISSOR_BOX: GLenum;\n readonly SCISSOR_TEST: GLenum;\n readonly SHADER_TYPE: GLenum;\n readonly SHADING_LANGUAGE_VERSION: GLenum;\n readonly SHORT: GLenum;\n readonly SRC_ALPHA: GLenum;\n readonly SRC_ALPHA_SATURATE: GLenum;\n readonly SRC_COLOR: GLenum;\n readonly STATIC_DRAW: GLenum;\n readonly STENCIL_ATTACHMENT: GLenum;\n readonly STENCIL_BACK_FAIL: GLenum;\n readonly STENCIL_BACK_FUNC: GLenum;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\n readonly STENCIL_BACK_REF: GLenum;\n readonly STENCIL_BACK_VALUE_MASK: GLenum;\n readonly STENCIL_BACK_WRITEMASK: GLenum;\n readonly STENCIL_BITS: GLenum;\n readonly STENCIL_BUFFER_BIT: GLenum;\n readonly STENCIL_CLEAR_VALUE: GLenum;\n readonly STENCIL_FAIL: GLenum;\n readonly STENCIL_FUNC: GLenum;\n readonly STENCIL_INDEX8: GLenum;\n readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\n readonly STENCIL_PASS_DEPTH_PASS: GLenum;\n readonly STENCIL_REF: GLenum;\n readonly STENCIL_TEST: GLenum;\n readonly STENCIL_VALUE_MASK: GLenum;\n readonly STENCIL_WRITEMASK: GLenum;\n readonly STREAM_DRAW: GLenum;\n readonly SUBPIXEL_BITS: GLenum;\n readonly TEXTURE: GLenum;\n readonly TEXTURE0: GLenum;\n readonly TEXTURE1: GLenum;\n readonly TEXTURE10: GLenum;\n readonly TEXTURE11: GLenum;\n readonly TEXTURE12: GLenum;\n readonly TEXTURE13: GLenum;\n readonly TEXTURE14: GLenum;\n readonly TEXTURE15: GLenum;\n readonly TEXTURE16: GLenum;\n readonly TEXTURE17: GLenum;\n readonly TEXTURE18: GLenum;\n readonly TEXTURE19: GLenum;\n readonly TEXTURE2: GLenum;\n readonly TEXTURE20: GLenum;\n readonly TEXTURE21: GLenum;\n readonly TEXTURE22: GLenum;\n readonly TEXTURE23: GLenum;\n readonly TEXTURE24: GLenum;\n readonly TEXTURE25: GLenum;\n readonly TEXTURE26: GLenum;\n readonly TEXTURE27: GLenum;\n readonly TEXTURE28: GLenum;\n readonly TEXTURE29: GLenum;\n readonly TEXTURE3: GLenum;\n readonly TEXTURE30: GLenum;\n readonly TEXTURE31: GLenum;\n readonly TEXTURE4: GLenum;\n readonly TEXTURE5: GLenum;\n readonly TEXTURE6: GLenum;\n readonly TEXTURE7: GLenum;\n readonly TEXTURE8: GLenum;\n readonly TEXTURE9: GLenum;\n readonly TEXTURE_2D: GLenum;\n readonly TEXTURE_BINDING_2D: GLenum;\n readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\n readonly TEXTURE_CUBE_MAP: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\n readonly TEXTURE_MAG_FILTER: GLenum;\n readonly TEXTURE_MIN_FILTER: GLenum;\n readonly TEXTURE_WRAP_S: GLenum;\n readonly TEXTURE_WRAP_T: GLenum;\n readonly TRIANGLES: GLenum;\n readonly TRIANGLE_FAN: GLenum;\n readonly TRIANGLE_STRIP: GLenum;\n readonly UNPACK_ALIGNMENT: GLenum;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\n readonly UNPACK_FLIP_Y_WEBGL: GLenum;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\n readonly UNSIGNED_BYTE: GLenum;\n readonly UNSIGNED_INT: GLenum;\n readonly UNSIGNED_SHORT: GLenum;\n readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\n readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\n readonly UNSIGNED_SHORT_5_6_5: GLenum;\n readonly VALIDATE_STATUS: GLenum;\n readonly VENDOR: GLenum;\n readonly VERSION: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\n readonly VERTEX_SHADER: GLenum;\n readonly VIEWPORT: GLenum;\n readonly ZERO: GLenum;\n};\n\ninterface WebGLRenderingContextBase {\n readonly canvas: HTMLCanvasElement;\n readonly drawingBufferHeight: GLsizei;\n readonly drawingBufferWidth: GLsizei;\n activeTexture(texture: GLenum): void;\n attachShader(program: WebGLProgram, shader: WebGLShader): void;\n bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void;\n bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void;\n bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void;\n bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\n bindTexture(target: GLenum, texture: WebGLTexture | null): void;\n blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\n blendEquation(mode: GLenum): void;\n blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void;\n blendFunc(sfactor: GLenum, dfactor: GLenum): void;\n blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void;\n bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void;\n bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void;\n bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void;\n checkFramebufferStatus(target: GLenum): GLenum;\n clear(mask: GLbitfield): void;\n clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void;\n clearDepth(depth: GLclampf): void;\n clearStencil(s: GLint): void;\n colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void;\n compileShader(shader: WebGLShader): void;\n compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void;\n compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void;\n copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void;\n copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\n createBuffer(): WebGLBuffer | null;\n createFramebuffer(): WebGLFramebuffer | null;\n createProgram(): WebGLProgram | null;\n createRenderbuffer(): WebGLRenderbuffer | null;\n createShader(type: GLenum): WebGLShader | null;\n createTexture(): WebGLTexture | null;\n cullFace(mode: GLenum): void;\n deleteBuffer(buffer: WebGLBuffer | null): void;\n deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\n deleteProgram(program: WebGLProgram | null): void;\n deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\n deleteShader(shader: WebGLShader | null): void;\n deleteTexture(texture: WebGLTexture | null): void;\n depthFunc(func: GLenum): void;\n depthMask(flag: GLboolean): void;\n depthRange(zNear: GLclampf, zFar: GLclampf): void;\n detachShader(program: WebGLProgram, shader: WebGLShader): void;\n disable(cap: GLenum): void;\n disableVertexAttribArray(index: GLuint): void;\n drawArrays(mode: GLenum, first: GLint, count: GLsizei): void;\n drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void;\n enable(cap: GLenum): void;\n enableVertexAttribArray(index: GLuint): void;\n finish(): void;\n flush(): void;\n framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void;\n framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void;\n frontFace(mode: GLenum): void;\n generateMipmap(target: GLenum): void;\n getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\n getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null;\n getAttachedShaders(program: WebGLProgram): WebGLShader[] | null;\n getAttribLocation(program: WebGLProgram, name: string): GLint;\n getBufferParameter(target: GLenum, pname: GLenum): any;\n getContextAttributes(): WebGLContextAttributes | null;\n getError(): GLenum;\n getExtension(extensionName: \"EXT_blend_minmax\"): EXT_blend_minmax | null;\n getExtension(extensionName: \"EXT_texture_filter_anisotropic\"): EXT_texture_filter_anisotropic | null;\n getExtension(extensionName: \"EXT_frag_depth\"): EXT_frag_depth | null;\n getExtension(extensionName: \"EXT_shader_texture_lod\"): EXT_shader_texture_lod | null;\n getExtension(extensionName: \"EXT_sRGB\"): EXT_sRGB | null;\n getExtension(extensionName: \"OES_vertex_array_object\"): OES_vertex_array_object | null;\n getExtension(extensionName: \"WEBGL_color_buffer_float\"): WEBGL_color_buffer_float | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_astc\"): WEBGL_compressed_texture_astc | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc_srgb\"): WEBGL_compressed_texture_s3tc_srgb | null;\n getExtension(extensionName: \"WEBGL_debug_shaders\"): WEBGL_debug_shaders | null;\n getExtension(extensionName: \"WEBGL_draw_buffers\"): WEBGL_draw_buffers | null;\n getExtension(extensionName: \"WEBGL_lose_context\"): WEBGL_lose_context | null;\n getExtension(extensionName: \"WEBGL_depth_texture\"): WEBGL_depth_texture | null;\n getExtension(extensionName: \"WEBGL_debug_renderer_info\"): WEBGL_debug_renderer_info | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc\"): WEBGL_compressed_texture_s3tc | null;\n getExtension(extensionName: \"OES_texture_half_float_linear\"): OES_texture_half_float_linear | null;\n getExtension(extensionName: \"OES_texture_half_float\"): OES_texture_half_float | null;\n getExtension(extensionName: \"OES_texture_float_linear\"): OES_texture_float_linear | null;\n getExtension(extensionName: \"OES_texture_float\"): OES_texture_float | null;\n getExtension(extensionName: \"OES_standard_derivatives\"): OES_standard_derivatives | null;\n getExtension(extensionName: \"OES_element_index_uint\"): OES_element_index_uint | null;\n getExtension(extensionName: \"ANGLE_instanced_arrays\"): ANGLE_instanced_arrays | null;\n getExtension(extensionName: string): any;\n getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any;\n getParameter(pname: GLenum): any;\n getProgramInfoLog(program: WebGLProgram): string | null;\n getProgramParameter(program: WebGLProgram, pname: GLenum): any;\n getRenderbufferParameter(target: GLenum, pname: GLenum): any;\n getShaderInfoLog(shader: WebGLShader): string | null;\n getShaderParameter(shader: WebGLShader, pname: GLenum): any;\n getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null;\n getShaderSource(shader: WebGLShader): string | null;\n getSupportedExtensions(): string[] | null;\n getTexParameter(target: GLenum, pname: GLenum): any;\n getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;\n getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null;\n getVertexAttrib(index: GLuint, pname: GLenum): any;\n getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr;\n hint(target: GLenum, mode: GLenum): void;\n isBuffer(buffer: WebGLBuffer | null): GLboolean;\n isContextLost(): boolean;\n isEnabled(cap: GLenum): GLboolean;\n isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean;\n isProgram(program: WebGLProgram | null): GLboolean;\n isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean;\n isShader(shader: WebGLShader | null): GLboolean;\n isTexture(texture: WebGLTexture | null): GLboolean;\n lineWidth(width: GLfloat): void;\n linkProgram(program: WebGLProgram): void;\n pixelStorei(pname: GLenum, param: GLint): void;\n polygonOffset(factor: GLfloat, units: GLfloat): void;\n readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\n renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void;\n sampleCoverage(value: GLclampf, invert: GLboolean): void;\n scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\n shaderSource(shader: WebGLShader, source: string): void;\n stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void;\n stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void;\n stencilMask(mask: GLuint): void;\n stencilMaskSeparate(face: GLenum, mask: GLuint): void;\n stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void;\n stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void;\n texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\n texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\n texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void;\n texParameteri(target: GLenum, pname: GLenum, param: GLint): void;\n texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void;\n texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void;\n uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void;\n uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void;\n uniform1i(location: WebGLUniformLocation | null, x: GLint): void;\n uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void;\n uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void;\n uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void;\n uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void;\n uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void;\n uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void;\n uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void;\n uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void;\n uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void;\n uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\n uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void;\n uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void;\n uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void;\n uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\n uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\n uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void;\n useProgram(program: WebGLProgram | null): void;\n validateProgram(program: WebGLProgram): void;\n vertexAttrib1f(index: GLuint, x: GLfloat): void;\n vertexAttrib1fv(index: GLuint, values: Float32List): void;\n vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void;\n vertexAttrib2fv(index: GLuint, values: Float32List): void;\n vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void;\n vertexAttrib3fv(index: GLuint, values: Float32List): void;\n vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void;\n vertexAttrib4fv(index: GLuint, values: Float32List): void;\n vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void;\n viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;\n readonly ACTIVE_ATTRIBUTES: GLenum;\n readonly ACTIVE_TEXTURE: GLenum;\n readonly ACTIVE_UNIFORMS: GLenum;\n readonly ALIASED_LINE_WIDTH_RANGE: GLenum;\n readonly ALIASED_POINT_SIZE_RANGE: GLenum;\n readonly ALPHA: GLenum;\n readonly ALPHA_BITS: GLenum;\n readonly ALWAYS: GLenum;\n readonly ARRAY_BUFFER: GLenum;\n readonly ARRAY_BUFFER_BINDING: GLenum;\n readonly ATTACHED_SHADERS: GLenum;\n readonly BACK: GLenum;\n readonly BLEND: GLenum;\n readonly BLEND_COLOR: GLenum;\n readonly BLEND_DST_ALPHA: GLenum;\n readonly BLEND_DST_RGB: GLenum;\n readonly BLEND_EQUATION: GLenum;\n readonly BLEND_EQUATION_ALPHA: GLenum;\n readonly BLEND_EQUATION_RGB: GLenum;\n readonly BLEND_SRC_ALPHA: GLenum;\n readonly BLEND_SRC_RGB: GLenum;\n readonly BLUE_BITS: GLenum;\n readonly BOOL: GLenum;\n readonly BOOL_VEC2: GLenum;\n readonly BOOL_VEC3: GLenum;\n readonly BOOL_VEC4: GLenum;\n readonly BROWSER_DEFAULT_WEBGL: GLenum;\n readonly BUFFER_SIZE: GLenum;\n readonly BUFFER_USAGE: GLenum;\n readonly BYTE: GLenum;\n readonly CCW: GLenum;\n readonly CLAMP_TO_EDGE: GLenum;\n readonly COLOR_ATTACHMENT0: GLenum;\n readonly COLOR_BUFFER_BIT: GLenum;\n readonly COLOR_CLEAR_VALUE: GLenum;\n readonly COLOR_WRITEMASK: GLenum;\n readonly COMPILE_STATUS: GLenum;\n readonly COMPRESSED_TEXTURE_FORMATS: GLenum;\n readonly CONSTANT_ALPHA: GLenum;\n readonly CONSTANT_COLOR: GLenum;\n readonly CONTEXT_LOST_WEBGL: GLenum;\n readonly CULL_FACE: GLenum;\n readonly CULL_FACE_MODE: GLenum;\n readonly CURRENT_PROGRAM: GLenum;\n readonly CURRENT_VERTEX_ATTRIB: GLenum;\n readonly CW: GLenum;\n readonly DECR: GLenum;\n readonly DECR_WRAP: GLenum;\n readonly DELETE_STATUS: GLenum;\n readonly DEPTH_ATTACHMENT: GLenum;\n readonly DEPTH_BITS: GLenum;\n readonly DEPTH_BUFFER_BIT: GLenum;\n readonly DEPTH_CLEAR_VALUE: GLenum;\n readonly DEPTH_COMPONENT: GLenum;\n readonly DEPTH_COMPONENT16: GLenum;\n readonly DEPTH_FUNC: GLenum;\n readonly DEPTH_RANGE: GLenum;\n readonly DEPTH_STENCIL: GLenum;\n readonly DEPTH_STENCIL_ATTACHMENT: GLenum;\n readonly DEPTH_TEST: GLenum;\n readonly DEPTH_WRITEMASK: GLenum;\n readonly DITHER: GLenum;\n readonly DONT_CARE: GLenum;\n readonly DST_ALPHA: GLenum;\n readonly DST_COLOR: GLenum;\n readonly DYNAMIC_DRAW: GLenum;\n readonly ELEMENT_ARRAY_BUFFER: GLenum;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum;\n readonly EQUAL: GLenum;\n readonly FASTEST: GLenum;\n readonly FLOAT: GLenum;\n readonly FLOAT_MAT2: GLenum;\n readonly FLOAT_MAT3: GLenum;\n readonly FLOAT_MAT4: GLenum;\n readonly FLOAT_VEC2: GLenum;\n readonly FLOAT_VEC3: GLenum;\n readonly FLOAT_VEC4: GLenum;\n readonly FRAGMENT_SHADER: GLenum;\n readonly FRAMEBUFFER: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum;\n readonly FRAMEBUFFER_BINDING: GLenum;\n readonly FRAMEBUFFER_COMPLETE: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum;\n readonly FRAMEBUFFER_UNSUPPORTED: GLenum;\n readonly FRONT: GLenum;\n readonly FRONT_AND_BACK: GLenum;\n readonly FRONT_FACE: GLenum;\n readonly FUNC_ADD: GLenum;\n readonly FUNC_REVERSE_SUBTRACT: GLenum;\n readonly FUNC_SUBTRACT: GLenum;\n readonly GENERATE_MIPMAP_HINT: GLenum;\n readonly GEQUAL: GLenum;\n readonly GREATER: GLenum;\n readonly GREEN_BITS: GLenum;\n readonly HIGH_FLOAT: GLenum;\n readonly HIGH_INT: GLenum;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum;\n readonly INCR: GLenum;\n readonly INCR_WRAP: GLenum;\n readonly INT: GLenum;\n readonly INT_VEC2: GLenum;\n readonly INT_VEC3: GLenum;\n readonly INT_VEC4: GLenum;\n readonly INVALID_ENUM: GLenum;\n readonly INVALID_FRAMEBUFFER_OPERATION: GLenum;\n readonly INVALID_OPERATION: GLenum;\n readonly INVALID_VALUE: GLenum;\n readonly INVERT: GLenum;\n readonly KEEP: GLenum;\n readonly LEQUAL: GLenum;\n readonly LESS: GLenum;\n readonly LINEAR: GLenum;\n readonly LINEAR_MIPMAP_LINEAR: GLenum;\n readonly LINEAR_MIPMAP_NEAREST: GLenum;\n readonly LINES: GLenum;\n readonly LINE_LOOP: GLenum;\n readonly LINE_STRIP: GLenum;\n readonly LINE_WIDTH: GLenum;\n readonly LINK_STATUS: GLenum;\n readonly LOW_FLOAT: GLenum;\n readonly LOW_INT: GLenum;\n readonly LUMINANCE: GLenum;\n readonly LUMINANCE_ALPHA: GLenum;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum;\n readonly MAX_RENDERBUFFER_SIZE: GLenum;\n readonly MAX_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_TEXTURE_SIZE: GLenum;\n readonly MAX_VARYING_VECTORS: GLenum;\n readonly MAX_VERTEX_ATTRIBS: GLenum;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum;\n readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum;\n readonly MAX_VIEWPORT_DIMS: GLenum;\n readonly MEDIUM_FLOAT: GLenum;\n readonly MEDIUM_INT: GLenum;\n readonly MIRRORED_REPEAT: GLenum;\n readonly NEAREST: GLenum;\n readonly NEAREST_MIPMAP_LINEAR: GLenum;\n readonly NEAREST_MIPMAP_NEAREST: GLenum;\n readonly NEVER: GLenum;\n readonly NICEST: GLenum;\n readonly NONE: GLenum;\n readonly NOTEQUAL: GLenum;\n readonly NO_ERROR: GLenum;\n readonly ONE: GLenum;\n readonly ONE_MINUS_CONSTANT_ALPHA: GLenum;\n readonly ONE_MINUS_CONSTANT_COLOR: GLenum;\n readonly ONE_MINUS_DST_ALPHA: GLenum;\n readonly ONE_MINUS_DST_COLOR: GLenum;\n readonly ONE_MINUS_SRC_ALPHA: GLenum;\n readonly ONE_MINUS_SRC_COLOR: GLenum;\n readonly OUT_OF_MEMORY: GLenum;\n readonly PACK_ALIGNMENT: GLenum;\n readonly POINTS: GLenum;\n readonly POLYGON_OFFSET_FACTOR: GLenum;\n readonly POLYGON_OFFSET_FILL: GLenum;\n readonly POLYGON_OFFSET_UNITS: GLenum;\n readonly RED_BITS: GLenum;\n readonly RENDERBUFFER: GLenum;\n readonly RENDERBUFFER_ALPHA_SIZE: GLenum;\n readonly RENDERBUFFER_BINDING: GLenum;\n readonly RENDERBUFFER_BLUE_SIZE: GLenum;\n readonly RENDERBUFFER_DEPTH_SIZE: GLenum;\n readonly RENDERBUFFER_GREEN_SIZE: GLenum;\n readonly RENDERBUFFER_HEIGHT: GLenum;\n readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum;\n readonly RENDERBUFFER_RED_SIZE: GLenum;\n readonly RENDERBUFFER_STENCIL_SIZE: GLenum;\n readonly RENDERBUFFER_WIDTH: GLenum;\n readonly RENDERER: GLenum;\n readonly REPEAT: GLenum;\n readonly REPLACE: GLenum;\n readonly RGB: GLenum;\n readonly RGB565: GLenum;\n readonly RGB5_A1: GLenum;\n readonly RGBA: GLenum;\n readonly RGBA4: GLenum;\n readonly SAMPLER_2D: GLenum;\n readonly SAMPLER_CUBE: GLenum;\n readonly SAMPLES: GLenum;\n readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum;\n readonly SAMPLE_BUFFERS: GLenum;\n readonly SAMPLE_COVERAGE: GLenum;\n readonly SAMPLE_COVERAGE_INVERT: GLenum;\n readonly SAMPLE_COVERAGE_VALUE: GLenum;\n readonly SCISSOR_BOX: GLenum;\n readonly SCISSOR_TEST: GLenum;\n readonly SHADER_TYPE: GLenum;\n readonly SHADING_LANGUAGE_VERSION: GLenum;\n readonly SHORT: GLenum;\n readonly SRC_ALPHA: GLenum;\n readonly SRC_ALPHA_SATURATE: GLenum;\n readonly SRC_COLOR: GLenum;\n readonly STATIC_DRAW: GLenum;\n readonly STENCIL_ATTACHMENT: GLenum;\n readonly STENCIL_BACK_FAIL: GLenum;\n readonly STENCIL_BACK_FUNC: GLenum;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum;\n readonly STENCIL_BACK_REF: GLenum;\n readonly STENCIL_BACK_VALUE_MASK: GLenum;\n readonly STENCIL_BACK_WRITEMASK: GLenum;\n readonly STENCIL_BITS: GLenum;\n readonly STENCIL_BUFFER_BIT: GLenum;\n readonly STENCIL_CLEAR_VALUE: GLenum;\n readonly STENCIL_FAIL: GLenum;\n readonly STENCIL_FUNC: GLenum;\n readonly STENCIL_INDEX8: GLenum;\n readonly STENCIL_PASS_DEPTH_FAIL: GLenum;\n readonly STENCIL_PASS_DEPTH_PASS: GLenum;\n readonly STENCIL_REF: GLenum;\n readonly STENCIL_TEST: GLenum;\n readonly STENCIL_VALUE_MASK: GLenum;\n readonly STENCIL_WRITEMASK: GLenum;\n readonly STREAM_DRAW: GLenum;\n readonly SUBPIXEL_BITS: GLenum;\n readonly TEXTURE: GLenum;\n readonly TEXTURE0: GLenum;\n readonly TEXTURE1: GLenum;\n readonly TEXTURE10: GLenum;\n readonly TEXTURE11: GLenum;\n readonly TEXTURE12: GLenum;\n readonly TEXTURE13: GLenum;\n readonly TEXTURE14: GLenum;\n readonly TEXTURE15: GLenum;\n readonly TEXTURE16: GLenum;\n readonly TEXTURE17: GLenum;\n readonly TEXTURE18: GLenum;\n readonly TEXTURE19: GLenum;\n readonly TEXTURE2: GLenum;\n readonly TEXTURE20: GLenum;\n readonly TEXTURE21: GLenum;\n readonly TEXTURE22: GLenum;\n readonly TEXTURE23: GLenum;\n readonly TEXTURE24: GLenum;\n readonly TEXTURE25: GLenum;\n readonly TEXTURE26: GLenum;\n readonly TEXTURE27: GLenum;\n readonly TEXTURE28: GLenum;\n readonly TEXTURE29: GLenum;\n readonly TEXTURE3: GLenum;\n readonly TEXTURE30: GLenum;\n readonly TEXTURE31: GLenum;\n readonly TEXTURE4: GLenum;\n readonly TEXTURE5: GLenum;\n readonly TEXTURE6: GLenum;\n readonly TEXTURE7: GLenum;\n readonly TEXTURE8: GLenum;\n readonly TEXTURE9: GLenum;\n readonly TEXTURE_2D: GLenum;\n readonly TEXTURE_BINDING_2D: GLenum;\n readonly TEXTURE_BINDING_CUBE_MAP: GLenum;\n readonly TEXTURE_CUBE_MAP: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum;\n readonly TEXTURE_MAG_FILTER: GLenum;\n readonly TEXTURE_MIN_FILTER: GLenum;\n readonly TEXTURE_WRAP_S: GLenum;\n readonly TEXTURE_WRAP_T: GLenum;\n readonly TRIANGLES: GLenum;\n readonly TRIANGLE_FAN: GLenum;\n readonly TRIANGLE_STRIP: GLenum;\n readonly UNPACK_ALIGNMENT: GLenum;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum;\n readonly UNPACK_FLIP_Y_WEBGL: GLenum;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum;\n readonly UNSIGNED_BYTE: GLenum;\n readonly UNSIGNED_INT: GLenum;\n readonly UNSIGNED_SHORT: GLenum;\n readonly UNSIGNED_SHORT_4_4_4_4: GLenum;\n readonly UNSIGNED_SHORT_5_5_5_1: GLenum;\n readonly UNSIGNED_SHORT_5_6_5: GLenum;\n readonly VALIDATE_STATUS: GLenum;\n readonly VENDOR: GLenum;\n readonly VERSION: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum;\n readonly VERTEX_SHADER: GLenum;\n readonly VIEWPORT: GLenum;\n readonly ZERO: GLenum;\n}\n\ninterface WebGLShader extends WebGLObject {\n}\n\ndeclare var WebGLShader: {\n prototype: WebGLShader;\n new(): WebGLShader;\n};\n\ninterface WebGLShaderPrecisionFormat {\n readonly precision: GLint;\n readonly rangeMax: GLint;\n readonly rangeMin: GLint;\n}\n\ndeclare var WebGLShaderPrecisionFormat: {\n prototype: WebGLShaderPrecisionFormat;\n new(): WebGLShaderPrecisionFormat;\n};\n\ninterface WebGLTexture extends WebGLObject {\n}\n\ndeclare var WebGLTexture: {\n prototype: WebGLTexture;\n new(): WebGLTexture;\n};\n\ninterface WebGLUniformLocation {\n}\n\ndeclare var WebGLUniformLocation: {\n prototype: WebGLUniformLocation;\n new(): WebGLUniformLocation;\n};\n\ninterface WebGLVertexArrayObjectOES extends WebGLObject {\n}\n\ninterface WebKitPoint {\n x: number;\n y: number;\n}\n\ndeclare var WebKitPoint: {\n prototype: WebKitPoint;\n new(x?: number, y?: number): WebKitPoint;\n};\n\ninterface WebSocketEventMap {\n \"close\": CloseEvent;\n \"error\": Event;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface WebSocket extends EventTarget {\n binaryType: BinaryType;\n readonly bufferedAmount: number;\n readonly extensions: string;\n onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;\n onerror: ((this: WebSocket, ev: Event) => any) | null;\n onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;\n onopen: ((this: WebSocket, ev: Event) => any) | null;\n readonly protocol: string;\n readonly readyState: number;\n readonly url: string;\n close(code?: number, reason?: string): void;\n send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var WebSocket: {\n prototype: WebSocket;\n new(url: string, protocols?: string | string[]): WebSocket;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n};\n\ninterface WheelEvent extends MouseEvent {\n readonly deltaMode: number;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly deltaZ: number;\n getCurrentPoint(element: Element): void;\n initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n}\n\ndeclare var WheelEvent: {\n prototype: WheelEvent;\n new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n};\n\ninterface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandlersEventMap {\n \"abort\": UIEvent;\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"compassneedscalibration\": Event;\n \"contextmenu\": MouseEvent;\n \"dblclick\": MouseEvent;\n \"devicelight\": DeviceLightEvent;\n \"devicemotion\": DeviceMotionEvent;\n \"deviceorientation\": DeviceOrientationEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"message\": MessageEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": Event;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSInertiaStart\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"popstate\": PopStateEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": ProgressEvent;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"storage\": StorageEvent;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"unload\": Event;\n \"volumechange\": Event;\n \"vrdisplayactivate\": Event;\n \"vrdisplayblur\": Event;\n \"vrdisplayconnect\": Event;\n \"vrdisplaydeactivate\": Event;\n \"vrdisplaydisconnect\": Event;\n \"vrdisplayfocus\": Event;\n \"vrdisplaypointerrestricted\": Event;\n \"vrdisplaypointerunrestricted\": Event;\n \"vrdisplaypresentchange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch, WindowOrWorkerGlobalScope, WindowEventHandlers {\n Blob: typeof Blob;\n URL: typeof URL;\n URLSearchParams: typeof URLSearchParams;\n readonly applicationCache: ApplicationCache;\n readonly caches: CacheStorage;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\n customElements: CustomElementRegistry;\n defaultStatus: string;\n readonly devicePixelRatio: number;\n readonly doNotTrack: string;\n readonly document: Document;\n readonly event: Event | undefined;\n /** @deprecated */\n readonly external: External;\n readonly frameElement: Element;\n readonly frames: Window;\n readonly history: History;\n readonly innerHeight: number;\n readonly innerWidth: number;\n readonly isSecureContext: boolean;\n readonly length: number;\n location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\n readonly msContentScript: ExtensionScriptApis;\n name: string;\n readonly navigator: Navigator;\n offscreenBuffering: string | boolean;\n oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\n ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\n ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\n ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\n onmousewheel: ((this: Window, ev: Event) => any) | null;\n onmsgesturechange: ((this: Window, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\n onmsgestureend: ((this: Window, ev: Event) => any) | null;\n onmsgesturehold: ((this: Window, ev: Event) => any) | null;\n onmsgesturestart: ((this: Window, ev: Event) => any) | null;\n onmsgesturetap: ((this: Window, ev: Event) => any) | null;\n onmsinertiastart: ((this: Window, ev: Event) => any) | null;\n onmspointercancel: ((this: Window, ev: Event) => any) | null;\n onmspointerdown: ((this: Window, ev: Event) => any) | null;\n onmspointerenter: ((this: Window, ev: Event) => any) | null;\n onmspointerleave: ((this: Window, ev: Event) => any) | null;\n onmspointermove: ((this: Window, ev: Event) => any) | null;\n onmspointerout: ((this: Window, ev: Event) => any) | null;\n onmspointerover: ((this: Window, ev: Event) => any) | null;\n onmspointerup: ((this: Window, ev: Event) => any) | null;\n /** @deprecated */\n onorientationchange: ((this: Window, ev: Event) => any) | null;\n onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\n onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\n onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\n opener: any;\n /** @deprecated */\n readonly orientation: string | number;\n readonly outerHeight: number;\n readonly outerWidth: number;\n readonly pageXOffset: number;\n readonly pageYOffset: number;\n readonly parent: Window;\n readonly performance: Performance;\n readonly personalbar: BarProp;\n readonly screen: Screen;\n readonly screenLeft: number;\n readonly screenTop: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly scrollbars: BarProp;\n readonly self: Window;\n readonly speechSynthesis: SpeechSynthesis;\n status: string;\n readonly statusbar: BarProp;\n readonly styleMedia: StyleMedia;\n readonly toolbar: BarProp;\n readonly top: Window;\n readonly window: Window;\n alert(message?: any): void;\n blur(): void;\n cancelAnimationFrame(handle: number): void;\n /** @deprecated */\n captureEvents(): void;\n close(): void;\n confirm(message?: string): boolean;\n departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n focus(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\n getSelection(): Selection;\n matchMedia(query: string): MediaQueryList;\n moveBy(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n msWriteProfilerMark(profilerMarkName: string): void;\n open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\n postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;\n print(): void;\n prompt(message?: string, _default?: string): string | null;\n /** @deprecated */\n releaseEvents(): void;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n resizeBy(x: number, y: number): void;\n resizeTo(x: number, y: number): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n stop(): void;\n webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\n addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Window: {\n prototype: Window;\n new(): Window;\n};\n\ninterface WindowBase64 {\n atob(encodedString: string): string;\n btoa(rawString: string): string;\n}\n\ninterface WindowConsole {\n readonly console: Console;\n}\n\ninterface WindowEventHandlersEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"hashchange\": HashChangeEvent;\n \"languagechange\": Event;\n \"message\": MessageEvent;\n \"messageerror\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"rejectionhandled\": Event;\n \"storage\": StorageEvent;\n \"unhandledrejection\": PromiseRejectionEvent;\n \"unload\": Event;\n}\n\ninterface WindowEventHandlers {\n onafterprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null;\n onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null;\n onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\n onmessageerror: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\n onoffline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n ononline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;\n onrejectionhandled: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any) | null;\n onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null;\n onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;\n addEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface WindowLocalStorage {\n readonly localStorage: Storage;\n}\n\ninterface WindowOrWorkerGlobalScope {\n readonly caches: CacheStorage;\n readonly crypto: Crypto;\n readonly indexedDB: IDBFactory;\n readonly origin: string;\n readonly performance: Performance;\n atob(data: string): string;\n btoa(data: string): string;\n clearInterval(handle?: number): void;\n clearTimeout(handle?: number): void;\n createImageBitmap(image: ImageBitmapSource): Promise;\n createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise;\n fetch(input: RequestInfo, init?: RequestInit): Promise;\n queueMicrotask(callback: Function): void;\n setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\n setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\n}\n\ninterface WindowSessionStorage {\n readonly sessionStorage: Storage;\n}\n\ninterface WindowTimers {\n}\n\ninterface WorkerEventMap extends AbstractWorkerEventMap {\n \"message\": MessageEvent;\n}\n\ninterface Worker extends EventTarget, AbstractWorker {\n onmessage: ((this: Worker, ev: MessageEvent) => any) | null;\n postMessage(message: any, transfer?: Transferable[]): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Worker: {\n prototype: Worker;\n new(stringUrl: string, options?: WorkerOptions): Worker;\n};\n\ninterface Worklet {\n addModule(moduleURL: string, options?: WorkletOptions): Promise;\n}\n\ndeclare var Worklet: {\n prototype: Worklet;\n new(): Worklet;\n};\n\ninterface WritableStream {\n readonly locked: boolean;\n abort(reason?: any): Promise;\n getWriter(): WritableStreamDefaultWriter;\n}\n\ndeclare var WritableStream: {\n prototype: WritableStream;\n new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;\n};\n\ninterface WritableStreamDefaultController {\n error(error?: any): void;\n}\n\ninterface WritableStreamDefaultWriter {\n readonly closed: Promise;\n readonly desiredSize: number | null;\n readonly ready: Promise;\n abort(reason?: any): Promise;\n close(): Promise;\n releaseLock(): void;\n write(chunk: W): Promise;\n}\n\ninterface XMLDocument extends Document {\n addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLDocument: {\n prototype: XMLDocument;\n new(): XMLDocument;\n};\n\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\n \"readystatechange\": Event;\n}\n\ninterface XMLHttpRequest extends XMLHttpRequestEventTarget {\n onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;\n /**\n * Returns client's state.\n */\n readonly readyState: number;\n /**\n * Returns the response's body.\n */\n readonly response: any;\n /**\n * Returns the text response.\n * Throws an \"InvalidStateError\" DOMException if responseType is not the empty string or \"text\".\n */\n readonly responseText: string;\n /**\n * Returns the response type.\n * Can be set to change the response type. Values are:\n * the empty string (default),\n * \"arraybuffer\",\n * \"blob\",\n * \"document\",\n * \"json\", and\n * \"text\".\n * When set: setting to \"document\" is ignored if current global object is not a Window object.\n * When set: throws an \"InvalidStateError\" DOMException if state is loading or done.\n * When set: throws an \"InvalidAccessError\" DOMException if the synchronous flag is set and current global object is a Window object.\n */\n responseType: XMLHttpRequestResponseType;\n readonly responseURL: string;\n /**\n * Returns the document response.\n * Throws an \"InvalidStateError\" DOMException if responseType is not the empty string or \"document\".\n */\n readonly responseXML: Document | null;\n readonly status: number;\n readonly statusText: string;\n /**\n * Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the\n * request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a\n * \"TimeoutError\" DOMException will be thrown otherwise (for the send() method).\n * When set: throws an \"InvalidAccessError\" DOMException if the synchronous flag is set and current global object is a Window object.\n */\n timeout: number;\n /**\n * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is\n * transferred to a server.\n */\n readonly upload: XMLHttpRequestUpload;\n /**\n * True when credentials are to be included in a cross-origin request. False when they are\n * to be excluded in a cross-origin request and when cookies are to be ignored in its response.\n * Initially false.\n * When set: throws an \"InvalidStateError\" DOMException if state is not unsent or opened, or if the send() flag is set.\n */\n withCredentials: boolean;\n /**\n * Cancels any network activity.\n */\n abort(): void;\n getAllResponseHeaders(): string;\n getResponseHeader(name: string): string | null;\n /**\n * Sets the request method, request URL, and synchronous flag.\n * Throws a \"SyntaxError\" DOMException if either method is not a\n * valid HTTP method or url cannot be parsed.\n * Throws a \"SecurityError\" DOMException if method is a\n * case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.\n * Throws an \"InvalidAccessError\" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.\n */\n open(method: string, url: string): void;\n open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;\n /**\n * Acts as if the `Content-Type` header value for response is mime.\n * (It does not actually change the header though.)\n * Throws an \"InvalidStateError\" DOMException if state is loading or done.\n */\n overrideMimeType(mime: string): void;\n /**\n * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.\n * Throws an \"InvalidStateError\" DOMException if either state is not opened or the send() flag is set.\n */\n send(body?: Document | BodyInit | null): void;\n /**\n * Combines a header in author request headers.\n * Throws an \"InvalidStateError\" DOMException if either state is not opened or the send() flag is set.\n * Throws a \"SyntaxError\" DOMException if name is not a header name\n * or if value is not a header value.\n */\n setRequestHeader(name: string, value: string): void;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequest: {\n prototype: XMLHttpRequest;\n new(): XMLHttpRequest;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n};\n\ninterface XMLHttpRequestEventTargetEventMap {\n \"abort\": ProgressEvent;\n \"error\": ProgressEvent;\n \"load\": ProgressEvent;\n \"loadend\": ProgressEvent;\n \"loadstart\": ProgressEvent;\n \"progress\": ProgressEvent;\n \"timeout\": ProgressEvent;\n}\n\ninterface XMLHttpRequestEventTarget extends EventTarget {\n onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestEventTarget: {\n prototype: XMLHttpRequestEventTarget;\n new(): XMLHttpRequestEventTarget;\n};\n\ninterface XMLHttpRequestUpload extends XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestUpload: {\n prototype: XMLHttpRequestUpload;\n new(): XMLHttpRequestUpload;\n};\n\ninterface XMLSerializer {\n serializeToString(root: Node): string;\n}\n\ndeclare var XMLSerializer: {\n prototype: XMLSerializer;\n new(): XMLSerializer;\n};\n\ninterface XPathEvaluator {\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver?: Node): XPathNSResolver;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | ((prefix: string) => string | null) | null, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathEvaluator: {\n prototype: XPathEvaluator;\n new(): XPathEvaluator;\n};\n\ninterface XPathExpression {\n evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathExpression: {\n prototype: XPathExpression;\n new(): XPathExpression;\n};\n\ninterface XPathNSResolver {\n lookupNamespaceURI(prefix: string): string | null;\n}\n\ndeclare var XPathNSResolver: {\n prototype: XPathNSResolver;\n new(): XPathNSResolver;\n};\n\ninterface XPathResult {\n readonly booleanValue: boolean;\n readonly invalidIteratorState: boolean;\n readonly numberValue: number;\n readonly resultType: number;\n readonly singleNodeValue: Node;\n readonly snapshotLength: number;\n readonly stringValue: string;\n iterateNext(): Node;\n snapshotItem(index: number): Node;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n}\n\ndeclare var XPathResult: {\n prototype: XPathResult;\n new(): XPathResult;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n};\n\ninterface XSLTProcessor {\n clearParameters(): void;\n getParameter(namespaceURI: string, localName: string): any;\n importStylesheet(style: Node): void;\n removeParameter(namespaceURI: string, localName: string): void;\n reset(): void;\n setParameter(namespaceURI: string, localName: string, value: any): void;\n transformToDocument(source: Node): Document;\n transformToFragment(source: Node, document: Document): DocumentFragment;\n}\n\ndeclare var XSLTProcessor: {\n prototype: XSLTProcessor;\n new(): XSLTProcessor;\n};\n\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\n addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\n};\n\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface BlobCallback {\n (blob: Blob | null): void;\n}\n\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\n\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\n\ninterface ErrorEventHandler {\n (event: Event | string, source?: string, fileno?: number, columnNumber?: number, error?: Error): void;\n}\n\ninterface EventHandlerNonNull {\n (event: Event): any;\n}\n\ninterface ForEachCallback {\n (keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, status: MediaKeyStatus): void;\n}\n\ninterface FrameRequestCallback {\n (time: number): void;\n}\n\ninterface FunctionStringCallback {\n (data: string): void;\n}\n\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\n\ninterface MSLaunchUriCallback {\n (): void;\n}\n\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\n\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\n\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\n\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\n\ninterface OnBeforeUnloadEventHandlerNonNull {\n (event: Event): string | null;\n}\n\ninterface OnErrorEventHandlerNonNull {\n (event: Event | string, source?: string, lineno?: number, colno?: number, error?: any): any;\n}\n\ninterface PerformanceObserverCallback {\n (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;\n}\n\ninterface PositionCallback {\n (position: Position): void;\n}\n\ninterface PositionErrorCallback {\n (positionError: PositionError): void;\n}\n\ninterface QueuingStrategySizeCallback {\n (chunk: T): number;\n}\n\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMException): void;\n}\n\ninterface RTCSessionDescriptionCallback {\n (description: RTCSessionDescriptionInit): void;\n}\n\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\n\ninterface ReadableByteStreamControllerCallback {\n (controller: ReadableByteStreamController): void | PromiseLike;\n}\n\ninterface ReadableStreamDefaultControllerCallback {\n (controller: ReadableStreamDefaultController): void | PromiseLike;\n}\n\ninterface ReadableStreamErrorCallback {\n (reason: any): void | PromiseLike;\n}\n\ninterface TransformStreamDefaultControllerCallback {\n (controller: TransformStreamDefaultController): void | PromiseLike;\n}\n\ninterface TransformStreamDefaultControllerTransformCallback {\n (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike;\n}\n\ninterface VoidFunction {\n (): void;\n}\n\ninterface WritableStreamDefaultControllerCloseCallback {\n (): void | PromiseLike;\n}\n\ninterface WritableStreamDefaultControllerStartCallback {\n (controller: WritableStreamDefaultController): void | PromiseLike;\n}\n\ninterface WritableStreamDefaultControllerWriteCallback {\n (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike;\n}\n\ninterface WritableStreamErrorCallback {\n (reason: any): void | PromiseLike;\n}\n\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"abbr\": HTMLElement;\n \"address\": HTMLElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"article\": HTMLElement;\n \"aside\": HTMLElement;\n \"audio\": HTMLAudioElement;\n \"b\": HTMLElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"bdo\": HTMLElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"cite\": HTMLElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"del\": HTMLModElement;\n \"details\": HTMLDetailsElement;\n \"dfn\": HTMLElement;\n \"dialog\": HTMLDialogElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"h1\": HTMLHeadingElement;\n \"h2\": HTMLHeadingElement;\n \"h3\": HTMLHeadingElement;\n \"h4\": HTMLHeadingElement;\n \"h5\": HTMLHeadingElement;\n \"h6\": HTMLHeadingElement;\n \"head\": HTMLHeadElement;\n \"header\": HTMLElement;\n \"hgroup\": HTMLElement;\n \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"i\": HTMLElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"kbd\": HTMLElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nav\": HTMLElement;\n \"noscript\": HTMLElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"output\": HTMLOutputElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"rt\": HTMLElement;\n \"ruby\": HTMLElement;\n \"s\": HTMLElement;\n \"samp\": HTMLElement;\n \"script\": HTMLScriptElement;\n \"section\": HTMLElement;\n \"select\": HTMLSelectElement;\n \"slot\": HTMLSlotElement;\n \"small\": HTMLElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"time\": HTMLTimeElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"wbr\": HTMLElement;\n}\n\ninterface HTMLElementDeprecatedTagNameMap {\n \"listing\": HTMLPreElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface SVGElementTagNameMap {\n \"circle\": SVGCircleElement;\n \"clipPath\": SVGClipPathElement;\n \"defs\": SVGDefsElement;\n \"desc\": SVGDescElement;\n \"ellipse\": SVGEllipseElement;\n \"feBlend\": SVGFEBlendElement;\n \"feColorMatrix\": SVGFEColorMatrixElement;\n \"feComponentTransfer\": SVGFEComponentTransferElement;\n \"feComposite\": SVGFECompositeElement;\n \"feConvolveMatrix\": SVGFEConvolveMatrixElement;\n \"feDiffuseLighting\": SVGFEDiffuseLightingElement;\n \"feDisplacementMap\": SVGFEDisplacementMapElement;\n \"feDistantLight\": SVGFEDistantLightElement;\n \"feFlood\": SVGFEFloodElement;\n \"feFuncA\": SVGFEFuncAElement;\n \"feFuncB\": SVGFEFuncBElement;\n \"feFuncG\": SVGFEFuncGElement;\n \"feFuncR\": SVGFEFuncRElement;\n \"feGaussianBlur\": SVGFEGaussianBlurElement;\n \"feImage\": SVGFEImageElement;\n \"feMerge\": SVGFEMergeElement;\n \"feMergeNode\": SVGFEMergeNodeElement;\n \"feMorphology\": SVGFEMorphologyElement;\n \"feOffset\": SVGFEOffsetElement;\n \"fePointLight\": SVGFEPointLightElement;\n \"feSpecularLighting\": SVGFESpecularLightingElement;\n \"feSpotLight\": SVGFESpotLightElement;\n \"feTile\": SVGFETileElement;\n \"feTurbulence\": SVGFETurbulenceElement;\n \"filter\": SVGFilterElement;\n \"foreignObject\": SVGForeignObjectElement;\n \"g\": SVGGElement;\n \"image\": SVGImageElement;\n \"line\": SVGLineElement;\n \"linearGradient\": SVGLinearGradientElement;\n \"marker\": SVGMarkerElement;\n \"mask\": SVGMaskElement;\n \"metadata\": SVGMetadataElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"radialGradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\n \"stop\": SVGStopElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"text\": SVGTextElement;\n \"textPath\": SVGTextPathElement;\n \"tspan\": SVGTSpanElement;\n \"use\": SVGUseElement;\n \"view\": SVGViewElement;\n}\n\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }\n\ndeclare var Audio: {\n new(src?: string): HTMLAudioElement;\n};\ndeclare var Image: {\n new(width?: number, height?: number): HTMLImageElement;\n};\ndeclare var Option: {\n new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement;\n};\ndeclare var Blob: typeof Blob;\ndeclare var URL: typeof URL;\ndeclare var URLSearchParams: typeof URLSearchParams;\ndeclare var applicationCache: ApplicationCache;\ndeclare var caches: CacheStorage;\ndeclare var clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\ndeclare var customElements: CustomElementRegistry;\ndeclare var defaultStatus: string;\ndeclare var devicePixelRatio: number;\ndeclare var doNotTrack: string;\ndeclare var document: Document;\ndeclare var event: Event | undefined;\n/** @deprecated */\ndeclare var external: External;\ndeclare var frameElement: Element;\ndeclare var frames: Window;\ndeclare var history: History;\ndeclare var innerHeight: number;\ndeclare var innerWidth: number;\ndeclare var isSecureContext: boolean;\ndeclare var length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\ndeclare var msContentScript: ExtensionScriptApis;\ndeclare const name: never;\ndeclare var navigator: Navigator;\ndeclare var offscreenBuffering: string | boolean;\ndeclare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\ndeclare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\ndeclare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\ndeclare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\ndeclare var onmousewheel: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgestureend: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturehold: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturestart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturetap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsinertiastart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointercancel: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerdown: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerenter: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerleave: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointermove: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerout: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerover: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerup: ((this: Window, ev: Event) => any) | null;\n/** @deprecated */\ndeclare var onorientationchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\ndeclare var onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\ndeclare var opener: any;\n/** @deprecated */\ndeclare var orientation: string | number;\ndeclare var outerHeight: number;\ndeclare var outerWidth: number;\ndeclare var pageXOffset: number;\ndeclare var pageYOffset: number;\ndeclare var parent: Window;\ndeclare var performance: Performance;\ndeclare var personalbar: BarProp;\ndeclare var screen: Screen;\ndeclare var screenLeft: number;\ndeclare var screenTop: number;\ndeclare var screenX: number;\ndeclare var screenY: number;\ndeclare var scrollX: number;\ndeclare var scrollY: number;\ndeclare var scrollbars: BarProp;\ndeclare var self: Window;\ndeclare var speechSynthesis: SpeechSynthesis;\ndeclare var status: string;\ndeclare var statusbar: BarProp;\ndeclare var styleMedia: StyleMedia;\ndeclare var toolbar: BarProp;\ndeclare var top: Window;\ndeclare var window: Window;\ndeclare function alert(message?: any): void;\ndeclare function blur(): void;\ndeclare function cancelAnimationFrame(handle: number): void;\n/** @deprecated */\ndeclare function captureEvents(): void;\ndeclare function close(): void;\ndeclare function confirm(message?: string): boolean;\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\ndeclare function focus(): void;\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\ndeclare function getSelection(): Selection;\ndeclare function matchMedia(query: string): MediaQueryList;\ndeclare function moveBy(x: number, y: number): void;\ndeclare function moveTo(x: number, y: number): void;\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;\ndeclare function print(): void;\ndeclare function prompt(message?: string, _default?: string): string | null;\n/** @deprecated */\ndeclare function releaseEvents(): void;\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function resizeBy(x: number, y: number): void;\ndeclare function resizeTo(x: number, y: number): void;\ndeclare function scroll(options?: ScrollToOptions): void;\ndeclare function scroll(x: number, y: number): void;\ndeclare function scrollBy(options?: ScrollToOptions): void;\ndeclare function scrollBy(x: number, y: number): void;\ndeclare function scrollTo(options?: ScrollToOptions): void;\ndeclare function scrollTo(x: number, y: number): void;\ndeclare function stop(): void;\ndeclare function webkitCancelAnimationFrame(handle: number): void;\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function toString(): string;\n/**\n * Dispatches a synthetic event event to target and returns true\n * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n */\ndeclare function dispatchEvent(event: Event): boolean;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var console: Console;\n/**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\ndeclare var onabort: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onanimationcancel: ((this: Window, ev: AnimationEvent) => any) | null;\ndeclare var onanimationend: ((this: Window, ev: AnimationEvent) => any) | null;\ndeclare var onanimationiteration: ((this: Window, ev: AnimationEvent) => any) | null;\ndeclare var onanimationstart: ((this: Window, ev: AnimationEvent) => any) | null;\ndeclare var onauxclick: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\ndeclare var onblur: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var oncancel: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\ndeclare var oncanplay: ((this: Window, ev: Event) => any) | null;\ndeclare var oncanplaythrough: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\ndeclare var onchange: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\ndeclare var onclick: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onclose: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\ndeclare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var oncuechange: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\ndeclare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\ndeclare var ondrag: ((this: Window, ev: DragEvent) => any) | null;\n/**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\ndeclare var ondragend: ((this: Window, ev: DragEvent) => any) | null;\n/**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\ndeclare var ondragenter: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragexit: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\ndeclare var ondragleave: ((this: Window, ev: DragEvent) => any) | null;\n/**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\ndeclare var ondragover: ((this: Window, ev: DragEvent) => any) | null;\n/**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\ndeclare var ondragstart: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondrop: ((this: Window, ev: DragEvent) => any) | null;\n/**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\ndeclare var ondurationchange: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\ndeclare var onemptied: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\ndeclare var onended: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\ndeclare var onerror: ErrorEventHandler;\n/**\n * Fires when the object receives focus.\n * @param ev The event.\n */\ndeclare var onfocus: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var ongotpointercapture: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var oninput: ((this: Window, ev: Event) => any) | null;\ndeclare var oninvalid: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\ndeclare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\n/**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\ndeclare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\n/**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\ndeclare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\n/**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\ndeclare var onload: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\ndeclare var onloadeddata: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\ndeclare var onloadedmetadata: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadend: ((this: Window, ev: ProgressEvent) => any) | null;\n/**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\ndeclare var onloadstart: ((this: Window, ev: Event) => any) | null;\ndeclare var onlostpointercapture: ((this: Window, ev: PointerEvent) => any) | null;\n/**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\ndeclare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\ndeclare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\ndeclare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\ndeclare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\ndeclare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\n/**\n * Occurs when playback is paused.\n * @param ev The event.\n */\ndeclare var onpause: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\ndeclare var onplay: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\ndeclare var onplaying: ((this: Window, ev: Event) => any) | null;\ndeclare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerleave: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointermove: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerout: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerover: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerup: ((this: Window, ev: PointerEvent) => any) | null;\n/**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\ndeclare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\n/**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\ndeclare var onratechange: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the user resets a form.\n * @param ev The event.\n */\ndeclare var onreset: ((this: Window, ev: Event) => any) | null;\ndeclare var onresize: ((this: Window, ev: UIEvent) => any) | null;\n/**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\ndeclare var onscroll: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onsecuritypolicyviolation: ((this: Window, ev: SecurityPolicyViolationEvent) => any) | null;\n/**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\ndeclare var onseeked: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\ndeclare var onseeking: ((this: Window, ev: Event) => any) | null;\n/**\n * Fires when the current selection changes.\n * @param ev The event.\n */\ndeclare var onselect: ((this: Window, ev: UIEvent) => any) | null;\n/**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\ndeclare var onstalled: ((this: Window, ev: Event) => any) | null;\ndeclare var onsubmit: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\ndeclare var onsuspend: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\ndeclare var ontimeupdate: ((this: Window, ev: Event) => any) | null;\ndeclare var ontoggle: ((this: Window, ev: Event) => any) | null;\ndeclare var ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null;\ndeclare var ontouchend: ((this: Window, ev: TouchEvent) => any) | null;\ndeclare var ontouchmove: ((this: Window, ev: TouchEvent) => any) | null;\ndeclare var ontouchstart: ((this: Window, ev: TouchEvent) => any) | null;\ndeclare var ontransitioncancel: ((this: Window, ev: TransitionEvent) => any) | null;\ndeclare var ontransitionend: ((this: Window, ev: TransitionEvent) => any) | null;\ndeclare var ontransitionrun: ((this: Window, ev: TransitionEvent) => any) | null;\ndeclare var ontransitionstart: ((this: Window, ev: TransitionEvent) => any) | null;\n/**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\ndeclare var onvolumechange: ((this: Window, ev: Event) => any) | null;\n/**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\ndeclare var onwaiting: ((this: Window, ev: Event) => any) | null;\ndeclare var onwheel: ((this: Window, ev: WheelEvent) => any) | null;\ndeclare var indexedDB: IDBFactory;\ndeclare function atob(encodedString: string): string;\ndeclare function btoa(rawString: string): string;\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise;\ndeclare var caches: CacheStorage;\ndeclare var crypto: Crypto;\ndeclare var indexedDB: IDBFactory;\ndeclare var origin: string;\ndeclare var performance: Performance;\ndeclare function atob(data: string): string;\ndeclare function btoa(data: string): string;\ndeclare function clearInterval(handle?: number): void;\ndeclare function clearTimeout(handle?: number): void;\ndeclare function createImageBitmap(image: ImageBitmapSource): Promise;\ndeclare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise;\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise;\ndeclare function queueMicrotask(callback: Function): void;\ndeclare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\ndeclare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var onafterprint: ((this: Window, ev: Event) => any) | null;\ndeclare var onbeforeprint: ((this: Window, ev: Event) => any) | null;\ndeclare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\ndeclare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\ndeclare var onlanguagechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onmessage: ((this: Window, ev: MessageEvent) => any) | null;\ndeclare var onmessageerror: ((this: Window, ev: MessageEvent) => any) | null;\ndeclare var onoffline: ((this: Window, ev: Event) => any) | null;\ndeclare var ononline: ((this: Window, ev: Event) => any) | null;\ndeclare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\ndeclare var onrejectionhandled: ((this: Window, ev: Event) => any) | null;\ndeclare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;\ndeclare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null;\ndeclare var onunload: ((this: Window, ev: Event) => any) | null;\ndeclare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\ndeclare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\ntype BlobPart = BufferSource | Blob | string;\ntype HeadersInit = Headers | string[][] | Record;\ntype BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;\ntype RequestInfo = Request | string;\ntype DOMHighResTimeStamp = number;\ntype RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext;\ntype HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;\ntype CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap;\ntype MessageEventSource = WindowProxy | MessagePort | ServiceWorker;\ntype HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;\ntype ImageBitmapSource = CanvasImageSource | Blob | ImageData;\ntype OnErrorEventHandler = OnErrorEventHandlerNonNull | null;\ntype OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;\ntype TimerHandler = string | Function;\ntype PerformanceEntryList = PerformanceEntry[];\ntype VibratePattern = number | number[];\ntype AlgorithmIdentifier = string | Algorithm;\ntype HashAlgorithmIdentifier = AlgorithmIdentifier;\ntype BigInteger = Uint8Array;\ntype NamedCurve = string;\ntype GLenum = number;\ntype GLboolean = boolean;\ntype GLbitfield = number;\ntype GLint = number;\ntype GLsizei = number;\ntype GLintptr = number;\ntype GLsizeiptr = number;\ntype GLuint = number;\ntype GLfloat = number;\ntype GLclampf = number;\ntype TexImageSource = ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;\ntype Float32List = Float32Array | GLfloat[];\ntype Int32List = Int32Array | GLint[];\ntype BufferSource = ArrayBufferView | ArrayBuffer;\ntype DOMTimeStamp = number;\ntype LineAndPositionSetting = number | AutoKeyword;\ntype FormDataEntryValue = File | string;\ntype InsertPosition = \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\";\ntype IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;\ntype MutationRecordType = \"attributes\" | \"characterData\" | \"childList\";\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\ntype ConstrainDouble = number | ConstrainDoubleRange;\ntype ConstrainLong = number | ConstrainLongRange;\ntype IDBKeyPath = string;\ntype Transferable = ArrayBuffer | MessagePort | ImageBitmap;\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\n/** @deprecated */\ntype MouseWheelEvent = WheelEvent;\ntype WindowProxy = Window;\ntype AlignSetting = \"start\" | \"center\" | \"end\" | \"left\" | \"right\";\ntype AnimationPlayState = \"idle\" | \"running\" | \"paused\" | \"finished\";\ntype AppendMode = \"segments\" | \"sequence\";\ntype AudioContextLatencyCategory = \"balanced\" | \"interactive\" | \"playback\";\ntype AudioContextState = \"suspended\" | \"running\" | \"closed\";\ntype AutoKeyword = \"auto\";\ntype AutomationRate = \"a-rate\" | \"k-rate\";\ntype BinaryType = \"blob\" | \"arraybuffer\";\ntype BiquadFilterType = \"lowpass\" | \"highpass\" | \"bandpass\" | \"lowshelf\" | \"highshelf\" | \"peaking\" | \"notch\" | \"allpass\";\ntype CanPlayTypeResult = \"\" | \"maybe\" | \"probably\";\ntype CanvasDirection = \"ltr\" | \"rtl\" | \"inherit\";\ntype CanvasFillRule = \"nonzero\" | \"evenodd\";\ntype CanvasLineCap = \"butt\" | \"round\" | \"square\";\ntype CanvasLineJoin = \"round\" | \"bevel\" | \"miter\";\ntype CanvasTextAlign = \"start\" | \"end\" | \"left\" | \"right\" | \"center\";\ntype CanvasTextBaseline = \"top\" | \"hanging\" | \"middle\" | \"alphabetic\" | \"ideographic\" | \"bottom\";\ntype ChannelCountMode = \"max\" | \"clamped-max\" | \"explicit\";\ntype ChannelInterpretation = \"speakers\" | \"discrete\";\ntype ClientTypes = \"window\" | \"worker\" | \"sharedworker\" | \"all\";\ntype CompositeOperation = \"replace\" | \"add\" | \"accumulate\";\ntype CompositeOperationOrAuto = \"replace\" | \"add\" | \"accumulate\" | \"auto\";\ntype DirectionSetting = \"\" | \"rl\" | \"lr\";\ntype DisplayCaptureSurfaceType = \"monitor\" | \"window\" | \"application\" | \"browser\";\ntype DistanceModelType = \"linear\" | \"inverse\" | \"exponential\";\ntype DocumentReadyState = \"loading\" | \"interactive\" | \"complete\";\ntype EndOfStreamError = \"network\" | \"decode\";\ntype EndingType = \"transparent\" | \"native\";\ntype FillMode = \"none\" | \"forwards\" | \"backwards\" | \"both\" | \"auto\";\ntype GamepadHand = \"\" | \"left\" | \"right\";\ntype GamepadHapticActuatorType = \"vibration\";\ntype GamepadInputEmulationType = \"mouse\" | \"keyboard\" | \"gamepad\";\ntype GamepadMappingType = \"\" | \"standard\";\ntype IDBCursorDirection = \"next\" | \"nextunique\" | \"prev\" | \"prevunique\";\ntype IDBRequestReadyState = \"pending\" | \"done\";\ntype IDBTransactionMode = \"readonly\" | \"readwrite\" | \"versionchange\";\ntype ImageSmoothingQuality = \"low\" | \"medium\" | \"high\";\ntype IterationCompositeOperation = \"replace\" | \"accumulate\";\ntype KeyFormat = \"raw\" | \"spki\" | \"pkcs8\" | \"jwk\";\ntype KeyType = \"public\" | \"private\" | \"secret\";\ntype KeyUsage = \"encrypt\" | \"decrypt\" | \"sign\" | \"verify\" | \"deriveKey\" | \"deriveBits\" | \"wrapKey\" | \"unwrapKey\";\ntype LineAlignSetting = \"start\" | \"center\" | \"end\";\ntype ListeningState = \"inactive\" | \"active\" | \"disambiguation\";\ntype MSCredentialType = \"FIDO_2_0\";\ntype MSTransportType = \"Embedded\" | \"USB\" | \"NFC\" | \"BT\";\ntype MSWebViewPermissionState = \"unknown\" | \"defer\" | \"allow\" | \"deny\";\ntype MSWebViewPermissionType = \"geolocation\" | \"unlimitedIndexedDBQuota\" | \"media\" | \"pointerlock\" | \"webnotifications\";\ntype MediaDeviceKind = \"audioinput\" | \"audiooutput\" | \"videoinput\";\ntype MediaKeyMessageType = \"license-request\" | \"license-renewal\" | \"license-release\" | \"individualization-request\";\ntype MediaKeySessionType = \"temporary\" | \"persistent-license\" | \"persistent-release-message\";\ntype MediaKeyStatus = \"usable\" | \"expired\" | \"output-downscaled\" | \"output-not-allowed\" | \"status-pending\" | \"internal-error\";\ntype MediaKeysRequirement = \"required\" | \"optional\" | \"not-allowed\";\ntype MediaStreamTrackState = \"live\" | \"ended\";\ntype NavigationReason = \"up\" | \"down\" | \"left\" | \"right\";\ntype NavigationType = \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\";\ntype NotificationDirection = \"auto\" | \"ltr\" | \"rtl\";\ntype NotificationPermission = \"default\" | \"denied\" | \"granted\";\ntype OrientationLockType = \"any\" | \"natural\" | \"landscape\" | \"portrait\" | \"portrait-primary\" | \"portrait-secondary\" | \"landscape-primary\" | \"landscape-secondary\";\ntype OrientationType = \"portrait-primary\" | \"portrait-secondary\" | \"landscape-primary\" | \"landscape-secondary\";\ntype OscillatorType = \"sine\" | \"square\" | \"sawtooth\" | \"triangle\" | \"custom\";\ntype OverSampleType = \"none\" | \"2x\" | \"4x\";\ntype PanningModelType = \"equalpower\" | \"HRTF\";\ntype PaymentComplete = \"success\" | \"fail\" | \"unknown\";\ntype PaymentShippingType = \"shipping\" | \"delivery\" | \"pickup\";\ntype PlaybackDirection = \"normal\" | \"reverse\" | \"alternate\" | \"alternate-reverse\";\ntype PositionAlignSetting = \"line-left\" | \"center\" | \"line-right\" | \"auto\";\ntype PushEncryptionKeyName = \"p256dh\" | \"auth\";\ntype PushPermissionState = \"denied\" | \"granted\" | \"prompt\";\ntype RTCBundlePolicy = \"balanced\" | \"max-compat\" | \"max-bundle\";\ntype RTCDataChannelState = \"connecting\" | \"open\" | \"closing\" | \"closed\";\ntype RTCDegradationPreference = \"maintain-framerate\" | \"maintain-resolution\" | \"balanced\";\ntype RTCDtlsRole = \"auto\" | \"client\" | \"server\";\ntype RTCDtlsTransportState = \"new\" | \"connecting\" | \"connected\" | \"closed\" | \"failed\";\ntype RTCDtxStatus = \"disabled\" | \"enabled\";\ntype RTCErrorDetailType = \"data-channel-failure\" | \"dtls-failure\" | \"fingerprint-failure\" | \"idp-bad-script-failure\" | \"idp-execution-failure\" | \"idp-load-failure\" | \"idp-need-login\" | \"idp-timeout\" | \"idp-tls-failure\" | \"idp-token-expired\" | \"idp-token-invalid\" | \"sctp-failure\" | \"sdp-syntax-error\" | \"hardware-encoder-not-available\" | \"hardware-encoder-error\";\ntype RTCIceCandidateType = \"host\" | \"srflx\" | \"prflx\" | \"relay\";\ntype RTCIceComponent = \"rtp\" | \"rtcp\";\ntype RTCIceConnectionState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"failed\" | \"closed\";\ntype RTCIceCredentialType = \"password\" | \"oauth\";\ntype RTCIceGatherPolicy = \"all\" | \"nohost\" | \"relay\";\ntype RTCIceGathererState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatheringState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceProtocol = \"udp\" | \"tcp\";\ntype RTCIceRole = \"controlling\" | \"controlled\";\ntype RTCIceTcpCandidateType = \"active\" | \"passive\" | \"so\";\ntype RTCIceTransportPolicy = \"relay\" | \"all\";\ntype RTCIceTransportState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"failed\" | \"closed\";\ntype RTCPeerConnectionState = \"new\" | \"connecting\" | \"connected\" | \"disconnected\" | \"failed\" | \"closed\";\ntype RTCPriorityType = \"very-low\" | \"low\" | \"medium\" | \"high\";\ntype RTCRtcpMuxPolicy = \"negotiate\" | \"require\";\ntype RTCRtpTransceiverDirection = \"sendrecv\" | \"sendonly\" | \"recvonly\" | \"inactive\";\ntype RTCSctpTransportState = \"connecting\" | \"connected\" | \"closed\";\ntype RTCSdpType = \"offer\" | \"pranswer\" | \"answer\" | \"rollback\";\ntype RTCSignalingState = \"stable\" | \"have-local-offer\" | \"have-remote-offer\" | \"have-local-pranswer\" | \"have-remote-pranswer\" | \"closed\";\ntype RTCStatsIceCandidatePairState = \"frozen\" | \"waiting\" | \"inprogress\" | \"failed\" | \"succeeded\" | \"cancelled\";\ntype RTCStatsIceCandidateType = \"host\" | \"serverreflexive\" | \"peerreflexive\" | \"relayed\";\ntype RTCStatsType = \"inboundrtp\" | \"outboundrtp\" | \"session\" | \"datachannel\" | \"track\" | \"transport\" | \"candidatepair\" | \"localcandidate\" | \"remotecandidate\";\ntype ReadyState = \"closed\" | \"open\" | \"ended\";\ntype ReferrerPolicy = \"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-only\" | \"origin-when-cross-origin\" | \"unsafe-url\";\ntype RequestCache = \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\" | \"only-if-cached\";\ntype RequestCredentials = \"omit\" | \"same-origin\" | \"include\";\ntype RequestDestination = \"\" | \"audio\" | \"audioworklet\" | \"document\" | \"embed\" | \"font\" | \"image\" | \"manifest\" | \"object\" | \"paintworklet\" | \"report\" | \"script\" | \"sharedworker\" | \"style\" | \"track\" | \"video\" | \"worker\" | \"xslt\";\ntype RequestMode = \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\ntype RequestRedirect = \"follow\" | \"error\" | \"manual\";\ntype ResponseType = \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\";\ntype ScopedCredentialType = \"ScopedCred\";\ntype ScrollBehavior = \"auto\" | \"smooth\";\ntype ScrollLogicalPosition = \"start\" | \"center\" | \"end\" | \"nearest\";\ntype ScrollRestoration = \"auto\" | \"manual\";\ntype ScrollSetting = \"\" | \"up\";\ntype SelectionMode = \"select\" | \"start\" | \"end\" | \"preserve\";\ntype ServiceWorkerState = \"installing\" | \"installed\" | \"activating\" | \"activated\" | \"redundant\";\ntype ServiceWorkerUpdateViaCache = \"imports\" | \"all\" | \"none\";\ntype ShadowRootMode = \"open\" | \"closed\";\ntype SpeechRecognitionErrorCode = \"no-speech\" | \"aborted\" | \"audio-capture\" | \"network\" | \"not-allowed\" | \"service-not-allowed\" | \"bad-grammar\" | \"language-not-supported\";\ntype SpeechSynthesisErrorCode = \"canceled\" | \"interrupted\" | \"audio-busy\" | \"audio-hardware\" | \"network\" | \"synthesis-unavailable\" | \"synthesis-failed\" | \"language-unavailable\" | \"voice-unavailable\" | \"text-too-long\" | \"invalid-argument\";\ntype SupportedType = \"text/html\" | \"text/xml\" | \"application/xml\" | \"application/xhtml+xml\" | \"image/svg+xml\";\ntype TextTrackKind = \"subtitles\" | \"captions\" | \"descriptions\" | \"chapters\" | \"metadata\";\ntype TextTrackMode = \"disabled\" | \"hidden\" | \"showing\";\ntype TouchType = \"direct\" | \"stylus\";\ntype Transport = \"usb\" | \"nfc\" | \"ble\";\ntype VRDisplayEventReason = \"mounted\" | \"navigation\" | \"requested\" | \"unmounted\";\ntype VideoFacingModeEnum = \"user\" | \"environment\" | \"left\" | \"right\";\ntype VisibilityState = \"hidden\" | \"visible\" | \"prerender\";\ntype WebGLPowerPreference = \"default\" | \"low-power\" | \"high-performance\";\ntype WorkerType = \"classic\" | \"module\";\ntype XMLHttpRequestResponseType = \"\" | \"arraybuffer\" | \"blob\" | \"document\" | \"json\" | \"text\";\n"; -export const lib_es5_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface Symbol {\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): symbol;\n}\n\ndeclare type PropertyKey = string | number | symbol;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: PropertyKey): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: PropertyKey): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\ninterface CallableFunction extends Function {\n /**\n * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args An array of argument values to be passed to the function.\n */\n apply(this: (this: T) => R, thisArg: T): R;\n apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;\n\n /**\n * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args Argument values to be passed to the function.\n */\n call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg The object to be used as the this object.\n * @param args Arguments to bind to the parameters of the function.\n */\n bind(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R;\n bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;\n bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;\n}\n\ninterface NewableFunction extends Function {\n /**\n * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args An array of argument values to be passed to the function.\n */\n apply(this: new () => T, thisArg: T): void;\n apply(this: new (...args: A) => T, thisArg: T, args: A): void;\n\n /**\n * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args Argument values to be passed to the function.\n */\n call(this: new (...args: A) => T, thisArg: T, ...args: A): void;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg The object to be used as the this object.\n * @param args Arguments to bind to the parameters of the function.\n */\n bind(this: new (...args: A) => R, thisArg: any): new (...args: A) => R;\n bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;\n bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;\n}\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\n/**\n * The type of `import.meta`.\n * \n * If you need to declare that a given property exists on `import.meta`,\n * this type may be augmented via interface merging.\n */\ninterface ImportMeta {\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number | string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T required\n */\ntype Required = {\n [P in keyof T]-?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T, pick a set of properties whose keys are in the union K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Exclude from T those types that are assignable to U\n */\ntype Exclude = T extends U ? never : T;\n\n/**\n * Extract from T those types that are assignable to U\n */\ntype Extract = T extends U ? T : never;\n\n/**\n * Exclude null and undefined from T\n */\ntype NonNullable = T extends null | undefined ? never : T;\n\n/**\n * Obtain the parameters of a function type in a tuple\n */\ntype Parameters any> = T extends (...args: infer P) => any ? P : never;\n\n/**\n * Obtain the parameters of a constructor function type in a tuple\n */\ntype ConstructorParameters any> = T extends new (...args: infer P) => any ? P : never;\n\n/**\n * Obtain the return type of a function type\n */\ntype ReturnType any> = T extends (...args: any[]) => infer R ? R : any;\n\n/**\n * Obtain the return type of a constructor function type\n */\ntype InstanceType any> = T extends new (...args: any[]) => infer R ? R : any;\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n"; +export const lib_es5_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface Symbol {\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): symbol;\n}\n\ndeclare type PropertyKey = string | number | symbol;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: PropertyKey): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: PropertyKey): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\n/**\n * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.\n */\ntype ThisParameterType = T extends (this: unknown, ...args: any[]) => any ? unknown : T extends (this: infer U, ...args: any[]) => any ? U : unknown;\n\n/**\n * Removes the 'this' parameter from a function type.\n */\ntype OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;\n\ninterface CallableFunction extends Function {\n /**\n * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args An array of argument values to be passed to the function.\n */\n apply(this: (this: T) => R, thisArg: T): R;\n apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;\n\n /**\n * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args Argument values to be passed to the function.\n */\n call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg The object to be used as the this object.\n * @param args Arguments to bind to the parameters of the function.\n */\n bind(this: T, thisArg: ThisParameterType): OmitThisParameter;\n bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;\n bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;\n bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;\n}\n\ninterface NewableFunction extends Function {\n /**\n * Calls the function with the specified object as the this value and the elements of specified array as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args An array of argument values to be passed to the function.\n */\n apply(this: new () => T, thisArg: T): void;\n apply(this: new (...args: A) => T, thisArg: T, args: A): void;\n\n /**\n * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.\n * @param thisArg The object to be used as the this object.\n * @param args Argument values to be passed to the function.\n */\n call(this: new (...args: A) => T, thisArg: T, ...args: A): void;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg The object to be used as the this object.\n * @param args Arguments to bind to the parameters of the function.\n */\n bind(this: T, thisArg: any): T;\n bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;\n bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;\n bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;\n}\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\n/**\n * The type of `import.meta`.\n *\n * If you need to declare that a given property exists on `import.meta`,\n * this type may be augmented via interface merging.\n */\ninterface ImportMeta {\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number | string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T required\n */\ntype Required = {\n [P in keyof T]-?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T, pick a set of properties whose keys are in the union K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Exclude from T those types that are assignable to U\n */\ntype Exclude = T extends U ? never : T;\n\n/**\n * Extract from T those types that are assignable to U\n */\ntype Extract = T extends U ? T : never;\n\n/**\n * Exclude null and undefined from T\n */\ntype NonNullable = T extends null | undefined ? never : T;\n\n/**\n * Obtain the parameters of a function type in a tuple\n */\ntype Parameters any> = T extends (...args: infer P) => any ? P : never;\n\n/**\n * Obtain the parameters of a constructor function type in a tuple\n */\ntype ConstructorParameters any> = T extends new (...args: infer P) => any ? P : never;\n\n/**\n * Obtain the return type of a function type\n */\ntype ReturnType any> = T extends (...args: any[]) => infer R ? R : any;\n\n/**\n * Obtain the return type of a constructor function type\n */\ntype InstanceType any> = T extends new (...args: any[]) => infer R ? R : any;\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n */\n from(arrayLike: ArrayLike): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n"; export const lib_es2015_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n" + lib_es5_dts + "" + lib_es2015_core_dts + "" + lib_es2015_collection_dts + "" + lib_es2015_generator_dts + "" + lib_es2015_promise_dts + "" + lib_es2015_iterable_dts + "" + lib_es2015_proxy_dts + "" + lib_es2015_reflect_dts + "" + lib_es2015_symbol_dts + "" + lib_es2015_symbol_wellknown_dts + ""; diff --git a/src/lib/typescriptServices-amd.js b/src/lib/typescriptServices-amd.js index 56bb3070..242b41ab 100644 --- a/src/lib/typescriptServices-amd.js +++ b/src/lib/typescriptServices-amd.js @@ -73,9 +73,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".2"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -1267,6 +1267,18 @@ var ts; return result; } ts.extend = extend; + function copyProperties(first, second) { + for (var id in second) { + if (hasOwnProperty.call(second, id)) { + first[id] = second[id]; + } + } + } + ts.copyProperties = copyProperties; + function maybeBind(obj, fn) { + return fn ? fn.bind(obj) : undefined; + } + ts.maybeBind = maybeBind; function createMultiMap() { var map = createMap(); map.add = multiMapAdd; @@ -1985,7 +1997,11 @@ var ts; } ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; function fill(length, cb) { - return new Array(length).fill(0).map(function (_, i) { return cb(i); }); + var result = Array(length); + for (var i = 0; i < length; i++) { + result[i] = cb(i); + } + return result; } ts.fill = fill; })(ts || (ts = {})); @@ -3242,15 +3258,17 @@ var ts; CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; - CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; - CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; - CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; - CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; - CheckFlags[CheckFlags["Late"] = 1024] = "Late"; - CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; - CheckFlags[CheckFlags["OptionalParameter"] = 4096] = "OptionalParameter"; - CheckFlags[CheckFlags["RestParameter"] = 8192] = "RestParameter"; + CheckFlags[CheckFlags["HasLiteralType"] = 64] = "HasLiteralType"; + CheckFlags[CheckFlags["ContainsPublic"] = 128] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 256] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 512] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 1024] = "ContainsStatic"; + CheckFlags[CheckFlags["Late"] = 2048] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 4096] = "ReverseMapped"; + CheckFlags[CheckFlags["OptionalParameter"] = 8192] = "OptionalParameter"; + CheckFlags[CheckFlags["RestParameter"] = 16384] = "RestParameter"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + CheckFlags[CheckFlags["Discriminant"] = 96] = "Discriminant"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; (function (InternalSymbolName) { @@ -4002,6 +4020,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + /* @internal */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + ts.generateDjb2Hash = generateDjb2Hash; /** * Set a high stack trace limit to provide more information in case of an error. * Called for command-line and server use cases. @@ -4643,6 +4671,9 @@ var ts; Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), use_strict_directive_used_here: diag(1349, ts.DiagnosticCategory.Error, "use_strict_directive_used_here_1349", "'use strict' directive used here."), Print_the_final_configuration_instead_of_building: diag(1350, ts.DiagnosticCategory.Message, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), + An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, ts.DiagnosticCategory.Error, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), + A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts.DiagnosticCategory.Error, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), + A_bigint_literal_must_be_an_integer: diag(1353, ts.DiagnosticCategory.Error, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -4798,8 +4829,6 @@ var ts; Type_alias_0_circularly_references_itself: diag(2456, ts.DiagnosticCategory.Error, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), Type_alias_name_cannot_be_0: diag(2457, ts.DiagnosticCategory.Error, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, ts.DiagnosticCategory.Error, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), - Type_0_has_no_property_1_and_no_string_index_signature: diag(2459, ts.DiagnosticCategory.Error, "Type_0_has_no_property_1_and_no_string_index_signature_2459", "Type '{0}' has no property '{1}' and no string index signature."), - Type_0_has_no_property_1: diag(2460, ts.DiagnosticCategory.Error, "Type_0_has_no_property_1_2460", "Type '{0}' has no property '{1}'."), Type_0_is_not_an_array_type: diag(2461, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, ts.DiagnosticCategory.Error, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), @@ -4813,7 +4842,7 @@ var ts; A_computed_property_name_of_the_form_0_must_be_of_type_symbol: diag(2471, ts.DiagnosticCategory.Error, "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471", "A computed property name of the form '{0}' must be of type 'symbol'."), Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), - In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), + const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, ts.DiagnosticCategory.Error, "const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474", "const enum member initializers can only contain literal values and other computed enum values."), const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), @@ -4829,11 +4858,11 @@ var ts; The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: diag(2490, ts.DiagnosticCategory.Error, "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the 'next()' method of an iterator must have a 'value' property."), The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, ts.DiagnosticCategory.Error, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: diag(2493, ts.DiagnosticCategory.Error, "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'."), + Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, ts.DiagnosticCategory.Error, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, ts.DiagnosticCategory.Error, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), Type_0_is_not_an_array_type_or_a_string_type: diag(2495, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, ts.DiagnosticCategory.Error, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496", "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."), - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: diag(2497, ts.DiagnosticCategory.Error, "Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct_2497", "Module '{0}' resolves to a non-module entity and cannot be imported using this construct."), + This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, ts.DiagnosticCategory.Error, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, ts.DiagnosticCategory.Error, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), @@ -4903,7 +4932,6 @@ var ts; Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), - Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2568, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568", "Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators."), Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."), Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: diag(2570, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570", "Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?"), Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), @@ -4998,7 +5026,7 @@ var ts; Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, ts.DiagnosticCategory.Error, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), Type_parameter_0_has_a_circular_default: diag(2716, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), - Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), + Duplicate_property_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_property_0_2718", "Duplicate property '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), @@ -5013,6 +5041,7 @@ var ts; An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), + Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), It_is_highly_likely_that_you_are_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "It_is_highly_likely_that_you_are_missing_a_semicolon_2734", "It is highly likely that you are missing a semicolon."), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), @@ -5022,6 +5051,11 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), + No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, ts.DiagnosticCategory.Error, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), + Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, ts.DiagnosticCategory.Error, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), + This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), + This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), + _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5371,6 +5405,7 @@ var ts; Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6368, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6368", "Build all projects, including those that appear to be up to date"), Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), + Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts.DiagnosticCategory.Message, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -5449,6 +5484,7 @@ var ts; JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, ts.DiagnosticCategory.Error, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), You_cannot_rename_a_module_via_a_global_import: diag(8031, ts.DiagnosticCategory.Error, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), + Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause."), class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, "class_expressions_are_not_currently_supported_9003", "'class' expressions are not currently supported."), Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, "Language_service_is_disabled_9004", "Language service is disabled."), @@ -5585,6 +5621,7 @@ var ts; Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), + Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), }; })(ts || (ts = {})); var ts; @@ -5809,16 +5846,13 @@ var ts; return result; } ts.computeLineStarts = computeLineStarts; - function getPositionOfLineAndCharacter(sourceFile, line, character) { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); + function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) { + return sourceFile.getPositionOfLineAndCharacter ? + sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : + computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); - } - ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; - /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { if (allowEdits) { @@ -6295,6 +6329,7 @@ var ts; scanJsxIdentifier: scanJsxIdentifier, scanJsxAttributeValue: scanJsxAttributeValue, reScanJsxToken: reScanJsxToken, + reScanLessThanToken: reScanLessThanToken, scanJsxToken: scanJsxToken, scanJSDocToken: scanJSDocToken, scan: scan, @@ -6394,6 +6429,7 @@ var ts; result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } if (decimalFragment !== undefined || tokenFlags & 16 /* Scientific */) { + checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & 16 /* Scientific */)); return { type: 8 /* NumericLiteral */, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -6402,9 +6438,29 @@ var ts; else { tokenValue = result; var type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint + checkForIdentifierStartAfterNumericLiteral(start); return { type: type, value: tokenValue }; } } + function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { + if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) { + return; + } + var identifierStart = pos; + var length = scanIdentifierParts().length; + if (length === 1 && text[identifierStart] === "n") { + if (isScientific) { + error(ts.Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); + } + else { + error(ts.Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); + } + } + else { + error(ts.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + pos = identifierStart; + } + } function scanOctalDigits() { var start = pos; while (isOctalDigit(text.charCodeAt(pos))) { @@ -7270,6 +7326,13 @@ var ts; pos = tokenPos = startPos; return token = scanJsxToken(); } + function reScanLessThanToken() { + if (token === 46 /* LessThanLessThanToken */) { + pos = tokenPos + 1; + return token = 28 /* LessThanToken */; + } + return token; + } function scanJsxToken() { startPos = tokenPos = pos; if (pos >= end) { @@ -8206,7 +8269,9 @@ var ts; case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); case 149 /* ComputedPropertyName */: - return isStringOrNumericLiteralLike(name.expression) ? ts.escapeLeadingUnderscores(name.expression.text) : undefined; // TODO: GH#18217 Almost all uses of this assume the result to be defined! + if (isStringOrNumericLiteralLike(name.expression)) + return ts.escapeLeadingUnderscores(name.expression.text); + return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); default: return ts.Debug.assertNever(name); } @@ -8313,7 +8378,7 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, node.pos); } var isMissing = nodeIsMissing(errorNode); - var pos = isMissing + var pos = isMissing || ts.isJsxText(node) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); // These asserts should all be satisfied for a properly constructed `errorNode`. @@ -9508,6 +9573,7 @@ var ts; return node.initializer; } } + ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration = getSingleInitializerOfVariableStatementOrPropertyDeclaration; function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) ? ts.firstOrUndefined(node.declarationList.declarations) : undefined; } @@ -11546,10 +11612,10 @@ var ts; } if (getCheckFlags(s) & 6 /* Synthetic */) { var checkFlags = s.checkFlags; - var accessModifier = checkFlags & 256 /* ContainsPrivate */ ? 8 /* Private */ : - checkFlags & 64 /* ContainsPublic */ ? 4 /* Public */ : + var accessModifier = checkFlags & 512 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 128 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */; - var staticModifier = checkFlags & 512 /* ContainsStatic */ ? 32 /* Static */ : 0; + var staticModifier = checkFlags & 1024 /* ContainsStatic */ ? 32 /* Static */ : 0; return accessModifier | staticModifier; } if (s.flags & 4194304 /* Prototype */) { @@ -11796,6 +11862,10 @@ var ts; || kind === 290 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; + function isAccessExpression(node) { + return node.kind === 189 /* PropertyAccessExpression */ || node.kind === 190 /* ElementAccessExpression */; + } + ts.isAccessExpression = isAccessExpression; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -14674,6 +14744,8 @@ var ts; return path; } ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; function comparePathsWorker(a, b, componentComparer) { if (a === b) return 0 /* EqualTo */; @@ -14681,14 +14753,30 @@ var ts; return -1 /* LessThan */; if (b === undefined) return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, ts.getRootLength(a)); + var bRoot = b.substring(0, ts.getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. var aComponents = ts.reducePathComponents(ts.getPathComponents(a)); var bComponents = ts.reducePathComponents(ts.getPathComponents(b)); var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 0; i < sharedLength; i++) { - var stringComparer = i === 0 ? ts.compareStringsCaseInsensitive : componentComparer; - var result = stringComparer(aComponents[i], bComponents[i]); - if (result !== 0 /* EqualTo */) { - return result; + for (var i = 1; i < sharedLength; i++) { + var result_1 = componentComparer(aComponents[i], bComponents[i]); + if (result_1 !== 0 /* EqualTo */) { + return result_1; } } return ts.compareValues(aComponents.length, bComponents.length); @@ -16180,15 +16268,15 @@ var ts; if (setParentNodes === void 0) { setParentNodes = false; } scriptKind = ts.ensureScriptKind(fileName, scriptKind); if (scriptKind === 6 /* JSON */) { - var result_1 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes); - ts.convertToObjectWorker(result_1, result_1.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined); - result_1.referencedFiles = ts.emptyArray; - result_1.typeReferenceDirectives = ts.emptyArray; - result_1.libReferenceDirectives = ts.emptyArray; - result_1.amdDependencies = ts.emptyArray; - result_1.hasNoDefaultLib = false; - result_1.pragmas = ts.emptyMap; - return result_1; + var result_2 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes); + ts.convertToObjectWorker(result_2, result_2.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined); + result_2.referencedFiles = ts.emptyArray; + result_2.typeReferenceDirectives = ts.emptyArray; + result_2.libReferenceDirectives = ts.emptyArray; + result_2.amdDependencies = ts.emptyArray; + result_2.hasNoDefaultLib = false; + result_2.pragmas = ts.emptyMap; + return result_2; } initializeState(sourceText, languageVersion, syntaxCursor, scriptKind); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind); @@ -16529,6 +16617,9 @@ var ts; function reScanTemplateToken() { return currentToken = scanner.reScanTemplateToken(); } + function reScanLessThanToken() { + return currentToken = scanner.reScanLessThanToken(); + } function scanJsxIdentifier() { return currentToken = scanner.scanJsxIdentifier(); } @@ -17067,6 +17158,8 @@ var ts; return parseElement(); } function currentNode(parsingContext) { + // If we don't have a cursor or the parsing context isn't reusable, there's nothing to reuse. + // // If there is an outstanding parse error that we've encountered, but not attached to // some node, then we cannot get a node from the old source tree. This is because we // want to mark the next node we encounter as being unusable. @@ -17074,25 +17167,15 @@ var ts; // Note: This may be too conservative. Perhaps we could reuse the node and set the bit // on it (or its leftmost child) as having the error. For now though, being conservative // is nice and likely won't ever affect perf. - if (parseErrorBeforeNextFinishedNode) { - return undefined; - } - if (!syntaxCursor) { - // if we don't have a cursor, we could never return a node from the old tree. + if (!syntaxCursor || !isReusableParsingContext(parsingContext) || parseErrorBeforeNextFinishedNode) { return undefined; } var node = syntaxCursor.currentNode(scanner.getStartPos()); // Can't reuse a missing node. - if (ts.nodeIsMissing(node)) { - return undefined; - } // Can't reuse a node that intersected the change range. - if (node.intersectsChange) { - return undefined; - } // Can't reuse a node that contains a parse error. This is necessary so that we // produce the same set of errors again. - if (ts.containsParseError(node)) { + if (ts.nodeIsMissing(node) || node.intersectsChange || ts.containsParseError(node)) { return undefined; } // We can only reuse a node if it was parsed under the same strict mode that we're @@ -17127,6 +17210,22 @@ var ts; nextToken(); return node; } + function isReusableParsingContext(parsingContext) { + switch (parsingContext) { + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + return true; + } + return false; + } function canReuseNode(node, parsingContext) { switch (parsingContext) { case 5 /* ClassMembers */: @@ -17146,22 +17245,20 @@ var ts; case 17 /* JSDocParameters */: case 16 /* Parameters */: return isReusableParameter(node); - case 18 /* RestProperties */: - return false; // Any other lists we do not care about reusing nodes in. But feel free to add if // you can do so safely. Danger areas involve nodes that may involve speculative // parsing. If speculative parsing is involved with the node, then the range the // parser reached while looking ahead might be in the edited range (see the example // in canReuseVariableDeclaratorNode for a good case of this). - case 22 /* HeritageClauses */: + // case ParsingContext.HeritageClauses: // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. - case 19 /* TypeParameters */: + // case ParsingContext.TypeParameters: // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in // unambiguous *type* contexts. While type *arguments* occur in very ambiguous // *expression* contexts. - case 21 /* TupleElementTypes */: + // case ParsingContext.TupleElementTypes: // This would probably be safe to reuse. There is no speculative parsing with // tuple types. // Technically, type argument list types are probably safe to reuse. While @@ -17169,24 +17266,24 @@ var ts; // produced from speculative parsing a < as a type argument list), we only have // the types because speculative parsing succeeded. Thus, the lookahead never // went past the end of the list and rewound. - case 20 /* TypeArguments */: + // case ParsingContext.TypeArguments: // Note: these are almost certainly not safe to ever reuse. Expressions commonly // need a large amount of lookahead, and we should not reuse them as they may // have actually intersected the edit. - case 11 /* ArgumentExpressions */: + // case ParsingContext.ArgumentExpressions: // This is not safe to reuse for the same reason as the 'AssignmentExpression' // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. - case 12 /* ObjectLiteralMembers */: + // case ParsingContext.ObjectLiteralMembers: // This is probably not safe to reuse. There can be speculative parsing with // type names in a heritage clause. There can be generic names in the type // name list, and there can be left hand side expressions (which can have type // arguments.) - case 7 /* HeritageClauseElement */: + // case ParsingContext.HeritageClauseElement: // Perhaps safe to reuse, but it's unlikely we'd see more than a dozen attributes // on any given element. Same for children. - case 13 /* JsxAttributes */: - case 14 /* JsxChildren */: + // case ParsingContext.JsxAttributes: + // case ParsingContext.JsxChildren: } return false; } @@ -17534,7 +17631,7 @@ var ts; function parseTypeReference() { var node = createNode(164 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); - if (!scanner.hasPrecedingLineBreak() && token() === 28 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 28 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 28 /* LessThanToken */, 30 /* GreaterThanToken */); } return finishNode(node); @@ -19556,7 +19653,8 @@ var ts; function parseCallExpressionRest(expression) { while (true) { expression = parseMemberExpressionRest(expression); - if (token() === 28 /* LessThanToken */) { + // handle 'foo<()' + if (token() === 28 /* LessThanToken */ || token() === 46 /* LessThanLessThanToken */) { // See if this is the start of a generic invocation. If so, consume it and // keep checking for postfix expressions. Otherwise, it's just a '<' that's // part of an arithmetic expression. Break out so we consume it higher in the @@ -19593,9 +19691,10 @@ var ts; return result; } function parseTypeArgumentsInExpression() { - if (!parseOptional(28 /* LessThanToken */)) { + if (reScanLessThanToken() !== 28 /* LessThanToken */) { return undefined; } + nextToken(); var typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (!parseExpected(30 /* GreaterThanToken */)) { // If it doesn't have the closing `>` then it's definitely not an type argument list. @@ -22416,17 +22515,18 @@ var ts; var libReferenceDirectives_1 = context.libReferenceDirectives; ts.forEach(ts.toArray(entryOrList), function (arg) { // TODO: GH#18217 + var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path; if (arg.arguments["no-default-lib"]) { context.hasNoDefaultLib = true; } - else if (arg.arguments.types) { - typeReferenceDirectives_1.push({ pos: arg.arguments.types.pos, end: arg.arguments.types.end, fileName: arg.arguments.types.value }); + else if (types) { + typeReferenceDirectives_1.push({ pos: types.pos, end: types.end, fileName: types.value }); } - else if (arg.arguments.lib) { - libReferenceDirectives_1.push({ pos: arg.arguments.lib.pos, end: arg.arguments.lib.end, fileName: arg.arguments.lib.value }); + else if (lib) { + libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value }); } - else if (arg.arguments.path) { - referencedFiles_1.push({ pos: arg.arguments.path.pos, end: arg.arguments.path.end, fileName: arg.arguments.path.value }); + else if (path) { + referencedFiles_1.push({ pos: path.pos, end: path.end, fileName: path.value }); } else { reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, ts.Diagnostics.Invalid_reference_directive_syntax); @@ -24103,7 +24203,7 @@ var ts; var config = __assign({ compilerOptions: __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) { var _a; return (__assign({}, prev, (_a = {}, _a[cur[0]] = cur[1], _a))); - }, {}), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined }), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign({}, r, { path: r.originalPath, originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (configParseResult.configFileSpecs ? { + }, {}), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined, build: undefined, version: undefined }), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign({}, r, { path: r.originalPath, originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (configParseResult.configFileSpecs ? { include: filterSameAsDefaultInclude(configParseResult.configFileSpecs.validatedIncludeSpecs), exclude: configParseResult.configFileSpecs.validatedExcludeSpecs } : {}), { compilerOnSave: !!configParseResult.compileOnSave ? true : undefined }); @@ -24137,7 +24237,7 @@ var ts; return function (_) { return true; }; } function getCustomTypeMapOfCommandLineOption(optionDefinition) { - if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { + if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean" || optionDefinition.type === "object") { // this is of a type CommandLineOptionOfPrimitiveType return undefined; } @@ -24294,7 +24394,7 @@ var ts; result.push(tab + "}"); } result.push("}"); - return result.join(newLine); + return result.join(newLine) + newLine; } } ts.generateTSConfig = generateTSConfig; @@ -26467,6 +26567,7 @@ var ts; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; })(ContainerFlags || (ContainerFlags = {})); + var flowNodeCreated = ts.identity; var binder = createBinder(); function bindSourceFile(file, options) { ts.performance.mark("beforeBind"); @@ -26579,6 +26680,10 @@ var ts; if (symbolFlags & (32 /* Class */ | 64 /* Interface */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && !symbol.members) { symbol.members = ts.createSymbolTable(); } + // On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate) + if (symbol.constEnumOnlyModule && (symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */))) { + symbol.constEnumOnlyModule = false; + } if (symbolFlags & 67220415 /* Value */) { setValueDeclaration(symbol, node); } @@ -26851,6 +26956,7 @@ var ts; blockScopeContainer.locals = undefined; } if (containerFlags & 4 /* IsControlFlowContainer */) { + var saveFlowNodeCreated = flowNodeCreated; var saveCurrentFlow = currentFlow; var saveBreakTarget = currentBreakTarget; var saveContinueTarget = currentContinueTarget; @@ -26874,6 +26980,7 @@ var ts; currentContinueTarget = undefined; activeLabels = undefined; hasExplicitReturn = false; + flowNodeCreated = ts.identity; bindChildren(node); // Reset all reachability check related flags on node (for incremental scenarios) node.flags &= ~1408 /* ReachabilityAndEmitFlags */; @@ -26900,6 +27007,7 @@ var ts; currentReturnTarget = saveReturnTarget; activeLabels = saveActiveLabels; hasExplicitReturn = saveHasExplicitReturn; + flowNodeCreated = saveFlowNodeCreated; } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; @@ -27067,7 +27175,7 @@ var ts; } function isNarrowableReference(expr) { return expr.kind === 72 /* Identifier */ || expr.kind === 100 /* ThisKeyword */ || expr.kind === 98 /* SuperKeyword */ || - ts.isPropertyAccessExpression(expr) && isNarrowableReference(expr.expression) || + (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || ts.isElementAccessExpression(expr) && expr.argumentExpression && (ts.isStringLiteral(expr.argumentExpression) || ts.isNumericLiteral(expr.argumentExpression)) && isNarrowableReference(expr.expression); @@ -27163,22 +27271,22 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { flags: flags, expression: expression, antecedent: antecedent }; + return flowNodeCreated({ flags: flags, expression: expression, antecedent: antecedent }); } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; + return flowNodeCreated({ flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }); } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { flags: 16 /* Assignment */, antecedent: antecedent, node: node }; + return flowNodeCreated({ flags: 16 /* Assignment */, antecedent: antecedent, node: node }); } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - var res = { flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }; + var res = flowNodeCreated({ flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }); return res; } function finishFlowLabel(flow) { @@ -27366,18 +27474,50 @@ var ts; function bindTryStatement(node) { var preFinallyLabel = createBranchLabel(); var preTryFlow = currentFlow; - // TODO: Every statement in try block is potentially an exit point! + var tryPriors = []; + var oldFlowNodeCreated = flowNodeCreated; + // We hook the creation of all flow nodes within the `try` scope and store them so we can add _all_ of them + // as possible antecedents of the start of the `catch` or `finally` blocks. + // Don't bother intercepting the call if there's no finally or catch block that needs the information + if (node.catchClause || node.finallyBlock) { + flowNodeCreated = function (node) { return (tryPriors.push(node), node); }; + } bind(node.tryBlock); + flowNodeCreated = oldFlowNodeCreated; addAntecedent(preFinallyLabel, currentFlow); var flowAfterTry = currentFlow; var flowAfterCatch = unreachableFlow; if (node.catchClause) { currentFlow = preTryFlow; + if (tryPriors.length) { + var preCatchFlow = createBranchLabel(); + addAntecedent(preCatchFlow, currentFlow); + for (var _i = 0, tryPriors_1 = tryPriors; _i < tryPriors_1.length; _i++) { + var p = tryPriors_1[_i]; + addAntecedent(preCatchFlow, p); + } + currentFlow = finishFlowLabel(preCatchFlow); + } bind(node.catchClause); addAntecedent(preFinallyLabel, currentFlow); flowAfterCatch = currentFlow; } if (node.finallyBlock) { + // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block + // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will + // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; + if (!node.catchClause) { + if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); + for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { + var p = tryPriors_2[_a]; + addAntecedent(preFinallyFlow_1, p); + } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); + } + } // in finally flow is combined from pre-try/flow from try/flow from catch // pre-flow is necessary to make sure that finally is reachable even if finally flows in both try and finally blocks are unreachable // also for finally blocks we inject two extra edges into the flow graph. @@ -27404,7 +27544,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -27422,7 +27562,7 @@ var ts; } } if (!(currentFlow.flags & 1 /* Unreachable */)) { - var afterFinallyFlow = { flags: 4096 /* AfterFinally */, antecedent: currentFlow }; + var afterFinallyFlow = flowNodeCreated({ flags: 4096 /* AfterFinally */, antecedent: currentFlow }); preFinallyFlow.lock = afterFinallyFlow; currentFlow = afterFinallyFlow; } @@ -30511,10 +30651,10 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); - var markerSuperType = createType(262144 /* TypeParameter */); - var markerSubType = createType(262144 /* TypeParameter */); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - var markerOtherType = createType(262144 /* TypeParameter */); + var markerOtherType = createTypeParameter(); var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); @@ -30704,7 +30844,6 @@ var ts; var _jsxFactoryEntity; var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); - var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); @@ -31422,13 +31561,18 @@ var ts; } } break; + case 197 /* ArrowFunction */: + // when targeting ES6 or higher there is no 'arguments' in an arrow function + // for lower compile targets the resolved symbol is used to emit an error + if (compilerOptions.target >= 2 /* ES2015 */) { + break; + } + // falls through case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: case 157 /* Constructor */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -31562,7 +31706,8 @@ var ts; } // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 67220415 /* Value */) === 67220415 /* Value */ && !(originalLocation.flags & 2097152 /* JSDoc */)) { - if (ts.some(result.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) { + var merged = getMergedSymbol(result); + if (ts.length(merged.declarations) && ts.every(merged.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); // TODO: GH#18217 } } @@ -32322,7 +32467,10 @@ var ts; var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 279 /* SourceFile */)) { - error(referencingLocation, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 + ? "allowSyntheticDefaultImports" + : "esModuleInterop"; + error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); return symbol; } if (compilerOptions.esModuleInterop) { @@ -32617,6 +32765,12 @@ var ts; function createTypeofType() { return getUnionType(ts.arrayFrom(typeofEQFacts.keys(), getLiteralType)); } + function createTypeParameter(symbol) { + var type = createType(262144 /* TypeParameter */); + if (symbol) + type.symbol = symbol; + return type; + } // A reserved member name starts with two underscores, but the third character cannot be an underscore // or the @ symbol. A third underscore indicates an escaped form of an identifer that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES @@ -33570,12 +33724,12 @@ var ts; return ts.createKeywordTypeNode(120 /* AnyKeyword */); } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 4096 /* ReverseMapped */); var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; - if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { + if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 2048 /* Late */) { var decl = ts.first(propertySymbol.declarations); if (hasLateBindableName(decl)) { trackComputedName(decl.name, saveEnclosingDeclaration, context); @@ -33748,7 +33902,7 @@ var ts; } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined; - var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192 /* RestParameter */; + var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 16384 /* RestParameter */; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -33757,7 +33911,7 @@ var ts; cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); - var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 4096 /* OptionalParameter */; + var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192 /* OptionalParameter */; var questionToken = isOptional ? ts.createToken(56 /* QuestionToken */) : undefined; var parameterNode = ts.createParameter( /*decorators*/ undefined, modifiers, dotDotDotToken, name, questionToken, parameterTypeNode, @@ -34153,6 +34307,21 @@ var ts; function isDefaultBindingContext(location) { return location.kind === 279 /* SourceFile */ || ts.isAmbientModule(location); } + function getNameOfSymbolFromNameType(symbol, context) { + var nameType = symbol.nameType; + if (nameType) { + if (nameType.flags & 384 /* StringOrNumberLiteral */) { + var name = "" + nameType.value; + if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) { + return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + } + return name; + } + if (nameType.flags & 8192 /* UniqueESSymbol */) { + return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]"; + } + } + } /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -34172,12 +34341,19 @@ var ts; } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; - var name = ts.getNameOfDeclaration(declaration); - if (name) { + var name_2 = ts.getNameOfDeclaration(declaration); + if (name_2) { if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) { return ts.symbolName(symbol); } - return ts.declarationNameToString(name); + if (ts.isComputedPropertyName(name_2) && !(ts.getCheckFlags(symbol) & 2048 /* Late */) && symbol.nameType && symbol.nameType.flags & 384 /* StringOrNumberLiteral */) { + // Computed property name isn't late bound, but has a well-known name type - use name type to generate a symbol name + var result = getNameOfSymbolFromNameType(symbol, context); + if (result !== undefined) { + return result; + } + } + return ts.declarationNameToString(name_2); } if (declaration.parent && declaration.parent.kind === 237 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); @@ -34192,16 +34368,8 @@ var ts; return declaration.kind === 209 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } - var nameType = symbol.nameType; - if (nameType) { - if (nameType.flags & 128 /* StringLiteral */ && !ts.isIdentifierText(nameType.value, compilerOptions.target)) { - return "\"" + ts.escapeString(nameType.value, 34 /* doubleQuote */) + "\""; - } - if (nameType && nameType.flags & 8192 /* UniqueESSymbol */) { - return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]"; - } - } - return ts.symbolName(symbol); + var name = getNameOfSymbolFromNameType(symbol, context); + return name !== undefined ? name : ts.symbolName(symbol); } function isDeclarationVisible(node) { if (node) { @@ -34421,6 +34589,9 @@ var ts; var prop = getPropertyOfType(type, name); return prop ? getTypeOfSymbol(prop) : undefined; } + function getTypeOfPropertyOrIndexSignature(type, name) { + return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || unknownType; + } function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; } @@ -34467,6 +34638,64 @@ var ts; var numberIndexInfo = getIndexInfoOfType(source, 1 /* Number */); return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); } + // Determine the control flow type associated with a destructuring declaration or assignment. The following + // forms of destructuring are possible: + // let { x } = obj; // BindingElement + // let [ x ] = obj; // BindingElement + // { x } = obj; // ShorthandPropertyAssignment + // { x: v } = obj; // PropertyAssignment + // [ x ] = obj; // Expression + // We construct a synthetic element access expression corresponding to 'obj.x' such that the control + // flow analyzer doesn't have to handle all the different syntactic forms. + function getFlowTypeOfDestructuring(node, declaredType) { + var reference = getSyntheticElementAccess(node); + return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; + } + function getSyntheticElementAccess(node) { + var parentAccess = getParentElementAccess(node); + if (parentAccess && parentAccess.flowNode) { + var propName = getDestructuringPropertyName(node); + if (propName) { + var result = ts.createNode(190 /* ElementAccessExpression */, node.pos, node.end); + result.parent = node; + result.expression = parentAccess; + var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); + literal.parent = result; + literal.text = propName; + result.argumentExpression = literal; + result.flowNode = parentAccess.flowNode; + return result; + } + } + } + function getParentElementAccess(node) { + var ancestor = node.parent.parent; + switch (ancestor.kind) { + case 186 /* BindingElement */: + case 275 /* PropertyAssignment */: + return getSyntheticElementAccess(ancestor); + case 187 /* ArrayLiteralExpression */: + return getSyntheticElementAccess(node.parent); + case 237 /* VariableDeclaration */: + return ancestor.initializer; + case 204 /* BinaryExpression */: + return ancestor.right; + } + } + function getDestructuringPropertyName(node) { + var parent = node.parent; + if (node.kind === 186 /* BindingElement */ && parent.kind === 184 /* ObjectBindingPattern */) { + return getLiteralPropertyNameText(node.propertyName || node.name); + } + if (node.kind === 275 /* PropertyAssignment */ || node.kind === 276 /* ShorthandPropertyAssignment */) { + return getLiteralPropertyNameText(node.name); + } + return "" + parent.elements.indexOf(node); + } + function getLiteralPropertyNameText(name) { + var type = getLiteralTypeFromPropertyName(name); + return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : undefined; + } /** Return the inferred type for a binding element */ function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -34507,9 +34736,9 @@ var ts; else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; - var exprType = getLiteralTypeFromPropertyName(name); - var declaredType = checkIndexedAccessIndexType(getIndexedAccessType(parentType, exprType, name), name); - type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name)); + var indexType = getLiteralTypeFromPropertyName(name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); } } else { @@ -34526,21 +34755,13 @@ var ts; mapType(parentType, function (t) { return sliceTupleType(t, index_1); }) : createArrayType(elementType); } + else if (isArrayLikeType(parentType)) { + var indexType = getLiteralType(index_1); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, declaration.name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); + } else { - // Use specific property type when parent is a tuple or numeric index type when parent is an array - var index_2 = pattern.elements.indexOf(declaration); - type = everyType(parentType, isTupleLikeType) ? - getTupleElementType(parentType, index_2) || declaration.initializer && checkDeclarationInitializer(declaration) : - elementType; - if (!type) { - if (isTupleType(parentType)) { - error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), getTypeReferenceArity(parentType), pattern.elements.length); - } - else { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), "" + index_2); - } - return errorType; - } + type = elementType; } } // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -34867,16 +35088,17 @@ var ts; var objectFlags = 128 /* ObjectLiteral */; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name)) { - // do not include computed properties in the implied type - objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; - return; - } if (e.dotDotDotToken) { stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); return; } - var text = ts.getTextOfPropertyName(name); + var exprType = getLiteralTypeFromPropertyName(name); + if (!isTypeUsableAsPropertyName(exprType)) { + // do not include computed properties in the implied type + objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; + return; + } + var text = getPropertyNameFromType(exprType); var flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); @@ -34991,12 +35213,11 @@ var ts; return anyType; } // Handle export default expressions - if (ts.isSourceFile(declaration)) { - var jsonSourceFile = ts.cast(declaration, ts.isJsonSourceFile); - if (!jsonSourceFile.statements.length) { + if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) { + if (!declaration.statements.length) { return emptyObjectType; } - var type_1 = getWidenedLiteralType(checkExpression(jsonSourceFile.statements[0].expression)); + var type_1 = getWidenedLiteralType(checkExpression(declaration.statements[0].expression)); if (type_1.flags & 524288 /* Object */) { return getRegularTypeOfObjectLiteral(type_1); } @@ -35007,6 +35228,10 @@ var ts; } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & 512 /* ValueModule */) { + return getTypeOfFuncClassEnumModule(symbol); + } return errorType; } var type; @@ -35020,7 +35245,8 @@ var ts; || ts.isClassDeclaration(declaration) || ts.isFunctionDeclaration(declaration) || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) - || ts.isMethodSignature(declaration)) { + || ts.isMethodSignature(declaration) + || ts.isSourceFile(declaration)) { // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); @@ -35060,6 +35286,10 @@ var ts; return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol)); } if (!popTypeResolution()) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & 512 /* ValueModule */) { + return getTypeOfFuncClassEnumModule(symbol); + } type = reportCircularityError(symbol); } return type; @@ -35253,7 +35483,7 @@ var ts; if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (ts.getCheckFlags(symbol) & 2048 /* ReverseMapped */) { + if (ts.getCheckFlags(symbol) & 4096 /* ReverseMapped */) { return getTypeOfReverseMappedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -35632,9 +35862,8 @@ var ts; type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; - type.thisType = createType(262144 /* TypeParameter */); + type.thisType = createTypeParameter(symbol); type.thisType.isThisType = true; - type.thisType.symbol = symbol; type.thisType.constraint = type; } } @@ -35770,19 +35999,11 @@ var ts; } function getDeclaredTypeOfTypeParameter(symbol) { var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(262144 /* TypeParameter */); - type.symbol = symbol; - links.declaredType = type; - } - return links.declaredType; + return links.declaredType || (links.declaredType = createTypeParameter(symbol)); } function getDeclaredTypeOfAlias(symbol) { var links = getSymbolLinks(symbol); - if (!links.declaredType) { - links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol)); - } - return links.declaredType; + return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol))); } function getDeclaredTypeOfSymbol(symbol) { return tryGetDeclaredTypeOfSymbol(symbol) || errorType; @@ -35919,9 +36140,9 @@ var ts; return type; } /** - * Indicates whether a type can be used as a late-bound name. + * Indicates whether a type can be used as a property name. */ - function isTypeUsableAsLateBoundName(type) { + function isTypeUsableAsPropertyName(type) { return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */); } /** @@ -35935,7 +36156,7 @@ var ts; function isLateBindableName(node) { return ts.isComputedPropertyName(node) && ts.isEntityNameExpression(node.expression) - && isTypeUsableAsLateBoundName(checkComputedPropertyName(node)); + && isTypeUsableAsPropertyName(checkComputedPropertyName(node)); } function isLateBoundName(name) { return name.charCodeAt(0) === 95 /* _ */ && @@ -35962,11 +36183,11 @@ var ts; return ts.isDynamicName(node) && !isLateBindableName(node); } /** - * Gets the symbolic name for a late-bound member from its type. + * Gets the symbolic name for a member from its type. */ - function getLateBoundNameFromType(type) { + function getPropertyNameFromType(type) { if (type.flags & 8192 /* UniqueESSymbol */) { - return "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol); + return type.escapedName; } if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { return ts.escapeLeadingUnderscores("" + type.value); @@ -35979,7 +36200,7 @@ var ts; * members. */ function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { - ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 1024 /* Late */), "Expected a late-bound symbol."); + ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 2048 /* Late */), "Expected a late-bound symbol."); symbol.flags |= symbolFlags; getSymbolLinks(member.symbol).lateSymbol = symbol; if (!symbol.declarations) { @@ -36030,13 +36251,13 @@ var ts; // fall back to the early-bound name of this member. links.resolvedSymbol = decl.symbol; var type = checkComputedPropertyName(decl.name); - if (isTypeUsableAsLateBoundName(type)) { - var memberName = getLateBoundNameFromType(type); + if (isTypeUsableAsPropertyName(type)) { + var memberName = getPropertyNameFromType(type); var symbolFlags = decl.symbol.flags; // Get or add a late-bound symbol for the member. This allows us to merge late-bound accessor declarations. var lateSymbol = lateSymbols.get(memberName); if (!lateSymbol) - lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */)); + lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */)); // Report an error if a late-bound member has the same name as an early-bound member, // or if we have another early-bound symbol declaration with the same name and // conflicting flags. @@ -36045,10 +36266,10 @@ var ts; // If we have an existing early-bound member, combine its declarations so that we can // report an error at each declaration. var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; - var name_2 = ts.declarationNameToString(decl.name); - ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_2); }); - error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_2); - lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */); + var name_3 = !(type.flags & 8192 /* UniqueESSymbol */) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(decl.name); + ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_3); }); + error(decl.name || decl, ts.Diagnostics.Duplicate_property_0, name_3); + lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */); } lateSymbol.nameType = type; addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); @@ -36224,8 +36445,8 @@ var ts; var tupleRestIndex_1 = restType.target.hasRestElement ? elementTypes.length - 1 : -1; var restParams = ts.map(elementTypes, function (t, i) { var name = getParameterNameAtPosition(sig, restIndex_1 + i); - var checkFlags = i === tupleRestIndex_1 ? 8192 /* RestParameter */ : - i >= minLength_1 ? 4096 /* OptionalParameter */ : 0; + var checkFlags = i === tupleRestIndex_1 ? 16384 /* RestParameter */ : + i >= minLength_1 ? 8192 /* OptionalParameter */ : 0; var symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags); symbol.type = i === tupleRestIndex_1 ? createArrayType(t) : t; return symbol; @@ -36298,7 +36519,13 @@ var ts; // type is the union of the constituent return types. function getUnionSignatures(signatureLists) { var result; + var indexWithLengthOverOne; for (var i = 0; i < signatureLists.length; i++) { + if (signatureLists[i].length === 0) + return ts.emptyArray; + if (signatureLists[i].length > 1) { + indexWithLengthOverOne = indexWithLengthOverOne === undefined ? i : -1; // -1 is a signal there are multiple overload sets + } for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) { var signature = _a[_i]; // Only process signatures with parameter lists that aren't already in the result list @@ -36323,8 +36550,82 @@ var ts; } } } + if (!ts.length(result) && indexWithLengthOverOne !== -1) { + // No sufficiently similar signature existed to subsume all the other signatures in the union - time to see if we can make a single + // signature that handles all over them. We only do this when there are overloads in only one constituent. + // (Overloads are conditional in nature and having overloads in multiple constituents would necessitate making a power set of + // signatures from the type, whose ordering would be non-obvious) + var masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0]; + var results = masterList.slice(); + var _loop_5 = function (signatures) { + if (signatures !== masterList) { + var signature_1 = signatures[0]; + ts.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); + results = signature_1.typeParameters && ts.some(results, function (s) { return !!s.typeParameters; }) ? undefined : ts.map(results, function (sig) { return combineSignaturesOfUnionMembers(sig, signature_1); }); + if (!results) { + return "break"; + } + } + }; + for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) { + var signatures = signatureLists_1[_b]; + var state_2 = _loop_5(signatures); + if (state_2 === "break") + break; + } + result = results; + } return result || ts.emptyArray; } + function combineUnionThisParam(left, right) { + if (!left || !right) { + return left || right; + } + // A signature `this` type might be a read or a write position... It's very possible that it should be invariant + // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be + // permissive when calling, for now, we'll union the `this` types just like the overlapping-union-signature check does + var thisType = getUnionType([getTypeOfSymbol(left), getTypeOfSymbol(right)], 2 /* Subtype */); + return createSymbolWithType(left, thisType); + } + function combineUnionParameters(left, right) { + var longest = getParameterCount(left) >= getParameterCount(right) ? left : right; + var shorter = longest === left ? right : left; + var longestCount = getParameterCount(longest); + var eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right)); + var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (var i = 0; i < longestCount; i++) { + var longestParamType = tryGetTypeAtPosition(longest, i); + var shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType; + var unionParamType = getIntersectionType([longestParamType, shorterParamType]); + var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1); + var isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter); + var leftName = getParameterNameAtPosition(left, i); + var rightName = getParameterNameAtPosition(right, i); + var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), leftName === rightName ? leftName : "arg" + i); + paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i] = paramSymbol; + } + if (needsExtraRestElement) { + var restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args"); + restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfUnionMembers(left, right) { + var declaration = left.declaration; + var params = combineUnionParameters(left, right); + var thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter); + var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + var hasRestParam = left.hasRestParameter || right.hasRestParameter; + var hasLiteralTypes = left.hasLiteralTypes || right.hasLiteralTypes; + var result = createSignature(declaration, left.typeParameters || right.typeParameters, thisParam, params, + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, minArgCount, hasRestParam, hasLiteralTypes); + result.unionSignatures = ts.concatenate(left.unionSignatures || [left], [right]); + return result; + } function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; @@ -36342,7 +36643,7 @@ var ts; function resolveUnionTypeMembers(type) { // The members and properties collections are empty for union types. To get all properties of a union // type use getPropertiesOfType (only the language service uses this). - var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 0 /* Call */); })); + var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return t === globalFunctionType ? [unknownSignature] : getSignaturesOfType(t, 0 /* Call */); })); var constructSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 1 /* Construct */); })); var stringIndexInfo = getUnionIndexInfo(type.types, 0 /* String */); var numberIndexInfo = getUnionIndexInfo(type.types, 1 /* Number */); @@ -36378,7 +36679,7 @@ var ts; var numberIndexInfo; var types = type.types; var mixinCount = ts.countWhere(types, isMixinConstructorType); - var _loop_5 = function (i) { + var _loop_6 = function (i) { var t = type.types[i]; // When an intersection type contains mixin constructor types, the construct signatures from // those types are discarded and their return types are mixed into the return types of all @@ -36401,7 +36702,7 @@ var ts; numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */)); }; for (var i = 0; i < types.length; i++) { - _loop_5(i); + _loop_6(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } @@ -36477,7 +36778,7 @@ var ts; var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { var prop = _a[_i]; - var checkFlags = 2048 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var checkFlags = 4096 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); inferredProp.declarations = prop.declarations; inferredProp.nameType = prop.nameType; @@ -36488,6 +36789,37 @@ var ts; } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); } + // Return the lower bound of the key type in a mapped type. Intuitively, the lower + // bound includes those keys that are known to always be present, for example because + // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). + function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } + if (type.flags & 4194304 /* Index */) { + return getIndexType(getApparentType(type.type)); + } + if (type.flags & 16777216 /* Conditional */) { + return getLowerBoundOfConditionalType(type); + } + if (type.flags & 1048576 /* Union */) { + return getUnionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); + } + if (type.flags & 2097152 /* Intersection */) { + return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); + } + return neverType; + } + function getLowerBoundOfConditionalType(type) { + if (type.root.isDistributive) { + var constraint = getLowerBoundOfKeyType(type.checkType); + if (constraint !== type.checkType) { + var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + } + } + return type; + } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -36517,10 +36849,7 @@ var ts; } } else { - // If the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. - // Then iterate over the constituents of the key type. - var iterationType = constraintType.flags & 4194304 /* Index */ ? getIndexType(getApparentType(constraintType.type)) : constraintType; - forEachType(iterationType, addMemberForKeyType); + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); function addMemberForKeyType(t) { @@ -36531,8 +36860,8 @@ var ts; var propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (t.flags & 8576 /* StringOrNumberLiteralOrUnique */) { - var propName = getLateBoundNameFromType(t); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); @@ -36702,9 +37031,10 @@ var ts; function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) { var list = obj.properties; return list.some(function (property) { - var name = property.name && ts.getTextOfPropertyName(property.name); + var nameType = property.name && getLiteralTypeFromPropertyName(property.name); + var name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; var expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name); - return !!expected && typeIsLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); + return !!expected && isLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); }); } function getAllPossiblePropertiesOfTypes(types) { @@ -36768,7 +37098,7 @@ var ts; if (type.root.isDistributive) { var simplified = getSimplifiedType(type.checkType); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; - if (constraint) { + if (constraint && constraint !== type.checkType) { var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { @@ -37013,10 +37343,10 @@ var ts; commonFlags &= prop.flags; props = ts.appendIfUnique(props, prop); checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | - (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 64 /* ContainsPublic */ : 0) | - (modifiers & 16 /* Protected */ ? 128 /* ContainsProtected */ : 0) | - (modifiers & 8 /* Private */ ? 256 /* ContainsPrivate */ : 0) | - (modifiers & 32 /* Static */ ? 512 /* ContainsStatic */ : 0); + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 128 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 256 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 512 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 1024 /* ContainsStatic */ : 0); if (!isPrototypeProperty(prop)) { syntheticFlag = 2 /* SyntheticProperty */; } @@ -37040,39 +37370,42 @@ var ts; return props[0]; } var declarations; - var commonType; + var firstType; var nameType; var propTypes = []; - var first = true; - var commonValueDeclaration; + var firstValueDeclaration; var hasNonUniformValueDeclaration = false; for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { var prop = props_1[_b]; - if (!commonValueDeclaration) { - commonValueDeclaration = prop.valueDeclaration; + if (!firstValueDeclaration) { + firstValueDeclaration = prop.valueDeclaration; } - else if (prop.valueDeclaration !== commonValueDeclaration) { + else if (prop.valueDeclaration !== firstValueDeclaration) { hasNonUniformValueDeclaration = true; } declarations = ts.addRange(declarations, prop.declarations); var type = getTypeOfSymbol(prop); - if (first) { - commonType = type; + if (!firstType) { + firstType = type; nameType = prop.nameType; - first = false; } - else { - if (type !== commonType) { - checkFlags |= 32 /* HasNonUniformType */; - } + else if (type !== firstType) { + checkFlags |= 32 /* HasNonUniformType */; + } + if (isLiteralType(type)) { + checkFlags |= 64 /* HasLiteralType */; } propTypes.push(type); } ts.addRange(propTypes, indexTypes); var result = createSymbol(4 /* Property */ | commonFlags, name, syntheticFlag | checkFlags); result.containingType = containingType; - if (!hasNonUniformValueDeclaration && commonValueDeclaration) { - result.valueDeclaration = commonValueDeclaration; + if (!hasNonUniformValueDeclaration && firstValueDeclaration) { + result.valueDeclaration = firstValueDeclaration; + // Inherit information about parent type. + if (firstValueDeclaration.symbol.parent) { + result.parent = firstValueDeclaration.symbol.parent; + } } result.declarations = declarations; result.nameType = nameType; @@ -37272,21 +37605,17 @@ var ts; var numTypeArguments = ts.length(typeArguments); if (isJavaScriptImplicitAny || (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters)) { var result = typeArguments ? typeArguments.slice() : []; - // Map an unsatisfied type parameter with a default type. - // If a type parameter does not have a default type, or if the default type - // is a forward reference, the empty object type is used. - var baseDefaultType_1 = getDefaultTypeArgumentType(isJavaScriptImplicitAny); - var circularityMapper = createTypeMapper(typeParameters, ts.map(typeParameters, function () { return baseDefaultType_1; })); + // Map invalid forward references in default types to the error type for (var i = numTypeArguments; i < numTypeParameters; i++) { - result[i] = instantiateType(getConstraintFromTypeParameter(typeParameters[i]) || baseDefaultType_1, circularityMapper); + result[i] = errorType; } + var baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); for (var i = numTypeArguments; i < numTypeParameters; i++) { - var mapper = createTypeMapper(typeParameters, result); var defaultType = getDefaultFromTypeParameter(typeParameters[i]); if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) { defaultType = anyType; } - result[i] = defaultType ? instantiateType(defaultType, mapper) : baseDefaultType_1; + result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result)) : baseDefaultType; } result.length = typeParameters.length; return result; @@ -37375,7 +37704,7 @@ var ts; var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); - var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 8192 /* RestParameter */); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 16384 /* RestParameter */); syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType; if (lastParamVariadicType) { // Replace the last parameter with a rest parameter. @@ -37935,21 +38264,16 @@ var ts; * the type of this reference is just the type of the value we resolved to. */ function getJSDocTypeReference(node, symbol, typeArguments) { - if (!pushTypeResolution(symbol, 6 /* JSDocTypeReference */)) { - return errorType; - } - var assignedType = getAssignedClassType(symbol); - var valueType = getTypeOfSymbol(symbol); - var referenceType = valueType.symbol && valueType.symbol !== symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); - if (!popTypeResolution()) { - getSymbolLinks(symbol).resolvedJSDocType = errorType; - error(node, ts.Diagnostics.JSDoc_type_0_circularly_references_itself, symbolToString(symbol)); - return errorType; - } - if (referenceType || assignedType) { - // TODO: GH#18217 (should the `|| assignedType` be at a lower precedence?) - var type = (referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType); - return getSymbolLinks(symbol).resolvedJSDocType = type; + // In the case of an assignment of a function expression (binary expressions, variable declarations, etc.), we will get the + // correct instance type for the symbol on the LHS by finding the type for RHS. For example if we want to get the type of the symbol `foo`: + // var foo = function() {} + // We will find the static type of the assigned anonymous function. + var staticType = getTypeOfSymbol(symbol); + var instanceType = staticType.symbol && + staticType.symbol !== symbol && // Make sure this is an assignment like expression by checking that symbol -> type -> symbol doesn't roundtrips. + getTypeReferenceTypeWorker(node, staticType.symbol, typeArguments); // Get the instance type of the RHS symbol. + if (instanceType) { + return getSymbolLinks(symbol).resolvedJSDocType = instanceType; } } function getTypeReferenceTypeWorker(node, symbol, typeArguments) { @@ -37967,8 +38291,11 @@ var ts; } if (symbol.flags & 16 /* Function */ && isJSDocTypeReference(node) && - (symbol.members || ts.getJSDocClassTag(symbol.valueDeclaration))) { - return getInferredClassType(symbol); + isJSConstructor(symbol.valueDeclaration)) { + var resolved = resolveStructuredTypeMembers(getTypeOfSymbol(symbol)); + if (resolved.callSignatures.length === 1) { + return getReturnTypeOfSignature(resolved.callSignatures[0]); + } } } function getSubstitutionType(typeVariable, substitute) { @@ -38246,7 +38573,7 @@ var ts; if (arity) { typeParameters = new Array(arity); for (var i = 0; i < arity; i++) { - var typeParameter = typeParameters[i] = createType(262144 /* TypeParameter */); + var typeParameter = typeParameters[i] = createTypeParameter(); if (i < maxLength) { var property = createSymbol(4 /* Property */ | (i >= minLength ? 16777216 /* Optional */ : 0), "" + i); property.type = typeParameter; @@ -38268,7 +38595,7 @@ var ts; type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; - type.thisType = createType(262144 /* TypeParameter */); + type.thisType = createTypeParameter(); type.thisType.isThisType = true; type.thisType.constraint = type; type.declaredProperties = properties; @@ -38865,14 +39192,14 @@ var ts; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol, missingType) { var accessExpression = accessNode && accessNode.kind === 190 /* ElementAccessExpression */ ? accessNode : undefined; - var propName = isTypeUsableAsLateBoundName(indexType) - ? getLateBoundNameFromType(indexType) - : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) - ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) - : accessNode && ts.isPropertyName(accessNode) + var propName = isTypeUsableAsPropertyName(indexType) ? + getPropertyNameFromType(indexType) : + accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? + ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : + accessNode && ts.isPropertyName(accessNode) ? // late bound names are handled in the first branch, so here we only need to handle normal names - ? ts.getPropertyNameForPropertyNameNode(accessNode) - : undefined; + ts.getPropertyNameForPropertyNameNode(accessNode) : + undefined; if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { @@ -38894,7 +39221,12 @@ var ts; if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) { if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; })) { var indexNode = getIndexNodeForAccessExpression(accessNode); - error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); + if (isTupleType(objectType)) { + error(indexNode, ts.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), ts.unescapeLeadingUnderscores(propName)); + } + else { + error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); + } } return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } @@ -39019,24 +39351,14 @@ var ts; // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2] // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we - // construct the type Box. We do not further simplify the result because mapped types can be recursive - // and we might never terminate. + // construct the type Box. if (isGenericMappedType(objectType)) { - return type.simplified = substituteIndexedMappedType(objectType, type); - } - if (objectType.flags & 262144 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(objectType); - if (constraint && isGenericMappedType(constraint)) { - return type.simplified = substituteIndexedMappedType(constraint, type); - } + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = combineTypeMappers(objectType.mapper, mapper); + return type.simplified = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType); } return type.simplified = type; } - function substituteIndexedMappedType(objectType, type) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var templateMapper = combineTypeMappers(objectType.mapper, mapper); - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); - } function getIndexedAccessType(objectType, indexType, accessNode, missingType) { if (missingType === void 0) { missingType = accessNode ? errorType : unknownType; } if (objectType === wildcardType || indexType === wildcardType) { @@ -39124,14 +39446,11 @@ var ts; if (checkType === wildcardType || extendsType === wildcardType) { return wildcardType; } - // If this is a distributive conditional type and the check type is generic we need to defer - // resolution of the conditional type such that a later instantiation will properly distribute - // over union types. - var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 63176704 /* Instantiable */); + var checkTypeInstantiable = maybeTypeOfKind(checkType, 63176704 /* Instantiable */ | 134217728 /* GenericMappedType */); var combinedMapper; if (root.inferTypeParameters) { var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */); - if (!isDeferred) { + if (!checkTypeInstantiable) { // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. @@ -39139,28 +39458,30 @@ var ts; } combinedMapper = combineTypeMappers(mapper, context); } - if (!isDeferred) { - if (extendsType.flags & 3 /* AnyOrUnknown */) { + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // We attempt to resolve the conditional type only when the check and extends types are non-generic + if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, 63176704 /* Instantiable */ | 134217728 /* GenericMappedType */)) { + if (inferredExtendsType.flags & 3 /* AnyOrUnknown */) { return instantiateType(root.trueType, mapper); } // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } - // Instantiate the extends type including inferences for 'infer T' type parameters - var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; // Return falseType for a definitely false extends check. We check an instantations of the two // types with type parameters mapped to the wildcard type, the most permissive instantiations // possible (the wildcard type is assignable to and from all types). If those are not related, // then no instatiations will be and we can just return the false branch type. - if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(inferredExtendsType))) { + if (!isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType))) { return instantiateType(root.falseType, mapper); } - // Return trueType for a definitely true extends check. The definitely assignable relation excludes - // type variable constraints from consideration. Without the definitely assignable relation, the type + // Return trueType for a definitely true extends check. We check instantiations of the two + // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter + // that has no constraint. This ensures that, for example, the type // type Foo = T extends { x: string } ? string : number - // would immediately resolve to 'string' instead of being deferred. - if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + // doesn't immediately resolve to 'string' instead of being deferred. + if (isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { return instantiateType(root.trueType, combinedMapper || mapper); } } @@ -39516,6 +39837,7 @@ var ts; function createUniqueESSymbolType(symbol) { var type = createType(8192 /* UniqueESSymbol */); type.symbol = symbol; + type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol); return type; } function getESSymbolLikeTypeForNode(node) { @@ -39709,12 +40031,19 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } - function wildcardMapper(type) { + function permissiveMapper(type) { return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; } + function getRestrictiveTypeParameter(tp) { + return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), + tp.restrictiveInstantiation.constraint = unknownType, + tp.restrictiveInstantiation); + } + function restrictiveMapper(type) { + return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; + } function cloneTypeParameter(typeParameter) { - var result = createType(262144 /* TypeParameter */); - result.symbol = typeParameter.symbol; + var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; return result; } @@ -39773,7 +40102,7 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (1024 /* Late */ | 4096 /* OptionalParameter */ | 8192 /* RestParameter */)); + var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (2048 /* Late */ | 8192 /* OptionalParameter */ | 16384 /* RestParameter */)); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -40045,9 +40374,13 @@ var ts; } return type; } - function getWildcardInstantiation(type) { + function getPermissiveInstantiation(type) { return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : - type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + } + function getRestrictiveInstantiation(type) { + return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : + type.restrictiveInstantiation || (type.restrictiveInstantiation = instantiateType(type, restrictiveMapper)); } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); @@ -40111,8 +40444,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - var body = node.body; - return body.kind === 218 /* Block */ ? false : isContextSensitive(body); + return !!node.body && node.body.kind !== 218 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -40229,7 +40561,7 @@ var ts; case 187 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation); case 268 /* JsxAttributes */: - return elaborateJsxAttributes(node, source, target, relation); + return elaborateJsxComponents(node, source, target, relation); case 197 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation); } @@ -40320,7 +40652,7 @@ var ts; } if (resultObj.error) { var reportedDiag = resultObj.error; - var propertyName = isTypeUsableAsLateBoundName(nameType) ? getLateBoundNameFromType(nameType) : undefined; + var propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; var targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined; var issuedElaboration = false; if (!targetProp) { @@ -40370,8 +40702,117 @@ var ts; } }); } - function elaborateJsxAttributes(node, source, target, relation) { - return elaborateElementwise(generateJsxAttributes(node), source, target, relation); + function generateJsxChildren(node, getInvalidTextDiagnostic) { + var memberOffset, i, child, nameType, elem; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!ts.length(node.children)) + return [2 /*return*/]; + memberOffset = 0; + i = 0; + _a.label = 1; + case 1: + if (!(i < node.children.length)) return [3 /*break*/, 5]; + child = node.children[i]; + nameType = getLiteralType(i - memberOffset); + elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic); + if (!elem) return [3 /*break*/, 3]; + return [4 /*yield*/, elem]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + memberOffset++; + _a.label = 4; + case 4: + i++; + return [3 /*break*/, 1]; + case 5: return [2 /*return*/]; + } + }); + } + function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { + switch (child.kind) { + case 270 /* JsxExpression */: + // child is of the type of the expression + return { errorNode: child, innerExpression: child.expression, nameType: nameType }; + case 11 /* JsxText */: + if (child.containsOnlyWhiteSpaces) { + break; // Whitespace only jsx text isn't real jsx text + } + // child is a string + return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; + case 260 /* JsxElement */: + case 261 /* JsxSelfClosingElement */: + case 264 /* JsxFragment */: + // child is of type JSX.Element + return { errorNode: child, innerExpression: child, nameType: nameType }; + default: + return ts.Debug.assertNever(child, "Found invalid jsx child"); + } + } + function elaborateJsxComponents(node, source, target, relation) { + var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation); + var invalidTextDiagnostic; + if (ts.isJsxOpeningElement(node.parent) && ts.isJsxElement(node.parent.parent)) { + var containingElement = node.parent.parent; + var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); + var childrenNameType = getLiteralType(childrenPropName); + var childrenTargetType = getIndexedAccessType(target, childrenNameType); + var validChildren = ts.filter(containingElement.children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyWhiteSpaces; }); + if (!ts.length(validChildren)) { + return result; + } + var moreThanOneRealChildren = ts.length(validChildren) > 1; + var arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType); + var nonArrayLikeTargetParts = filterType(childrenTargetType, function (t) { return !isArrayOrTupleLikeType(t); }); + if (moreThanOneRealChildren) { + if (arrayLikeTargetParts !== neverType) { + var realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */)); + result = elaborateElementwise(generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic), realSource, arrayLikeTargetParts, relation) || result; + } + else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + // arity mismatch + result = true; + error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType)); + } + } + else { + if (nonArrayLikeTargetParts !== neverType) { + var child = validChildren[0]; + var elem_1 = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic); + if (elem_1) { + result = elaborateElementwise((function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, elem_1]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); })(), source, target, relation) || result; + } + } + else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + // arity mismatch + result = true; + error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType)); + } + } + } + return result; + function getInvalidTextualChildDiagnostic() { + if (!invalidTextDiagnostic) { + var tagNameText = ts.getTextOfNode(node.parent.tagName); + var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); + var childrenTargetType = getIndexedAccessType(target, getLiteralType(childrenPropName)); + var diagnostic = ts.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2; + invalidTextDiagnostic = __assign({}, diagnostic, { key: "!!ALREADY FORMATTED!!", message: ts.formatMessage(/*_dummy*/ undefined, diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) }); + } + return invalidTextDiagnostic; + } } function generateLimitedTupleElements(node, target) { var len, i, elem, nameType; @@ -40624,7 +41065,7 @@ var ts; !t.numberIndexInfo; } function isEmptyObjectType(type) { - return type.flags & 524288 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + return type.flags & 524288 /* Object */ ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) : type.flags & 67108864 /* NonPrimitive */ ? true : type.flags & 1048576 /* Union */ ? ts.some(type.types, isEmptyObjectType) : type.flags & 2097152 /* Intersection */ ? ts.every(type.types, isEmptyObjectType) : @@ -40707,9 +41148,7 @@ var ts; return true; if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */) return true; - if (s & 8192 /* UniqueESSymbol */ || t & 8192 /* UniqueESSymbol */) - return false; - if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -40879,7 +41318,7 @@ var ts; target = target.regularType; } if (source.flags & 33554432 /* Substitution */) { - source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute; + source = source.substitute; } if (target.flags & 33554432 /* Substitution */) { target = target.typeVariable; @@ -41054,9 +41493,9 @@ var ts; if (!noImplicitAny && ts.getObjectFlags(target) & 16384 /* JSLiteral */) { return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny } - if (maybeTypeOfKind(target, 524288 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { + if (isExcessPropertyCheckTarget(target)) { var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); - if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && + if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } @@ -41064,9 +41503,12 @@ var ts; // check excess properties against discriminant type only, not the entire union return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } - var _loop_6 = function (prop) { + var _loop_7 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { + // Report error in terms of object types in the target as those are the only ones + // we check in isKnownProperty. + var errorTarget = filterType(target, isExcessPropertyCheckTarget); // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. @@ -41076,7 +41518,7 @@ var ts; // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. // However, using an object-literal error message will be very confusing to the users so we give different a message. // TODO: Spelling suggestions for excess jsx attributes (needs new diagnostic messages) - reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(errorTarget)); } else { // use the property's value declaration if the property is assigned inside the literal itself @@ -41088,14 +41530,14 @@ var ts; errorNode = propDeclaration; var name = propDeclaration.name; if (ts.isIdentifier(name)) { - suggestion = getSuggestionForNonexistentProperty(name, target); + suggestion = getSuggestionForNonexistentProperty(name, errorTarget); } } if (suggestion !== undefined) { - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(target), suggestion); + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion); } else { - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); } } } @@ -41104,9 +41546,9 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_2 = _loop_6(prop); - if (typeof state_2 === "object") - return state_2.value; + var state_3 = _loop_7(prop); + if (typeof state_3 === "object") + return state_3.value; } } return false; @@ -41191,16 +41633,16 @@ var ts; matchingCount = Infinity; } else if (overlap.flags & 1048576 /* Union */) { - // Some subset overlap if we have only string literals. + // We only want to account for literal types otherwise. // If we have a union of index types, it seems likely that we // needed to elaborate between two generic mapped types anyway. - var len = ts.length(overlap.types); + var len = ts.length(ts.filter(overlap.types, isUnitType)); if (len >= matchingCount) { bestMatch = target_1; matchingCount = len; } } - else if (!(overlap.flags & 131072 /* Never */) && 1 >= matchingCount) { + else if (isUnitType(overlap) && 1 >= matchingCount) { bestMatch = target_1; matchingCount = 1; } @@ -41380,30 +41822,27 @@ var ts; } return result; } - function getConstraintForRelation(type) { - return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); - } function structuredTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) { var flags = source.flags & target.flags; if (relation === identityRelation && !(flags & 524288 /* Object */)) { if (flags & 4194304 /* Index */) { return isRelatedTo(source.type, target.type, /*reportErrors*/ false); } - var result_2 = 0 /* False */; + var result_3 = 0 /* False */; if (flags & 8388608 /* IndexedAccess */) { - if (result_2 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { - return result_2; + if (result_3 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result_3; } } } if (flags & 16777216 /* Conditional */) { if (source.root.isDistributive === target.root.isDistributive) { - if (result_2 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { - return result_2; + if (result_3 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { + return result_3; } } } @@ -41452,24 +41891,23 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // simplified form of T or, if T doesn't simplify, the constraint of T. - if (relation !== definitelyAssignableRelation) { - var simplified = getSimplifiedType(target.type); - var constraint = simplified !== target.type ? simplified : getConstraintOfType(target.type); - if (constraint) { - // We require Ternary.True here such that circular constraints don't cause - // false positives. For example, given 'T extends { [K in keyof T]: string }', - // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when - // related to other types. - if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) { - return -1 /* True */; - } + var simplified = getSimplifiedType(target.type); + var constraint = simplified !== target.type ? simplified : getConstraintOfType(target.type); + if (constraint) { + // We require Ternary.True here such that circular constraints don't cause + // false positives. For example, given 'T extends { [K in keyof T]: string }', + // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when + // related to other types. + if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) { + return -1 /* True */; } } } else if (target.flags & 8388608 /* IndexedAccess */) { // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, // where C is the base constraint of T[K] - if (relation !== identityRelation && !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) { + if (relation !== identityRelation && + !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) { var constraint = getBaseConstraintOfType(target); if (constraint && constraint !== target) { if (result = isRelatedTo(source, constraint, reportErrors)) { @@ -41510,8 +41948,8 @@ var ts; return result; } } - var constraint = getConstraintForRelation(source); - if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 3 /* AnyOrUnknown */)) { + var constraint = getConstraintOfType(source); + if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) { // A type variable with no constraint is not related to the non-primitive object type. if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) { errorInfo = saveErrorInfo; @@ -41551,7 +41989,7 @@ var ts; } } } - else if (relation !== definitelyAssignableRelation) { + else { var distributiveConstraint = getConstraintOfDistributiveConditionalType(source); if (distributiveConstraint) { if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) { @@ -41570,7 +42008,7 @@ var ts; } else { // An empty object type is related to any mapped type that includes a '?' modifier. - if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) { + if (relation !== subtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { return -1 /* True */; } if (isGenericMappedType(target)) { @@ -41582,9 +42020,6 @@ var ts; } return 0 /* False */; } - if (relation === definitelyAssignableRelation && isGenericMappedType(source)) { - return 0 /* False */; - } var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */); if (relation !== identityRelation) { source = getApparentType(source); @@ -41664,10 +42099,10 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_3; - if (result_3 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var result_4; + if (result_4 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - return result_3 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + return result_4 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -41677,10 +42112,10 @@ var ts; return propertiesIdenticalTo(source, target); } var requireOptionalProperties = relation === subtypeRelation && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source); - var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties); + var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false); if (unmatchedProperty) { if (reportErrors) { - var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties)); + var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false)); if (!headMessage || (headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) { suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it @@ -41756,7 +42191,7 @@ var ts; var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { var hasDifferingDeclarations = sourceProp.valueDeclaration !== targetProp.valueDeclaration; - if (ts.getCheckFlags(sourceProp) & 256 /* ContainsPrivate */ && hasDifferingDeclarations) { + if (ts.getCheckFlags(sourceProp) & 512 /* ContainsPrivate */ && hasDifferingDeclarations) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); } @@ -42432,6 +42867,9 @@ var ts; function isTupleLikeType(type) { return isTupleType(type) || !!getPropertyOfType(type, "0"); } + function isArrayOrTupleLikeType(type) { + return isArrayLikeType(type) || isTupleLikeType(type); + } function getTupleElementType(type, index) { var propType = getTypeOfPropertyOfType(type, "" + index); if (propType) { @@ -42721,6 +43159,9 @@ var ts; // union includes empty object types (e.g. reducing {} | string to just {}). return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } + if (type.flags & 2097152 /* Intersection */) { + return getIntersectionType(ts.sameMap(type.types, getWidenedType)); + } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); } @@ -42807,6 +43248,10 @@ var ts; break; case 186 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; + if (!noImplicitAny) { + // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. + return; + } break; case 289 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); @@ -43004,8 +43449,8 @@ var ts; inferTypes([inference], sourceType, templateType); return getTypeFromInference(inference); } - function getUnmatchedProperties(source, target, requireOptionalProperties) { - var properties, _i, properties_4, targetProp, sourceProp; + function getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { + var properties, _i, properties_4, targetProp, sourceProp, targetType, sourceType; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -43013,24 +43458,34 @@ var ts; _i = 0, properties_4 = properties; _a.label = 1; case 1: - if (!(_i < properties_4.length)) return [3 /*break*/, 4]; + if (!(_i < properties_4.length)) return [3 /*break*/, 6]; targetProp = properties_4[_i]; - if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */))) return [3 /*break*/, 3]; + if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */))) return [3 /*break*/, 5]; sourceProp = getPropertyOfType(source, targetProp.escapedName); if (!!sourceProp) return [3 /*break*/, 3]; return [4 /*yield*/, targetProp]; case 2: _a.sent(); - _a.label = 3; + return [3 /*break*/, 5]; case 3: + if (!matchDiscriminantProperties) return [3 /*break*/, 5]; + targetType = getTypeOfSymbol(targetProp); + if (!(targetType.flags & 109440 /* Unit */)) return [3 /*break*/, 5]; + sourceType = getTypeOfSymbol(sourceProp); + if (!!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) return [3 /*break*/, 5]; + return [4 /*yield*/, targetProp]; + case 4: + _a.sent(); + _a.label = 5; + case 5: _i++; return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; + case 6: return [2 /*return*/]; } }); } - function getUnmatchedProperty(source, target, requireOptionalProperties) { - return getUnmatchedProperties(source, target, requireOptionalProperties).next().value; + function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { + return getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next().value; } function tupleTypesDefinitelyUnrelated(source, target) { return target.target.minLength > source.target.minLength || @@ -43040,7 +43495,8 @@ var ts; // Two tuple types with incompatible arities are definitely unrelated. // Two object types that each have a property that is unmatched in the other are definitely unrelated. return isTupleType(source) && isTupleType(target) && tupleTypesDefinitelyUnrelated(source, target) || - !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false) && !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false); + !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true) && + !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true); } function getTypeFromInference(inference) { return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : @@ -43356,7 +43812,11 @@ var ts; priority |= 4 /* MappedTypeConstraint */; inferFromTypes(getIndexType(source), constraintType); priority = savePriority; - inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); + var valueTypes = ts.compact([ + getIndexTypeOfType(source, 0 /* String */), + getIndexTypeOfType(source, 1 /* Number */) + ].concat(ts.map(getPropertiesOfType(source), getTypeOfSymbol))); + inferFromTypes(getUnionType(valueTypes), getTemplateTypeFromMappedType(target)); return true; } return false; @@ -43645,48 +44105,31 @@ var ts; // occurring in an apparent type position with '@' because the control flow type // of such nodes may be based on the apparent type instead of the declared type. function getFlowCacheKey(node) { - if (node.kind === 72 /* Identifier */) { - var symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; - } - if (node.kind === 100 /* ThisKeyword */) { - return "0"; - } - if (node.kind === 189 /* PropertyAccessExpression */) { - var key = getFlowCacheKey(node.expression); - return key && key + "." + ts.idText(node.name); - } - if (node.kind === 186 /* BindingElement */) { - var container = node.parent.parent; - var key = container.kind === 186 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); - var text = getBindingElementNameText(node); - var result = key && text && (key + "." + text); - return result; + switch (node.kind) { + case 72 /* Identifier */: + var symbol = getResolvedSymbol(node); + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + case 100 /* ThisKeyword */: + return "0"; + case 213 /* NonNullExpression */: + case 195 /* ParenthesizedExpression */: + return getFlowCacheKey(node.expression); + case 189 /* PropertyAccessExpression */: + case 190 /* ElementAccessExpression */: + var propName = getAccessedPropertyName(node); + if (propName !== undefined) { + var key = getFlowCacheKey(node.expression); + return key && key + "." + propName; + } } return undefined; } - function getBindingElementNameText(element) { - var parent = element.parent; - if (parent.kind === 184 /* ObjectBindingPattern */) { - var name = element.propertyName || element.name; - switch (name.kind) { - case 72 /* Identifier */: - return ts.idText(name); - case 149 /* ComputedPropertyName */: - return ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined; - case 10 /* StringLiteral */: - case 8 /* NumericLiteral */: - return name.text; - default: - // Per types, array and object binding patterns remain, however they should never be present if propertyName is not defined - ts.Debug.fail("Unexpected name kind for binding element name"); - } - } - else { - return "" + parent.elements.indexOf(element); - } - } function isMatchingReference(source, target) { + switch (target.kind) { + case 195 /* ParenthesizedExpression */: + case 213 /* NonNullExpression */: + return isMatchingReference(source, target.expression); + } switch (source.kind) { case 72 /* Identifier */: return target.kind === 72 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || @@ -43696,34 +44139,24 @@ var ts; return target.kind === 100 /* ThisKeyword */; case 98 /* SuperKeyword */: return target.kind === 98 /* SuperKeyword */; + case 213 /* NonNullExpression */: + case 195 /* ParenthesizedExpression */: + return isMatchingReference(source.expression, target); case 189 /* PropertyAccessExpression */: case 190 /* ElementAccessExpression */: - return (ts.isPropertyAccessExpression(target) || ts.isElementAccessExpression(target)) && + return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); - case 186 /* BindingElement */: - if (target.kind !== 189 /* PropertyAccessExpression */) - return false; - var t = target; - if (t.name.escapedText !== getBindingElementNameText(source)) - return false; - if (source.parent.parent.kind === 186 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { - return true; - } - if (source.parent.parent.kind === 237 /* VariableDeclaration */) { - var maybeId = source.parent.parent.initializer; - return !!maybeId && isMatchingReference(maybeId, t.expression); - } } return false; } function getAccessedPropertyName(access) { - return ts.isPropertyAccessExpression(access) ? access.name.escapedText : + return access.kind === 189 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringLiteral(access.argumentExpression) || ts.isNumericLiteral(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } function containsMatchingReference(source, target) { - while (source.kind === 189 /* PropertyAccessExpression */) { + while (ts.isAccessExpression(source)) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -43736,42 +44169,37 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 189 /* PropertyAccessExpression */ && + var name; + return ts.isAccessExpression(target) && containsMatchingReference(source, target.expression) && - isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); + (name = getAccessedPropertyName(target)) !== undefined && + isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), name); } function getDeclaredTypeOfReference(expr) { if (expr.kind === 72 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 189 /* PropertyAccessExpression */) { + if (ts.isAccessExpression(expr)) { var type = getDeclaredTypeOfReference(expr.expression); - return type && getTypeOfPropertyOfType(type, expr.name.escapedText); + if (type) { + var propName = getAccessedPropertyName(expr); + return propName !== undefined ? getTypeOfPropertyOfType(type, propName) : undefined; + } } return undefined; } function isDiscriminantType(type) { - if (type.flags & 1048576 /* Union */) { - if (type.flags & (16 /* Boolean */ | 1024 /* EnumLiteral */)) { - return true; - } - var combined = 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - combined |= t.flags; - } - if (combined & 109440 /* Unit */ && !(combined & 63176704 /* Instantiable */)) { - return true; - } - } - return false; + return !!(type.flags & 1048576 /* Union */ && + (type.flags & (16 /* Boolean */ | 1024 /* EnumLiteral */) || !isGenericIndexType(type))); } function isDiscriminantProperty(type, name) { if (type && type.flags & 1048576 /* Union */) { var prop = getUnionOrIntersectionProperty(type, name); if (prop && ts.getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = !!(prop.checkFlags & 32 /* HasNonUniformType */) && isDiscriminantType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = + (prop.checkFlags & 96 /* Discriminant */) === 96 /* Discriminant */ && + isDiscriminantType(getTypeOfSymbol(prop)); } return !!prop.isDiscriminantProperty; } @@ -43945,7 +44373,10 @@ var ts; return type; } function getTypeOfDestructuredProperty(type, name) { - var text = ts.getTextOfPropertyName(name); + var nameType = getLiteralTypeFromPropertyName(name); + if (!isTypeUsableAsPropertyName(nameType)) + return errorType; + var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || @@ -44503,9 +44934,6 @@ var ts; } function getTypeAtSwitchClause(flow) { var expr = flow.switchStatement.expression; - if (containsMatchingReferenceDiscriminant(reference, expr)) { - return declaredType; - } var flowType = getTypeAtFlowNode(flow.antecedent); var type = getTypeFromFlowType(flowType); if (isMatchingReference(reference, expr)) { @@ -44517,6 +44945,9 @@ var ts; else if (expr.kind === 199 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } + else if (containsMatchingReferenceDiscriminant(reference, expr)) { + type = declaredType; + } return createFlowType(type, isIncomplete(flowType)); } function getTypeAtFlowBranchLabel(flow) { @@ -44630,25 +45061,23 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - if (!(computedType.flags & 1048576 /* Union */) || - expr.kind !== 189 /* PropertyAccessExpression */ && expr.kind !== 190 /* ElementAccessExpression */) { + if (!(computedType.flags & 1048576 /* Union */) || !ts.isAccessExpression(expr)) { return false; } - var access = expr; - var name = getAccessedPropertyName(access); - if (!name) { + var name = getAccessedPropertyName(expr); + if (name === undefined) { return false; } - return isMatchingReference(reference, access.expression) && isDiscriminantProperty(computedType, name); + return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, name); } function narrowTypeByDiscriminant(type, access, narrowType) { var propName = getAccessedPropertyName(access); - if (!propName) { + if (propName === undefined) { return type; } var propType = getTypeOfPropertyOfType(type, propName); var narrowedPropType = propType && narrowType(propType); - return propType === narrowedPropType ? type : filterType(type, function (t) { return isTypeComparableTo(getTypeOfPropertyOfType(t, propName), narrowedPropType); }); + return propType === narrowedPropType ? type : filterType(type, function (t) { return isTypeComparableTo(getTypeOfPropertyOrIndexSignature(t, propName), narrowedPropType); }); } function narrowTypeByTruthiness(type, expr, assumeTrue) { if (isMatchingReference(reference, expr)) { @@ -44993,9 +45422,8 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 190 /* ElementAccessExpression */ || invokedExpression.kind === 189 /* PropertyAccessExpression */) { - var accessExpression = invokedExpression; - var possibleReference = ts.skipParentheses(accessExpression.expression); + if (ts.isAccessExpression(invokedExpression)) { + var possibleReference = ts.skipParentheses(invokedExpression.expression); if (isMatchingReference(reference, possibleReference)) { return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf); } @@ -45412,7 +45840,7 @@ var ts; } function checkThisBeforeSuper(node, container, diagnosticMessage) { var containingClassDecl = container.parent; - var baseTypeNode = ts.getEffectiveBaseTypeNode(containingClassDecl); + var baseTypeNode = ts.getClassExtendsHeritageElement(containingClassDecl); // If a containing class does not have extends clause or the class extends null // skip checking whether super statement is called before "this" accessing. if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { @@ -45512,7 +45940,7 @@ var ts; else if (isInJS && (container.kind === 196 /* FunctionExpression */ || container.kind === 239 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { - var classType = getJSClassType(container.symbol); + var classType = getJSClassType(getMergedSymbol(container.symbol)); if (classType) { return getFlowTypeOfReference(node, classType); } @@ -45733,7 +46161,7 @@ var ts; } // at this point the only legal case for parent is ClassLikeDeclaration var classLikeDeclaration = container.parent; - if (!ts.getEffectiveBaseTypeNode(classLikeDeclaration)) { + if (!ts.getClassExtendsHeritageElement(classLikeDeclaration)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); return errorType; } @@ -45890,6 +46318,31 @@ var ts; tryGetTypeAtPosition(contextualSignature, index); } } + function getContextualTypeForVariableLikeDeclaration(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + switch (declaration.kind) { + case 151 /* Parameter */: + return getContextuallyTypedParameterType(declaration); + case 186 /* BindingElement */: + return getContextualTypeForBindingElement(declaration); + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent + } + } + function getContextualTypeForBindingElement(declaration) { + var parentDeclaration = declaration.parent.parent; + var name = declaration.propertyName || declaration.name; + var parentType = getContextualTypeForVariableLikeDeclaration(parentDeclaration); + if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } + } + } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. // Otherwise, in a parameter declaration of a contextually typed function expression, @@ -45901,32 +46354,13 @@ var ts; function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (ts.hasInitializer(declaration) && node === declaration.initializer) { - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - return getTypeFromTypeNode(typeNode); + var result = getContextualTypeForVariableLikeDeclaration(declaration); + if (result) { + return result; } - if (declaration.kind === 151 /* Parameter */) { - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (ts.isBindingPattern(declaration.name)) { + if (ts.isBindingPattern(declaration.name)) { // This is less a contextual type and more an implied shape - in some cases, this may be undesirable return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false); } - if (ts.isBindingPattern(declaration.parent)) { - var parentDeclaration = declaration.parent.parent; - var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 186 /* BindingElement */) { - var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); - if (parentTypeNode && !ts.isBindingPattern(name)) { - var text = ts.getTextOfPropertyName(name); - if (text) { - return getTypeOfPropertyOfType(getTypeFromTypeNode(parentTypeNode), text); - } - } - } - } } return undefined; } @@ -46179,18 +46613,30 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForChildJsxExpression(node) { + function getContextualTypeForChildJsxExpression(node, child) { var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { + return undefined; + } + var childIndex = node.children.indexOf(child); + var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); + return childFieldType && mapType(childFieldType, function (t) { + if (isArrayLikeType(t)) { + return getIndexedAccessType(t, getLiteralType(childIndex)); + } + else { + return t; + } + }, /*noReductions*/ true); } function getContextualTypeForJsxExpression(node) { var exprParent = node.parent; return ts.isJsxAttributeLike(exprParent) ? getContextualType(node) : ts.isJsxElement(exprParent) - ? getContextualTypeForChildJsxExpression(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent, node) : undefined; } function getContextualTypeForJsxAttribute(attribute) { @@ -46357,6 +46803,27 @@ var ts; return propsType; } function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) { + if (sig.unionSignatures) { + // JSX Elements using the legacy `props`-field based lookup (eg, react class components) need to treat the `props` member as an input + // instead of an output position when resolving the signature. We need to go back to the input signatures of the composite signature, + // get the type of `props` on each return type individually, and then _intersect them_, rather than union them (as would normally occur + // for a union signature). It's an unfortunate quirk of looking in the output of the signature for the type we want to use for the input. + // The default behavior of `getTypeOfFirstParameterOfSignatureWithFallback` when no `props` member name is defined is much more sane. + var results = []; + for (var _i = 0, _a = sig.unionSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + var instance = getReturnTypeOfSignature(signature); + if (isTypeAny(instance)) { + return instance; + } + var propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); + if (!propType) { + return; + } + results.push(propType); + } + return getIntersectionType(results); + } var instanceType = getReturnTypeOfSignature(sig); return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); } @@ -46745,10 +47212,9 @@ var ts; } } typeFlags |= type.flags; - var nameType = computedNameType && computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */ ? - computedNameType : undefined; + var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined; var prop = nameType ? - createSymbol(4 /* Property */ | member.flags, getLateBoundNameFromType(nameType), 1024 /* Late */) : + createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), 2048 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName); if (nameType) { prop.nameType = nameType; @@ -47006,6 +47472,10 @@ var ts; childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : (getArrayLiteralTupleTypeIfApplicable(childrenTypes, childrenContextualType, /*hasRestElement*/ false) || createArrayType(getUnionType(childrenTypes))); + // Fake up a property declaration for the children + childrenPropSymbol.valueDeclaration = ts.createPropertySignature(/*modifiers*/ undefined, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName), /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined); + childrenPropSymbol.valueDeclaration.parent = attributes; + childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol; var childPropMap = ts.createSymbolTable(); childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, typeFlags, objectFlags); @@ -47348,7 +47818,7 @@ var ts; return true; } } - else if (targetType.flags & 3145728 /* UnionOrIntersection */) { + else if (targetType.flags & 3145728 /* UnionOrIntersection */ && isExcessPropertyCheckTarget(targetType)) { for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) { var t = _a[_i]; if (isKnownProperty(t, name, isComparingJsxAttributes)) { @@ -47356,12 +47826,14 @@ var ts; } } } - else if (targetType.flags & 16777216 /* Conditional */) { - return isKnownProperty(targetType.root.trueType, name, isComparingJsxAttributes) || - isKnownProperty(targetType.root.falseType, name, isComparingJsxAttributes); - } return false; } + function isExcessPropertyCheckTarget(type) { + return !!(type.flags & 524288 /* Object */ && !(ts.getObjectFlags(type) & 512 /* ObjectLiteralPatternWithComputedProperties */) || + type.flags & 67108864 /* NonPrimitive */ || + type.flags & 1048576 /* Union */ && ts.some(type.types, isExcessPropertyCheckTarget) || + type.flags & 2097152 /* Intersection */ && ts.every(type.types, isExcessPropertyCheckTarget)); + } function checkJsxExpression(node, checkMode) { if (node.expression) { var type = checkExpression(node.expression, checkMode); @@ -47402,7 +47874,7 @@ var ts; function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); var errorNode = node.kind === 148 /* QualifiedName */ ? node.right : node.kind === 183 /* ImportType */ ? node : node.name; - if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { + if (ts.getCheckFlags(prop) & 512 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); return false; @@ -47792,7 +48264,7 @@ var ts; } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind !== 183 /* ImportType */ && node.expression.kind === 98 /* SuperKeyword */, property.escapedName, type) + return isValidPropertyAccessWithType(node, node.kind === 189 /* PropertyAccessExpression */ && node.expression.kind === 98 /* SuperKeyword */, property.escapedName, type) && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); } function isValidMethodAccess(method, actualThisType) { @@ -48477,15 +48949,32 @@ var ts; return related ? addRelatedInfo(diagnostic, related) : diagnostic; } function getTypeArgumentArityError(node, signatures, typeArguments) { - var min = Infinity; - var max = -Infinity; + var argCount = typeArguments.length; + // No overloads exist + if (signatures.length === 1) { + var sig = signatures[0]; + var min_1 = getMinTypeArgumentCount(sig.typeParameters); + var max = ts.length(sig.typeParameters); + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + "-" + max : min_1, argCount); + } + // Overloads exist + var belowArgCount = -Infinity; + var aboveArgCount = Infinity; for (var _i = 0, signatures_5 = signatures; _i < signatures_5.length; _i++) { var sig = signatures_5[_i]; - min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters)); - max = Math.max(max, ts.length(sig.typeParameters)); + var min_2 = getMinTypeArgumentCount(sig.typeParameters); + var max = ts.length(sig.typeParameters); + if (min_2 > argCount) { + aboveArgCount = Math.min(aboveArgCount, min_2); + } + else if (max < argCount) { + belowArgCount = Math.max(belowArgCount, max); + } } - var paramCount = min === max ? min : min + "-" + max; - return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length); + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + } + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp, fallbackError) { var isTaggedTemplate = node.kind === 193 /* TaggedTemplateExpression */; @@ -48666,6 +49155,12 @@ var ts; if (inferenceContext) { var typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration)); + // If the original signature has a generic rest type, instantiation may produce a + // signature with different arity and we need to perform another arity check. + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) { + candidateForArgumentArityError = checkCandidate; + continue; + } } if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) @@ -48714,7 +49209,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_7 = function (i) { + var _loop_8 = function (i) { var symbols = ts.mapDefined(candidates, function (_a) { var parameters = _a.parameters, hasRestParameter = _a.hasRestParameter; return hasRestParameter ? @@ -48725,7 +49220,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_7(i); + _loop_8(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return c.hasRestParameter ? ts.last(c.parameters) : undefined; }); var hasRestParameter = restParameterSymbols.length !== 0; @@ -48882,7 +49377,7 @@ var ts; */ function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) { // We exclude union types because we may have a union of function types that happen to have no common signatures. - return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 262144 /* TypeParameter */ || + return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 /* Union */ | 131072 /* Never */)) && isTypeAssignableTo(funcType, globalFunctionType); } function resolveNewExpression(node, candidatesOutArray, isForSignatureHelp) { @@ -49217,7 +49712,7 @@ var ts; return true; // If the symbol of the node has members, treat it like a constructor. var symbol = getSymbolOfNode(func); - return !!symbol && symbol.members !== undefined; + return !!symbol && (symbol.members !== undefined || symbol.exports !== undefined && symbol.exports.get("prototype") !== undefined); } return false; } @@ -49234,10 +49729,6 @@ var ts; inferred = getInferredClassType(symbol); } var assigned = getAssignedClassType(symbol); - var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType) && isJSConstructor(valueType.symbol.valueDeclaration)) { - inferred = getInferredClassType(valueType.symbol); - } return assigned && inferred ? getIntersectionType([inferred, assigned]) : assigned || inferred; @@ -49272,11 +49763,6 @@ var ts; } return links.inferredClassType; } - function isInferredClassType(type) { - return type.symbol - && ts.getObjectFlags(type) & 16 /* Anonymous */ - && getSymbolLinks(type.symbol).inferredClassType === type; - } /** * Syntactically and semantically checks a call or new expression. * @param node The call/new expression to be checked. @@ -49295,20 +49781,9 @@ var ts; declaration.kind !== 157 /* Constructor */ && declaration.kind !== 161 /* ConstructSignature */ && declaration.kind !== 166 /* ConstructorType */ && - !ts.isJSDocConstructSignature(declaration)) { - // When resolved signature is a call signature (and not a construct signature) the result type is any, unless - // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations - // in a JS file - // Note:JS inferred classes might come from a variable declaration instead of a function declaration. - // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration. - var funcSymbol = checkExpression(node.expression).symbol; - if (!funcSymbol && node.expression.kind === 72 /* Identifier */) { - funcSymbol = getResolvedSymbol(node.expression); - } - var type = funcSymbol && getJSClassType(funcSymbol); - if (type) { - return signature.target ? instantiateType(type, signature.mapper) : type; - } + !ts.isJSDocConstructSignature(declaration) && + !isJSConstructor(declaration)) { + // When resolved signature is a call signature (and not a construct signature) the result type is any if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -50363,7 +50838,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -50384,20 +50859,18 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } if (property.kind === 275 /* PropertyAssignment */ || property.kind === 276 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 149 /* ComputedPropertyName */) { - checkComputedPropertyName(name); - } - if (isComputedNonLiteralName(name)) { - return undefined; - } - var type = getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis); - if (type) { - // non-shorthand property assignments should always have initializers - return checkDestructuringAssignment(property.kind === 276 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } - else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); + var exprType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(exprType)) { + var text = getPropertyNameFromType(exprType); + var prop = getPropertyOfType(objectLiteralType, text); + if (prop) { + markPropertyAsReferenced(prop, property, rightIsThis); + checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); + } } + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); + var type = getFlowTypeOfDestructuring(property, elementType); + return checkDestructuringAssignment(property.kind === 276 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } else if (property.kind === 277 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { @@ -50417,23 +50890,6 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis) { - if (isTypeAny(objectLiteralType)) { - return objectLiteralType; - } - var type; - var text = ts.getTextOfPropertyName(name); - if (text) { // TODO: GH#26379 - var prop = getPropertyOfType(objectLiteralType, text); - if (prop) { - markPropertyAsReferenced(prop, property, rightIsThis); - checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); - type = getTypeOfSymbol(prop); - } - type = type || (isNumericLiteralName(text) ? getIndexTypeOfType(objectLiteralType, 1 /* Number */) : undefined); - } - return type || getIndexTypeOfType(objectLiteralType, 0 /* String */); - } function checkArrayLiteralAssignment(node, sourceType, checkMode) { var elements = node.elements; if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { @@ -50453,39 +50909,30 @@ var ts; var element = elements[elementIndex]; if (element.kind !== 210 /* OmittedExpression */) { if (element.kind !== 208 /* SpreadElement */) { - var propName = "" + elementIndex; - var type = isTypeAny(sourceType) ? sourceType : - everyType(sourceType, isTupleLikeType) ? getTupleElementType(sourceType, elementIndex) : - elementType; - if (type) { + var indexType = getLiteralType(elementIndex); + if (isArrayLikeType(sourceType)) { + // We create a synthetic expression so that getIndexedAccessType doesn't get confused + // when the element is a SyntaxKind.ElementAccessExpression. + var elementType_2 = getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)); + var type = getFlowTypeOfDestructuring(element, elementType_2); return checkDestructuringAssignment(element, type, checkMode); } - // We still need to check element expression here because we may need to set appropriate flag on the expression - // such as NodeCheckFlags.LexicalThis on "this"expression. - checkExpression(element); - if (isTupleType(sourceType)) { - error(element, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), getTypeReferenceArity(sourceType), elements.length); - } - else { - error(element, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); - } + return checkDestructuringAssignment(element, elementType, checkMode); + } + if (elementIndex < elements.length - 1) { + error(element, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { - if (elementIndex < elements.length - 1) { - error(element, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + var restExpression = element.expression; + if (restExpression.kind === 204 /* BinaryExpression */ && restExpression.operatorToken.kind === 59 /* EqualsToken */) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - var restExpression = element.expression; - if (restExpression.kind === 204 /* BinaryExpression */ && restExpression.operatorToken.kind === 59 /* EqualsToken */) { - error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); - } - else { - checkGrammarForDisallowedTrailingComma(node.elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - var type = everyType(sourceType, isTupleType) ? - mapType(sourceType, function (t) { return sliceTupleType(t, elementIndex); }) : - createArrayType(elementType); - return checkDestructuringAssignment(restExpression, type, checkMode); - } + checkGrammarForDisallowedTrailingComma(node.elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + var type = everyType(sourceType, isTupleType) ? + mapType(sourceType, function (t) { return sliceTupleType(t, elementIndex); }) : + createArrayType(elementType); + return checkDestructuringAssignment(restExpression, type, checkMode); } } } @@ -51006,7 +51453,8 @@ var ts; var type = getTypeOfExpression(initializer, /*cache*/ true); var widened = ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.isDeclarationReadonly(declaration) || - isTypeAssertion(initializer) ? type : getWidenedLiteralType(type); + isTypeAssertion(initializer) || + isLiteralOfContextualType(type, getContextualType(initializer)) ? type : getWidenedLiteralType(type); if (ts.isInJSFile(declaration)) { if (widened.flags & 98304 /* Nullable */) { reportImplicitAny(declaration, anyType); @@ -51689,7 +52137,7 @@ var ts; // Constructors of classes with no extends clause may not contain super calls, whereas // constructors of derived classes must contain at least one super call somewhere in their function body. var containingClassDecl = node.parent; - if (ts.getEffectiveBaseTypeNode(containingClassDecl)) { + if (ts.getClassExtendsHeritageElement(containingClassDecl)) { captureLexicalThis(node.parent, containingClassDecl); var classExtendsNull = classDeclarationExtendsNull(containingClassDecl); var superCall = getSuperCallInConstructor(node); @@ -51883,7 +52331,6 @@ var ts; break; } } - checkGrammarForDisallowedTrailingComma(node.elementTypes); ts.forEach(node.elementTypes, checkSourceElement); } function checkUnionOrIntersectionType(node) { @@ -52252,10 +52699,10 @@ var ts; case 248 /* ImportEqualsDeclaration */: case 251 /* NamespaceImport */: case 250 /* ImportClause */: - var result_4 = 0 /* None */; + var result_5 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_4 |= getDeclarationSpaces(d); }); - return result_4; + ts.forEach(target.declarations, function (d) { result_5 |= getDeclarationSpaces(d); }); + return result_5; case 237 /* VariableDeclaration */: case 186 /* BindingElement */: case 239 /* FunctionDeclaration */: @@ -52743,7 +53190,12 @@ var ts; return; } if (!containsArgumentsReference(decl)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 148 /* QualifiedName */ ? node.name.right : node.name)); + if (ts.isQualifiedName(node.name)) { + error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left)); + } + else { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name)); + } } else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && @@ -53405,10 +53857,11 @@ var ts; var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - if (!ts.isBindingPattern(name)) { - var nameText = ts.getTextOfPropertyName(name); - if (nameText) { - var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 + if (!ts.isBindingPattern(name) && parentType) { + var exprType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(exprType)) { + var nameText = getPropertyNameFromType(exprType); + var property = getPropertyOfType(parentType, nameText); if (property) { markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); @@ -53765,7 +54218,7 @@ var ts; ? downlevelIteration ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator : isIterable - ? ts.Diagnostics.Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators : ts.Diagnostics.Type_0_is_not_an_array_type : downlevelIteration ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator @@ -54281,6 +54734,7 @@ var ts; if (produceDiagnostics) { if (node.default) { seenDefault = true; + checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i); } else if (seenDefault) { error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); @@ -54294,6 +54748,23 @@ var ts; } } } + /** Check that type parameter defaults only reference previously declared type parameters */ + function checkTypeParametersNotReferenced(root, typeParameters, index) { + visit(root); + function visit(node) { + if (node.kind === 164 /* TypeReference */) { + var type = getTypeFromTypeReference(node); + if (type.flags & 262144 /* TypeParameter */) { + for (var i = index; i < typeParameters.length; i++) { + if (type.symbol === getSymbolOfNode(typeParameters[i])) { + error(node, ts.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); + } + } + } + } + ts.forEachChild(node, visit); + } + } /** Check that type parameter lists are identical across multiple declarations */ function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { @@ -54484,7 +54955,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_8 = function (member) { + var _loop_9 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -54503,7 +54974,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_8(member); + _loop_9(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -54777,7 +55248,7 @@ var ts; return 0; } else if (isConstEnum) { - error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + error(initializer, ts.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values); } else if (member.parent.flags & 4194304 /* Ambient */) { error(initializer, ts.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); @@ -56806,7 +57277,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -56859,7 +57332,7 @@ var ts; isLateBound: function (nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration); var symbol = node && getSymbolOfNode(node); - return !!(symbol && ts.getCheckFlags(symbol) & 1024 /* Late */); + return !!(symbol && ts.getCheckFlags(symbol) & 2048 /* Late */); }, getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; }, getAllAccessorDeclarations: function (accessor) { @@ -56961,6 +57434,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -57451,9 +57937,6 @@ var ts; if (!(parameter.flags & 4194304 /* Ambient */)) { // Allow `...foo,` in ambient declarations; see GH#23070 checkGrammarForDisallowedTrailingComma(parameters, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); } - if (ts.isBindingPattern(parameter.name)) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -58392,6 +58875,7 @@ var ts; if (nodeArguments.length !== 1) { return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument); } + checkGrammarForDisallowedTrailingComma(nodeArguments); // see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import. // parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import. if (ts.isSpreadElement(nodeArguments[0])) { @@ -58439,9 +58923,6 @@ var ts; JsxNames.LibraryManagedAttributes = "LibraryManagedAttributes"; // tslint:enable variable-name })(JsxNames || (JsxNames = {})); - function typeIsLiteralType(type) { - return !!(type.flags & 2944 /* Literal */); - } })(ts || (ts = {})); var ts; (function (ts) { @@ -60827,22 +61308,62 @@ var ts; return node; } ts.createBundle = createBundle; - function createUnparsedSourceFile(text, mapPath, map) { + function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, map) { var node = ts.createNode(281 /* UnparsedSource */); - node.text = text; - node.sourceMapPath = mapPath; - node.sourceMapText = map; + if (!ts.isString(textOrInputFiles)) { + ts.Debug.assert(mapPathOrType === "js" || mapPathOrType === "dts"); + node.fileName = mapPathOrType === "js" ? textOrInputFiles.javascriptPath : textOrInputFiles.declarationPath; + node.sourceMapPath = mapPathOrType === "js" ? textOrInputFiles.javascriptMapPath : textOrInputFiles.declarationMapPath; + Object.defineProperties(node, { + text: { get: function () { return mapPathOrType === "js" ? textOrInputFiles.javascriptText : textOrInputFiles.declarationText; } }, + sourceMapText: { get: function () { return mapPathOrType === "js" ? textOrInputFiles.javascriptMapText : textOrInputFiles.declarationMapText; } }, + }); + } + else { + node.text = textOrInputFiles; + node.sourceMapPath = mapPathOrType; + node.sourceMapText = map; + } return node; } ts.createUnparsedSourceFile = createUnparsedSourceFile; - function createInputFiles(javascript, declaration, javascriptMapPath, javascriptMapText, declarationMapPath, declarationMapText) { + function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapText) { var node = ts.createNode(282 /* InputFiles */); - node.javascriptText = javascript; - node.javascriptMapPath = javascriptMapPath; - node.javascriptMapText = javascriptMapText; - node.declarationText = declaration; - node.declarationMapPath = declarationMapPath; - node.declarationMapText = declarationMapText; + if (!ts.isString(javascriptTextOrReadFileText)) { + var cache_1 = ts.createMap(); + var textGetter_1 = function (path) { + if (path === undefined) + return undefined; + var value = cache_1.get(path); + if (value === undefined) { + value = javascriptTextOrReadFileText(path); + cache_1.set(path, value !== undefined ? value : false); + } + return value !== false ? value : undefined; + }; + var definedTextGetter_1 = function (path) { + var result = textGetter_1(path); + return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n"; + }; + node.javascriptPath = declarationTextOrJavascriptPath; + node.javascriptMapPath = javascriptMapPath; + node.declarationPath = ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath); + node.declarationMapPath = declarationMapPath; + Object.defineProperties(node, { + javascriptText: { get: function () { return definedTextGetter_1(declarationTextOrJavascriptPath); } }, + javascriptMapText: { get: function () { return textGetter_1(javascriptMapPath); } }, + declarationText: { get: function () { return definedTextGetter_1(ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath)); } }, + declarationMapText: { get: function () { return textGetter_1(declarationMapPath); } } // TODO:: if there is inline sourceMap in dtsFile, use that + }); + } + else { + node.javascriptText = javascriptTextOrReadFileText; + node.javascriptMapPath = javascriptMapPath; + node.javascriptMapText = javascriptMapTextOrDeclarationPath; + node.declarationText = declarationTextOrJavascriptPath; + node.declarationMapPath = declarationMapPath; + node.declarationMapText = declarationMapText; + } return node; } ts.createInputFiles = createInputFiles; @@ -64005,15 +64526,19 @@ var ts; // Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M]) var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/; var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; + function getLineInfo(text, lineStarts) { + return { + getLineCount: function () { return lineStarts.length; }, + getLineText: function (line) { return text.substring(lineStarts[line], lineStarts[line + 1]); } + }; + } + ts.getLineInfo = getLineInfo; /** * Tries to find the sourceMappingURL comment at the end of a file. - * @param text The source text of the file. - * @param lineStarts The line starts of the file. */ - function tryGetSourceMappingURL(text, lineStarts) { - if (lineStarts === void 0) { lineStarts = ts.computeLineStarts(text); } - for (var index = lineStarts.length - 1; index >= 0; index--) { - var line = text.substring(lineStarts[index], lineStarts[index + 1]); + function tryGetSourceMappingURL(lineInfo) { + for (var index = lineInfo.getLineCount() - 1; index >= 0; index--) { + var line = lineInfo.getLineText(index); var comment = sourceMapCommentRegExp.exec(line); if (comment) { return comment[1]; @@ -64257,7 +64782,10 @@ var ts; && left.sourcePosition === right.sourcePosition; } function compareSourcePositions(left, right) { - return ts.compareValues(left.sourceIndex, right.sourceIndex); + // Compares sourcePosition without comparing sourceIndex + // since the mappings are grouped by sourceIndex + ts.Debug.assert(left.sourceIndex === right.sourceIndex); + return ts.compareValues(left.sourcePosition, right.sourcePosition); } function compareGeneratedPositions(left, right) { return ts.compareValues(left.generatedPosition, right.generatedPosition); @@ -64272,11 +64800,9 @@ var ts; var mapDirectory = ts.getDirectoryPath(mapPath); var sourceRoot = map.sourceRoot ? ts.getNormalizedAbsolutePath(map.sourceRoot, mapDirectory) : mapDirectory; var generatedAbsoluteFilePath = ts.getNormalizedAbsolutePath(map.file, mapDirectory); - var generatedCanonicalFilePath = host.getCanonicalFileName(generatedAbsoluteFilePath); - var generatedFile = host.getSourceFileLike(generatedCanonicalFilePath); + var generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); var sourceFileAbsolutePaths = map.sources.map(function (source) { return ts.getNormalizedAbsolutePath(source, sourceRoot); }); - var sourceFileCanonicalPaths = sourceFileAbsolutePaths.map(function (source) { return host.getCanonicalFileName(source); }); - var sourceToSourceIndexMap = ts.createMapFromEntries(sourceFileCanonicalPaths.map(function (source, i) { return [source, i]; })); + var sourceToSourceIndexMap = ts.createMapFromEntries(sourceFileAbsolutePaths.map(function (source, i) { return [host.getCanonicalFileName(source), i]; })); var decodedMappings; var generatedMappings; var sourceMappings; @@ -64286,16 +64812,15 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter, /*allowEdits*/ true) : -1; var source; var sourcePosition; if (isSourceMapping(mapping)) { - var sourceFilePath = sourceFileCanonicalPaths[mapping.sourceIndex]; - var sourceFile = host.getSourceFileLike(sourceFilePath); + var sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter, /*allowEdits*/ true) : -1; } return { @@ -65189,7 +65714,7 @@ var ts; function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { if (prepend.kind === 282 /* InputFiles */) { - return ts.createUnparsedSourceFile(prepend.javascriptText, prepend.javascriptMapPath, prepend.javascriptMapText); + return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; })); @@ -66713,6 +67238,7 @@ var ts; switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); + case 202 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -70483,7 +71009,7 @@ var ts; if (node.name) { enableSubstitutionsForBlockScopedBindings(); } - var extendsClauseElement = ts.getEffectiveBaseTypeNode(node); + var extendsClauseElement = ts.getClassExtendsHeritageElement(node); var classFunction = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, @@ -70892,7 +71418,7 @@ var ts; * synthesized call to `super` */ function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { - return node && node.dotDotDotToken && node.name.kind === 72 /* Identifier */ && !inConstructorWithSynthesizedSuper; + return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); } /** * Adds statements to the body of a function-like node if it contains a rest parameter. @@ -70909,10 +71435,10 @@ var ts; return; } // `declarationName` is the name of the local declaration for the parameter. - var declarationName = ts.getMutableClone(parameter.name); + var declarationName = parameter.name.kind === 72 /* Identifier */ ? ts.getMutableClone(parameter.name) : ts.createTempVariable(/*recordTempVariable*/ undefined); ts.setEmitFlags(declarationName, 48 /* NoSourceMap */); // `expressionName` is the name of the parameter used in expressions. - var expressionName = ts.getSynthesizedClone(parameter.name); + var expressionName = parameter.name.kind === 72 /* Identifier */ ? ts.getSynthesizedClone(parameter.name) : declarationName; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; @@ -70936,6 +71462,11 @@ var ts; ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */); ts.startOnNewLine(forStatement); statements.push(forStatement); + if (parameter.name.kind !== 72 /* Identifier */) { + // do the actual destructuring of the rest parameter if necessary + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName))), parameter), 1048576 /* CustomPrologue */)); + } } /** * Adds a statement to capture the `this` of a function declaration if it is needed. @@ -79171,6 +79702,7 @@ var ts; case 241 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; + case 166 /* ConstructorType */: case 161 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; @@ -79189,6 +79721,7 @@ var ts; diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; + case 165 /* FunctionType */: case 239 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; @@ -79414,7 +79947,7 @@ var ts; return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { if (prepend.kind === 282 /* InputFiles */) { - return ts.createUnparsedSourceFile(prepend.declarationText, prepend.declarationMapPath, prepend.declarationMapText); + return ts.createUnparsedSourceFile(prepend, "dts"); } })); bundle.syntheticFileReferences = []; @@ -79766,7 +80299,10 @@ var ts; if (!ts.isLateVisibilityPaintedStatement(i)) { return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind)); } + var priorNeedsDeclare = needsDeclare; + needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit); var result = transformTopLevelDeclaration(i, /*privateDeclaration*/ true); + needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set("" + ts.getOriginalNodeId(i), result); } // And lastly, we need to get the final form of all those indetermine import declarations from before and add them to the output list @@ -80129,7 +80665,8 @@ var ts; var extendsClause_1 = ts.getEffectiveBaseTypeNode(input); if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 96 /* NullKeyword */) { // We must add a temporary declaration for the extends clause expression - var newId_1 = ts.createOptimisticUniqueName(ts.unescapeLeadingUnderscores(input.name.escapedText) + "_base"); // TODO: GH#18217 + var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default"; + var newId_1 = ts.createOptimisticUniqueName(oldId + "_base"); getSymbolAccessibilityDiagnostic = function () { return ({ diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: extendsClause_1, @@ -80283,7 +80820,7 @@ var ts; var prop = ts.createProperty(/*decorators*/ undefined, maskModifiers(node, /*mask*/ undefined, (!accessors.setAccessor) ? 64 /* Readonly */ : 0 /* None */), node.name, node.questionToken, ensureType(node, accessorType), /*initializer*/ undefined); var leadingsSyntheticCommentRanges = accessors.secondAccessor && ts.getLeadingCommentRangesOfNode(accessors.secondAccessor, currentSourceFile); if (leadingsSyntheticCommentRanges) { - var _loop_9 = function (range) { + var _loop_10 = function (range) { if (range.kind === 3 /* MultiLineCommentTrivia */) { var text = currentSourceFile.text.slice(range.pos + 2, range.end - 2); var lines = text.split(/\r\n?|\n/g); @@ -80297,7 +80834,7 @@ var ts; }; for (var _i = 0, leadingsSyntheticCommentRanges_1 = leadingsSyntheticCommentRanges; _i < leadingsSyntheticCommentRanges_1.length; _i++) { var range = leadingsSyntheticCommentRanges_1[_i]; - _loop_9(range); + _loop_10(range); } } return prop; @@ -80771,16 +81308,21 @@ var ts; } ts.forEachEmittedFile = forEachEmittedFile; /*@internal*/ + function getOutputPathsForBundle(options, forceDtsPaths) { + var outPath = options.outFile || options.out; + var jsFilePath = options.emitDeclarationOnly ? undefined : outPath; + var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.removeFileExtension(outPath) + ".d.ts" /* Dts */ : undefined; + var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; + var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined; + return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath }; + } + ts.getOutputPathsForBundle = getOutputPathsForBundle; + /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); if (sourceFile.kind === 280 /* Bundle */) { - var outPath = options.outFile || options.out; - var jsFilePath = options.emitDeclarationOnly ? undefined : outPath; - var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.removeFileExtension(outPath) + ".d.ts" /* Dts */ : undefined; - var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; - var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined; - return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath }; + return getOutputPathsForBundle(options, forceDtsPaths); } else { var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options)); @@ -82187,18 +82729,22 @@ var ts; function emitPropertyAccessExpression(node) { var indentBeforeDot = false; var indentAfterDot = false; + var dotRangeFirstCommentStart = ts.skipTrivia(currentSourceFile.text, node.expression.end, + /*stopAfterLineBreak*/ false, + /*stopAtComments*/ true); + var dotRangeStart = ts.skipTrivia(currentSourceFile.text, dotRangeFirstCommentStart); + var dotRangeEnd = dotRangeStart + 1; if (!(ts.getEmitFlags(node) & 131072 /* NoIndentation */)) { - var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = ts.createToken(24 /* DotToken */); - dotToken.pos = dotRangeStart; + dotToken.pos = node.expression.end; dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } emitExpression(node.expression); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); - var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); + var dotHasCommentTrivia = dotRangeFirstCommentStart !== dotRangeStart; + var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression, dotHasCommentTrivia); if (shouldEmitDotDot) { writePunctuation("."); } @@ -82209,13 +82755,15 @@ var ts; } // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal - function needsDotDotForPropertyAccess(expression) { + function needsDotDotForPropertyAccess(expression, dotHasTrivia) { expression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isNumericLiteral(expression)) { // check if numeric literal is a decimal literal that was originally written with a dot var text = getLiteralTextOfNode(expression, /*neverAsciiEscape*/ true); - return !expression.numericLiteralFlags - && !ts.stringContains(text, ts.tokenToString(24 /* DotToken */)); + // If he number will be printed verbatim and it doesn't already contain a dot, add one + // if the expression doesn't have any comments that will be emitted. + return !expression.numericLiteralFlags && !ts.stringContains(text, ts.tokenToString(24 /* DotToken */)) && + (!dotHasTrivia || printerOptions.removeComments); } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { // check if constant enum value is integer @@ -82966,6 +83514,7 @@ var ts; function emitJsxSelfClosingElement(node) { writePunctuation("<"); emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); writeSpace(); emit(node.attributes); writePunctuation("/>"); @@ -82979,6 +83528,7 @@ var ts; writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); if (node.attributes.properties && node.attributes.properties.length > 0) { writeSpace(); } @@ -84567,10 +85117,10 @@ var ts; } } /** - * Skips trivia such as comments and white-space that can optionally overriden by the source map source + * Skips trivia such as comments and white-space that can be optionally overridden by the source-map source */ function skipSourceTrivia(source, pos) { - return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(sourceMapSource.text, pos); + return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(source.text, pos); } /** * Emits a mapping. @@ -84584,7 +85134,7 @@ var ts; if (sourceMapsDisabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { return; } - var _a = ts.getLineAndCharacterOfPosition(currentSourceFile, pos), sourceLine = _a.line, sourceCharacter = _a.character; + var _a = ts.getLineAndCharacterOfPosition(sourceMapSource, pos), sourceLine = _a.line, sourceCharacter = _a.character; sourceMapGenerator.addMapping(writer.getLine(), writer.getColumn(), sourceMapSourceIndex, sourceLine, sourceCharacter, /*nameIndex*/ undefined); } @@ -84993,7 +85543,7 @@ var ts; }, flags); } function getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo) { - return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo1); + return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2); } function closeFileWatcherOf(objWithWatcher) { objWithWatcher.watcher.close(); @@ -85180,13 +85730,12 @@ var ts; } ts.createCompilerHostWorker = createCompilerHostWorker; /*@internal*/ - function changeCompilerHostToUseCache(host, toPath, useCacheForSourceFile) { + function changeCompilerHostLikeToUseCache(host, toPath, getSourceFile) { var originalReadFile = host.readFile; var originalFileExists = host.fileExists; var originalDirectoryExists = host.directoryExists; var originalCreateDirectory = host.createDirectory; var originalWriteFile = host.writeFile; - var originalGetSourceFile = host.getSourceFile; var readFileCache = ts.createMap(); var fileExistsCache = ts.createMap(); var directoryExistsCache = ts.createMap(); @@ -85213,19 +85762,17 @@ var ts; } return setReadFileCache(key, fileName); }; - if (useCacheForSourceFile) { - host.getSourceFile = function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { - var key = toPath(fileName); - var value = sourceFileCache.get(key); - if (value) - return value; - var sourceFile = originalGetSourceFile.call(host, fileName, languageVersion, onError, shouldCreateNewSourceFile); - if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Json */))) { - sourceFileCache.set(key, sourceFile); - } - return sourceFile; - }; - } + var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { + var key = toPath(fileName); + var value = sourceFileCache.get(key); + if (value) + return value; + var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile); + if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Json */))) { + sourceFileCache.set(key, sourceFile); + } + return sourceFile; + } : undefined; // fileExists for any kind of extension host.fileExists = function (fileName) { var key = toPath(fileName); @@ -85236,22 +85783,24 @@ var ts; fileExistsCache.set(key, !!newValue); return newValue; }; - host.writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) { - var key = toPath(fileName); - fileExistsCache.delete(key); - var value = readFileCache.get(key); - if (value && value !== data) { - readFileCache.delete(key); - sourceFileCache.delete(key); - } - else if (useCacheForSourceFile) { - var sourceFile = sourceFileCache.get(key); - if (sourceFile && sourceFile.text !== data) { + if (originalWriteFile) { + host.writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) { + var key = toPath(fileName); + fileExistsCache.delete(key); + var value = readFileCache.get(key); + if (value && value !== data) { + readFileCache.delete(key); sourceFileCache.delete(key); } - } - originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); - }; + else if (getSourceFileWithCache) { + var sourceFile = sourceFileCache.get(key); + if (sourceFile && sourceFile.text !== data) { + sourceFileCache.delete(key); + } + } + originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); + }; + } // directoryExists if (originalDirectoryExists && originalCreateDirectory) { host.directoryExists = function (directory) { @@ -85275,11 +85824,11 @@ var ts; originalDirectoryExists: originalDirectoryExists, originalCreateDirectory: originalCreateDirectory, originalWriteFile: originalWriteFile, - originalGetSourceFile: originalGetSourceFile, + getSourceFileWithCache: getSourceFileWithCache, readFileWithCache: readFileWithCache }; } - ts.changeCompilerHostToUseCache = changeCompilerHostToUseCache; + ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (ts.getEmitDeclarations(program.getCompilerOptions())) { @@ -85612,7 +86161,7 @@ var ts; var sourceFilesFoundSearchingNodeModules = ts.createMap(); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); - var configParsingHost = parseConfigHostFromCompilerHost(host); + var configParsingHost = parseConfigHostFromCompilerHostLike(host); var skipDefaultLib = options.noLib; var getDefaultLibraryFileName = ts.memoize(function () { return host.getDefaultLibFileName(options); }); var defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : ts.getDirectoryPath(getDefaultLibraryFileName()); @@ -85658,6 +86207,12 @@ var ts; var sourceFileToPackageName = ts.createMap(); // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it. var redirectTargetsMap = ts.createMultiMap(); + /** + * map with + * - SourceFile if present + * - false if sourceFile missing for source of project reference redirect + * - undefined otherwise + */ var filesByName = ts.createMap(); var missingFilePaths; // stores 'filename -> file association' ignoring case @@ -85718,7 +86273,10 @@ var ts; }); } } - missingFilePaths = ts.arrayFrom(filesByName.keys(), function (p) { return p; }).filter(function (p) { return !filesByName.get(p); }); + missingFilePaths = ts.arrayFrom(ts.mapDefinedIterator(filesByName.entries(), function (_a) { + var path = _a[0], file = _a[1]; + return file === undefined ? path : undefined; + })); files = ts.stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); processingDefaultLibFiles = undefined; processingOtherFiles = undefined; @@ -85864,13 +86422,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_5 = []; + var result_6 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_5.push(resolvedModule); + result_6.push(resolvedModule); } - return result_5; + return result_6; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -86233,14 +86791,12 @@ var ts; // Upstream project didn't have outFile set -- skip (error will have been issued earlier) if (!out) continue; - var dtsFilename = ts.changeExtension(out, ".d.ts"); - var js = host.readFile(out) || "/* Input file " + out + " was missing */\r\n"; - var jsMapPath = out + ".map"; // TODO: try to read sourceMappingUrl comment from the file - var jsMap = host.readFile(jsMapPath); - var dts = host.readFile(dtsFilename) || "/* Input file " + dtsFilename + " was missing */\r\n"; - var dtsMapPath = dtsFilename + ".map"; - var dtsMap = host.readFile(dtsMapPath); - var node = ts.createInputFiles(js, dts, jsMap && jsMapPath, jsMap, dtsMap && dtsMapPath, dtsMap); + var _a = ts.getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath; + var node = ts.createInputFiles(function (fileName) { + var path = toPath(fileName); + var sourceFile = getSourceFileByPath(path); + return sourceFile ? sourceFile.text : filesByName.has(path) ? undefined : host.readFile(path); + }, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath); nodes.push(node); } } @@ -86326,7 +86882,7 @@ var ts; return getSourceFileByPath(toPath(fileName)); } function getSourceFileByPath(path) { - return filesByName.get(path); + return filesByName.get(path) || undefined; } function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) { if (sourceFile) { @@ -86804,7 +87360,7 @@ var ts; } /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */ function getSourceFileFromReference(referencingFile, ref) { - return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), function (fileName) { return filesByName.get(toPath(fileName)); }); + return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), function (fileName) { return filesByName.get(toPath(fileName)) || undefined; }); } function getSourceFileFromReferenceWorker(fileName, getSourceFile, fail, refFile) { if (ts.hasExtension(fileName)) { @@ -86910,7 +87466,9 @@ var ts; processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - processLibReferenceDirectives(file_1); + if (!options.noLib) { + processLibReferenceDirectives(file_1); + } modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } @@ -86921,7 +87479,7 @@ var ts; processImportedModules(file_1); } } - return file_1; + return file_1 || undefined; } var redirectedPath; if (refFile) { @@ -86987,7 +87545,9 @@ var ts; processReferencedFiles(file, isDefaultLib); processTypeReferenceDirectives(file); } - processLibReferenceDirectives(file); + if (!options.noLib) { + processLibReferenceDirectives(file); + } // always process imported modules to record module name resolutions processImportedModules(file); if (isDefaultLib) { @@ -87000,9 +87560,12 @@ var ts; return file; } function addFileToFilesByName(file, path, redirectedPath) { - filesByName.set(path, file); if (redirectedPath) { filesByName.set(redirectedPath, file); + filesByName.set(path, file || false); + } + else { + filesByName.set(path, file); } } function getProjectReferenceRedirect(fileName) { @@ -87665,21 +88228,22 @@ var ts; } ts.createProgram = createProgram; /* @internal */ - function parseConfigHostFromCompilerHost(host) { + function parseConfigHostFromCompilerHostLike(host, directoryStructureHost) { + if (directoryStructureHost === void 0) { directoryStructureHost = host; } return { - fileExists: function (f) { return host.fileExists(f); }, + fileExists: function (f) { return directoryStructureHost.fileExists(f); }, readDirectory: function (root, extensions, excludes, includes, depth) { - ts.Debug.assertDefined(host.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); - return host.readDirectory(root, extensions, excludes, includes, depth); + ts.Debug.assertDefined(directoryStructureHost.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth); }, - readFile: function (f) { return host.readFile(f); }, + readFile: function (f) { return directoryStructureHost.readFile(f); }, useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(), getCurrentDirectory: function () { return host.getCurrentDirectory(); }, - onUnRecoverableConfigFileDiagnostic: function () { return undefined; }, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || (function () { return undefined; }), trace: host.trace ? function (s) { return host.trace(s); } : undefined }; } - ts.parseConfigHostFromCompilerHost = parseConfigHostFromCompilerHost; + ts.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike; function resolveProjectReferencePath(hostOrRef, ref) { var passedInRef = ref ? ref : hostOrRef; return ts.resolveConfigFileProjectName(passedInRef.path); @@ -87746,6 +88310,10 @@ var ts; } } ts.getFileEmitOutput = getFileEmitOutput; + function cloneMapOrUndefined(map) { + return map ? ts.cloneMap(map) : undefined; + } + ts.cloneMapOrUndefined = cloneMapOrUndefined; })(ts || (ts = {})); /*@internal*/ (function (ts) { @@ -87893,12 +88461,35 @@ var ts; fileInfos: fileInfos, referencedMap: referencedMap, exportedModulesMap: exportedModulesMap, - hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, - allFilesExcludingDefaultLibraryFile: undefined, - allFileNames: undefined + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature }; } BuilderState.create = create; + /** + * Releases needed properties + */ + function releaseCache(state) { + state.allFilesExcludingDefaultLibraryFile = undefined; + state.allFileNames = undefined; + } + BuilderState.releaseCache = releaseCache; + /** + * Creates a clone of the state + */ + function clone(state) { + var fileInfos = ts.createMap(); + state.fileInfos.forEach(function (value, key) { + fileInfos.set(key, __assign({}, value)); + }); + // Dont need to backup allFiles info since its cache anyway + return { + fileInfos: fileInfos, + referencedMap: ts.cloneMapOrUndefined(state.referencedMap), + exportedModulesMap: ts.cloneMapOrUndefined(state.exportedModulesMap), + hasCalledUpdateShapeSignature: ts.cloneMap(state.hasCalledUpdateShapeSignature), + }; + } + BuilderState.clone = clone; /** * Gets the files affected by the path from the program */ @@ -88147,7 +88738,7 @@ var ts; var seenFileNamesMap = ts.createMap(); // Start with the paths this file was referenced by seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); - var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); while (queue.length > 0) { var currentPath = queue.pop(); if (!seenFileNamesMap.has(currentPath)) { @@ -88155,7 +88746,7 @@ var ts; seenFileNamesMap.set(currentPath, currentSourceFile); if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 queue.push.apply(// TODO: GH#18217 - queue, getReferencedByPaths(state, currentPath)); + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } @@ -88179,24 +88770,32 @@ var ts; var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState); state.program = newProgram; var compilerOptions = newProgram.getCompilerOptions(); - if (!compilerOptions.outFile && !compilerOptions.out) { + state.compilerOptions = compilerOptions; + // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them + // With --isolatedModules, emitting changed file doesnt emit dependent files so we cant know of dependent files to retrieve errors so dont cache the errors + if (!compilerOptions.outFile && !compilerOptions.out && !compilerOptions.isolatedModules) { state.semanticDiagnosticsPerFile = ts.createMap(); } state.changedFilesSet = ts.createMap(); var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState); - var oldCompilerOptions = useOldState ? oldState.program.getCompilerOptions() : undefined; + var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined; var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile && !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions); if (useOldState) { // Verify the sanity of old state if (!oldState.currentChangedFilePath) { - ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); + var affectedSignatures = oldState.currentAffectedFilesSignatures; + ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); } if (canCopySemanticDiagnostics) { ts.Debug.assert(!ts.forEachKey(oldState.changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files"); } // Copy old state's changed files set ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet); + if (!compilerOptions.outFile && !compilerOptions.out && oldState.affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit; + state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + } } // Update changed files and copy semantic diagnostics if we can var referencedMap = state.referencedMap; @@ -88220,7 +88819,7 @@ var ts; state.changedFilesSet.set(sourceFilePath, true); } else if (canCopySemanticDiagnostics) { - var sourceFile = state.program.getSourceFileByPath(sourceFilePath); + var sourceFile = newProgram.getSourceFileByPath(sourceFilePath); if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) { return; } @@ -88240,6 +88839,36 @@ var ts; }); return state; } + /** + * Releases program and other related not needed properties + */ + function releaseCache(state) { + ts.BuilderState.releaseCache(state); + state.program = undefined; + } + /** + * Creates a clone of the state + */ + function cloneBuilderProgramState(state) { + var newState = ts.BuilderState.clone(state); + newState.semanticDiagnosticsPerFile = ts.cloneMapOrUndefined(state.semanticDiagnosticsPerFile); + newState.changedFilesSet = ts.cloneMap(state.changedFilesSet); + newState.affectedFiles = state.affectedFiles; + newState.affectedFilesIndex = state.affectedFilesIndex; + newState.currentChangedFilePath = state.currentChangedFilePath; + newState.currentAffectedFilesSignatures = ts.cloneMapOrUndefined(state.currentAffectedFilesSignatures); + newState.currentAffectedFilesExportedModulesMap = ts.cloneMapOrUndefined(state.currentAffectedFilesExportedModulesMap); + newState.seenAffectedFiles = ts.cloneMapOrUndefined(state.seenAffectedFiles); + newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles; + newState.semanticDiagnosticsFromOldState = ts.cloneMapOrUndefined(state.semanticDiagnosticsFromOldState); + newState.program = state.program; + newState.compilerOptions = state.compilerOptions; + newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit; + newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; + newState.seenEmittedFiles = ts.cloneMapOrUndefined(state.seenEmittedFiles); + newState.programEmitComplete = state.programEmitComplete; + return newState; + } /** * Verifies that source file is ok to be used in calls that arent handled by next */ @@ -88286,22 +88915,43 @@ var ts; } // With --out or --outFile all outputs go into single file // so operations are performed directly on program, return program - var compilerOptions = state.program.getCompilerOptions(); + var program = ts.Debug.assertDefined(state.program); + var compilerOptions = program.getCompilerOptions(); if (compilerOptions.outFile || compilerOptions.out) { ts.Debug.assert(!state.semanticDiagnosticsPerFile); - return state.program; + return program; } // Get next batch of affected files state.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures || ts.createMap(); if (state.exportedModulesMap) { state.currentAffectedFilesExportedModulesMap = state.currentAffectedFilesExportedModulesMap || ts.createMap(); } - state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, state.program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap); + state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap); state.currentChangedFilePath = nextKey.value; state.affectedFilesIndex = 0; state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } } + /** + * Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet + */ + function getNextAffectedFilePendingEmit(state) { + var affectedFilesPendingEmit = state.affectedFilesPendingEmit; + if (affectedFilesPendingEmit) { + var seenEmittedFiles = state.seenEmittedFiles || (state.seenEmittedFiles = ts.createMap()); + for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) { + var affectedFile = ts.Debug.assertDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]); + if (affectedFile && !seenEmittedFiles.has(affectedFile.path)) { + // emit this file + state.affectedFilesPendingEmitIndex = i; + return affectedFile; + } + } + state.affectedFilesPendingEmit = undefined; + state.affectedFilesPendingEmitIndex = undefined; + } + return undefined; + } /** * Remove the semantic diagnostics cached from old state for affected File and the files that are referencing modules that export entities from affected file */ @@ -88313,9 +88963,10 @@ var ts; // Clean lib file diagnostics if its all files excluding default files to emit if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles && !state.cleanedDiagnosticsOfLibFiles) { state.cleanedDiagnosticsOfLibFiles = true; - var options_2 = state.program.getCompilerOptions(); - if (ts.forEach(state.program.getSourceFiles(), function (f) { - return state.program.isSourceFileDefaultLibrary(f) && + var program_1 = ts.Debug.assertDefined(state.program); + var options_2 = program_1.getCompilerOptions(); + if (ts.forEach(program_1.getSourceFiles(), function (f) { + return program_1.isSourceFileDefaultLibrary(f) && !ts.skipTypeChecking(f, options_2) && removeSemanticDiagnosticsOf(state, f.path); })) { @@ -88376,11 +89027,20 @@ var ts; return true; } // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected - return !!ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { + if (ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it exportedModules.has(filePath) && removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile); - }); + })) { + return true; + } + // Remove diagnostics of files that import this file (without going to exports of referencing files) + return !!ts.forEachEntry(state.referencedMap, function (referencesInFile, referencingFilePath) { + return referencesInFile.has(filePath) && + !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file + removeSemanticDiagnosticsOf(state, referencingFilePath); + } // Dont add to seen since this is not yet done with the export removal + ); } /** * Removes semantic diagnostics for path and @@ -88398,20 +89058,26 @@ var ts; * This is called after completing operation on the next affected file. * The operations here are postponed to ensure that cancellation during the iteration is handled correctly */ - function doneWithAffectedFile(state, affected) { + function doneWithAffectedFile(state, affected, isPendingEmit) { if (affected === state.program) { state.changedFilesSet.clear(); + state.programEmitComplete = true; } else { state.seenAffectedFiles.set(affected.path, true); - state.affectedFilesIndex++; + if (isPendingEmit) { + state.affectedFilesPendingEmitIndex++; + } + else { + state.affectedFilesIndex++; + } } } /** * Returns the result with affected file */ - function toAffectedFileResult(state, result, affected) { - doneWithAffectedFile(state, affected); + function toAffectedFileResult(state, result, affected, isPendingEmit) { + doneWithAffectedFile(state, affected, isPendingEmit); return { result: result, affected: affected }; } /** @@ -88420,14 +89086,18 @@ var ts; */ function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { var path = sourceFile.path; - var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); - // Report the semantic diagnostics from the cache if we already have those diagnostics present - if (cachedDiagnostics) { - return cachedDiagnostics; + if (state.semanticDiagnosticsPerFile) { + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); + // Report the semantic diagnostics from the cache if we already have those diagnostics present + if (cachedDiagnostics) { + return cachedDiagnostics; + } } // Diagnostics werent cached, get them from program, and cache the result - var diagnostics = state.program.getSemanticDiagnostics(sourceFile, cancellationToken); - state.semanticDiagnosticsPerFile.set(path, diagnostics); + var diagnostics = ts.Debug.assertDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); + if (state.semanticDiagnosticsPerFile) { + state.semanticDiagnosticsPerFile.set(path, diagnostics); + } return diagnostics; } var BuilderProgramKind; @@ -88452,7 +89122,7 @@ var ts; rootNames: newProgramOrRootNames, options: hostOrOptions, host: oldProgramOrHost, - oldProgram: oldProgram && oldProgram.getProgram(), + oldProgram: oldProgram && oldProgram.getProgramOrUndefined(), configFileParsingDiagnostics: configFileParsingDiagnostics, projectReferences: projectReferences }); @@ -88483,26 +89153,29 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = host.createHash || ts.identity; + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); + var backupState; // To ensure that we arent storing any references to old program or new program without state newProgram = undefined; // TODO: GH#18217 oldProgram = undefined; oldState = undefined; - var result = { - getState: function () { return state; }, - getProgram: function () { return state.program; }, - getCompilerOptions: function () { return state.program.getCompilerOptions(); }, - getSourceFile: function (fileName) { return state.program.getSourceFile(fileName); }, - getSourceFiles: function () { return state.program.getSourceFiles(); }, - getOptionsDiagnostics: function (cancellationToken) { return state.program.getOptionsDiagnostics(cancellationToken); }, - getGlobalDiagnostics: function (cancellationToken) { return state.program.getGlobalDiagnostics(cancellationToken); }, - getConfigFileParsingDiagnostics: function () { return configFileParsingDiagnostics || state.program.getConfigFileParsingDiagnostics(); }, - getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return state.program.getSyntacticDiagnostics(sourceFile, cancellationToken); }, - getSemanticDiagnostics: getSemanticDiagnostics, - emit: emit, - getAllDependencies: function (sourceFile) { return ts.BuilderState.getAllDependencies(state, state.program, sourceFile); }, - getCurrentDirectory: function () { return state.program.getCurrentDirectory(); } + var result = createRedirectedBuilderProgram(state, configFileParsingDiagnostics); + result.getState = function () { return state; }; + result.backupState = function () { + ts.Debug.assert(backupState === undefined); + backupState = cloneBuilderProgramState(state); + }; + result.restoreState = function () { + state = ts.Debug.assertDefined(backupState); + backupState = undefined; + }; + result.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.assertDefined(state.program), sourceFile); }; + result.getSemanticDiagnostics = getSemanticDiagnostics; + result.emit = emit; + result.releaseProgram = function () { + releaseCache(state); + backupState = undefined; }; if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { result.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; @@ -88521,14 +89194,33 @@ var ts; */ function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { var affected = getNextAffectedFile(state, cancellationToken, computeHash); + var isPendingEmitFile = false; if (!affected) { - // Done - return undefined; + if (!state.compilerOptions.out && !state.compilerOptions.outFile) { + affected = getNextAffectedFilePendingEmit(state); + if (!affected) { + return undefined; + } + isPendingEmitFile = true; + } + else { + var program = ts.Debug.assertDefined(state.program); + // Check if program uses any prepend project references, if thats the case we cant track of the js files of those, so emit even though there are no changes + if (state.programEmitComplete || !ts.some(program.getProjectReferences(), function (ref) { return !!ref.prepend; })) { + state.programEmitComplete = true; + return undefined; + } + affected = program; + } + } + // Mark seen emitted files if there are pending files to be emitted + if (state.affectedFilesPendingEmit && state.program !== affected) { + (state.seenEmittedFiles || (state.seenEmittedFiles = ts.createMap())).set(affected.path, true); } return toAffectedFileResult(state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file - state.program.emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected); + ts.Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected, isPendingEmitFile); } /** * Emits the JavaScript and declaration files. @@ -88565,7 +89257,7 @@ var ts; }; } } - return state.program.emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return ts.Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); } /** * Return the semantic diagnostics for the next affected file or undefined if iteration is complete @@ -88601,25 +89293,38 @@ var ts; */ function getSemanticDiagnostics(sourceFile, cancellationToken) { assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); - var compilerOptions = state.program.getCompilerOptions(); + var compilerOptions = ts.Debug.assertDefined(state.program).getCompilerOptions(); if (compilerOptions.outFile || compilerOptions.out) { ts.Debug.assert(!state.semanticDiagnosticsPerFile); // We dont need to cache the diagnostics just return them from program - return state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + return ts.Debug.assertDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); } if (sourceFile) { return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); } - if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { - // When semantic builder asks for diagnostics of the whole program, - // ensure that all the affected files are handled - var affected = void 0; - while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { - doneWithAffectedFile(state, affected); + // When semantic builder asks for diagnostics of the whole program, + // ensure that all the affected files are handled + var affected; + var affectedFilesPendingEmit; + while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { + if (affected !== state.program && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(affected.path); + } + doneWithAffectedFile(state, affected); + } + // In case of emit builder, cache the files to be emitted + if (affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = ts.concatenate(state.affectedFilesPendingEmit, affectedFilesPendingEmit); + // affectedFilesPendingEmitIndex === undefined + // - means the emit state.affectedFilesPendingEmit was undefined before adding current affected files + // so start from 0 as array would be affectedFilesPendingEmit + // else, continue to iterate from existing index, the current set is appended to existing files + if (state.affectedFilesPendingEmitIndex === undefined) { + state.affectedFilesPendingEmitIndex = 0; } } var diagnostics; - for (var _i = 0, _a = state.program.getSourceFiles(); _i < _a.length; _i++) { + for (var _i = 0, _a = ts.Debug.assertDefined(state.program).getSourceFiles(); _i < _a.length; _i++) { var sourceFile_2 = _a[_i]; diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_2, cancellationToken)); } @@ -88627,6 +89332,32 @@ var ts; } } ts.createBuilderProgram = createBuilderProgram; + function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) { + return { + getState: ts.notImplemented, + backupState: ts.noop, + restoreState: ts.noop, + getProgram: getProgram, + getProgramOrUndefined: function () { return state.program; }, + releaseProgram: function () { return state.program = undefined; }, + getCompilerOptions: function () { return state.compilerOptions; }, + getSourceFile: function (fileName) { return getProgram().getSourceFile(fileName); }, + getSourceFiles: function () { return getProgram().getSourceFiles(); }, + getOptionsDiagnostics: function (cancellationToken) { return getProgram().getOptionsDiagnostics(cancellationToken); }, + getGlobalDiagnostics: function (cancellationToken) { return getProgram().getGlobalDiagnostics(cancellationToken); }, + getConfigFileParsingDiagnostics: function () { return configFileParsingDiagnostics; }, + getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken); }, + getDeclarationDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken); }, + getSemanticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSemanticDiagnostics(sourceFile, cancellationToken); }, + emit: function (sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers) { return getProgram().emit(sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers); }, + getAllDependencies: ts.notImplemented, + getCurrentDirectory: function () { return getProgram().getCurrentDirectory(); } + }; + function getProgram() { + return ts.Debug.assertDefined(state.program); + } + } + ts.createRedirectedBuilderProgram = createRedirectedBuilderProgram; })(ts || (ts = {})); (function (ts) { function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { @@ -88638,23 +89369,8 @@ var ts; } ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - var program = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences).newProgram; - return { - // Only return program, all other methods are not implemented - getProgram: function () { return program; }, - getState: ts.notImplemented, - getCompilerOptions: ts.notImplemented, - getSourceFile: ts.notImplemented, - getSourceFiles: ts.notImplemented, - getOptionsDiagnostics: ts.notImplemented, - getGlobalDiagnostics: ts.notImplemented, - getConfigFileParsingDiagnostics: ts.notImplemented, - getSyntacticDiagnostics: ts.notImplemented, - getSemanticDiagnostics: ts.notImplemented, - emit: ts.notImplemented, - getAllDependencies: ts.notImplemented, - getCurrentDirectory: ts.notImplemented - }; + var _a = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences), newProgram = _a.newProgram, newConfigFileParsingDiagnostics = _a.configFileParsingDiagnostics; + return ts.createRedirectedBuilderProgram({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }, newConfigFileParsingDiagnostics); } ts.createAbstractBuilder = createAbstractBuilder; })(ts || (ts = {})); @@ -89458,7 +90174,7 @@ var ts; if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { return; // Don't want to a package to globally import from itself } - var target = targets.find(function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) return; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); @@ -89833,37 +90549,103 @@ var ts; var onWatchStatusChange = reportWatchStatus || createWatchStatusReporter(system); return { onWatchStatusChange: onWatchStatusChange, - watchFile: system.watchFile ? (function (path, callback, pollingInterval) { return system.watchFile(path, callback, pollingInterval); }) : function () { return noopFileWatcher; }, - watchDirectory: system.watchDirectory ? (function (path, callback, recursive) { return system.watchDirectory(path, callback, recursive); }) : function () { return noopFileWatcher; }, - setTimeout: system.setTimeout ? (function (callback, ms) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var _a; - return (_a = system.setTimeout).call.apply(_a, [system, callback, ms].concat(args)); - }) : ts.noop, - clearTimeout: system.clearTimeout ? (function (timeoutId) { return system.clearTimeout(timeoutId); }) : ts.noop + watchFile: ts.maybeBind(system, system.watchFile) || (function () { return noopFileWatcher; }), + watchDirectory: ts.maybeBind(system, system.watchDirectory) || (function () { return noopFileWatcher; }), + setTimeout: ts.maybeBind(system, system.setTimeout) || ts.noop, + clearTimeout: ts.maybeBind(system, system.clearTimeout) || ts.noop }; } ts.createWatchHost = createWatchHost; + var WatchType; + (function (WatchType) { + WatchType["ConfigFile"] = "Config file"; + WatchType["SourceFile"] = "Source file"; + WatchType["MissingFile"] = "Missing file"; + WatchType["WildcardDirectory"] = "Wild card directory"; + WatchType["FailedLookupLocations"] = "Failed Lookup Locations"; + WatchType["TypeRoots"] = "Type roots"; + })(WatchType = ts.WatchType || (ts.WatchType = {})); + function createWatchFactory(host, options) { + var watchLogLevel = host.trace ? options.extendedDiagnostics ? ts.WatchLogLevel.Verbose : options.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; + var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? (function (s) { return host.trace(s); }) : ts.noop; + var result = ts.getWatchFactory(watchLogLevel, writeLog); + result.writeLog = writeLog; + return result; + } + ts.createWatchFactory = createWatchFactory; + function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost) { + if (directoryStructureHost === void 0) { directoryStructureHost = host; } + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); }); + return { + getSourceFile: function (fileName, languageVersion, onError) { + var text; + try { + ts.performance.mark("beforeIORead"); + text = host.readFile(fileName, getCompilerOptions().charset); + ts.performance.mark("afterIORead"); + ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } + catch (e) { + if (onError) { + onError(e.message); + } + text = ""; + } + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + }, + getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation), + getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, + writeFile: writeFile, + getCurrentDirectory: ts.memoize(function () { return host.getCurrentDirectory(); }), + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), + getNewLine: function () { return ts.getNewLineCharacter(getCompilerOptions(), hostGetNewLine); }, + fileExists: function (f) { return host.fileExists(f); }, + readFile: function (f) { return host.readFile(f); }, + trace: ts.maybeBind(host, host.trace), + directoryExists: ts.maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: ts.maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: ts.maybeBind(host, host.realpath), + getEnvironmentVariable: ts.maybeBind(host, host.getEnvironmentVariable) || (function () { return ""; }), + createHash: ts.maybeBind(host, host.createHash), + readDirectory: ts.maybeBind(host, host.readDirectory), + }; + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + if (host.createDirectory) + host.createDirectory(directoryPath); + } + } + function writeFile(fileName, text, writeByteOrderMark, onError) { + try { + ts.performance.mark("beforeIOWrite"); + ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); + host.writeFile(fileName, text, writeByteOrderMark); + ts.performance.mark("afterIOWrite"); + ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + } + } + ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; /** * Creates the watch compiler host that can be extended with config file or root file names and options host */ - function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { - if (system === void 0) { system = ts.sys; } - if (!createProgram) { - createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram; - } + function createProgramHost(system, createProgram) { + var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); var host = system; host; // tslint:disable-line no-unused-expression (TODO: `host` is unused!) - var useCaseSensitiveFileNames = function () { return system.useCaseSensitiveFileNames; }; - var writeFileName = function (s) { return system.write(s + system.newLine); }; - var _a = createWatchHost(system, reportWatchStatus), onWatchStatusChange = _a.onWatchStatusChange, watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout; return { - useCaseSensitiveFileNames: useCaseSensitiveFileNames, + useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, - getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }), getDefaultLibLocation: getDefaultLibLocation, getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, fileExists: function (path) { return system.fileExists(path); }, @@ -89871,29 +90653,31 @@ var ts; directoryExists: function (path) { return system.directoryExists(path); }, getDirectories: function (path) { return system.getDirectories(path); }, readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); }, - realpath: system.realpath && (function (path) { return system.realpath(path); }), - getEnvironmentVariable: system.getEnvironmentVariable && (function (name) { return system.getEnvironmentVariable(name); }), - watchFile: watchFile, - watchDirectory: watchDirectory, - setTimeout: setTimeout, - clearTimeout: clearTimeout, - trace: function (s) { return system.write(s); }, - onWatchStatusChange: onWatchStatusChange, + realpath: ts.maybeBind(system, system.realpath), + getEnvironmentVariable: ts.maybeBind(system, system.getEnvironmentVariable), + trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, - createHash: system.createHash && (function (s) { return system.createHash(s); }), - createProgram: createProgram, - afterProgramCreate: emitFilesAndReportErrorUsingBuilder + createHash: ts.maybeBind(system, system.createHash), + createProgram: createProgram }; - function getDefaultLibLocation() { - return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); - } - function emitFilesAndReportErrorUsingBuilder(builderProgram) { + } + ts.createProgramHost = createProgramHost; + /** + * Creates the watch compiler host that can be extended with config file or root file names and options host + */ + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + var writeFileName = function (s) { return system.write(s + system.newLine); }; + var result = createProgramHost(system, createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram); + ts.copyProperties(result, createWatchHost(system, reportWatchStatus)); + result.afterProgramCreate = function (builderProgram) { var compilerOptions = builderProgram.getCompilerOptions(); var newLine = ts.getNewLineCharacter(compilerOptions, function () { return system.newLine; }); - emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, function (errorCount) { return onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions); }); - } + emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, function (errorCount) { return result.onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions); }); + }; + return result; } /** * Report error and exit @@ -89949,8 +90733,6 @@ var ts; var hasChangedAutomaticTypeDirectiveNames = false; // True if the automatic type directives have changed var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); var currentDirectory = host.getCurrentDirectory(); - var getCurrentDirectory = function () { return currentDirectory; }; - var readFile = function (path, encoding) { return host.readFile(path, encoding); }; var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, createProgram = host.createProgram; var rootFileNames = host.rootFiles, compilerOptions = host.options, projectReferences = host.projectReferences; var configFileSpecs; @@ -89962,15 +90744,7 @@ var ts; host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); } var directoryStructureHost = cachedDirectoryStructureHost || host; - var parseConfigFileHost = { - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, - fileExists: function (path) { return host.fileExists(path); }, - readFile: readFile, - getCurrentDirectory: getCurrentDirectory, - onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic, - trace: host.trace ? function (s) { return host.trace(s); } : undefined - }; + var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames var newLine = updateNewLine(); if (configFileName && host.configFileParsingResult) { @@ -89984,52 +90758,40 @@ var ts; parseConfigFile(); newLine = updateNewLine(); } - var trace = host.trace && (function (s) { host.trace(s + newLine); }); - var watchLogLevel = trace ? compilerOptions.extendedDiagnostics ? ts.WatchLogLevel.Verbose : - compilerOptions.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; - var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? trace : ts.noop; // TODO: GH#18217 - var _b = ts.getWatchFactory(watchLogLevel, writeLog), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectory = _b.watchDirectory; + var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog; var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); if (configFileName) { - watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High, "Config file"); + watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High, "Config file" /* ConfigFile */); } - var compilerHost = { - // Members for CompilerHost - getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, - getSourceFileByPath: getVersionedSourceFileByPath, - getDefaultLibLocation: host.getDefaultLibLocation && (function () { return host.getDefaultLibLocation(); }), - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, - useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, - getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return newLine; }, - fileExists: fileExists, - readFile: readFile, - trace: trace, - directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }), - getDirectories: (directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); })), - realpath: host.realpath && (function (s) { return host.realpath(s); }), - getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }), - onReleaseOldSourceFile: onReleaseOldSourceFile, - createHash: host.createHash && (function (data) { return host.createHash(data); }), - // Members for ResolutionCacheHost - toPath: toPath, - getCompilationSettings: function () { return compilerOptions; }, - watchDirectoryOfFailedLookupLocation: function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Failed Lookup Locations"); }, - watchTypeRootsDirectory: function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Type roots"); }, - getCachedDirectoryStructureHost: function () { return cachedDirectoryStructureHost; }, - onInvalidatedResolution: scheduleProgramUpdate, - onChangedAutomaticTypeDirectiveNames: function () { - hasChangedAutomaticTypeDirectiveNames = true; - scheduleProgramUpdate(); - }, - maxNumberOfFilesToIterateForInvalidation: host.maxNumberOfFilesToIterateForInvalidation, - getCurrentProgram: getCurrentProgram, - writeLog: writeLog, - readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, + var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost); + // Members for CompilerHost + var getNewSourceFile = compilerHost.getSourceFile; + compilerHost.getSourceFile = function (fileName) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args)); }; + compilerHost.getSourceFileByPath = getVersionedSourceFileByPath; + compilerHost.getNewLine = function () { return newLine; }; + compilerHost.fileExists = fileExists; + compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; + // Members for ResolutionCacheHost + compilerHost.toPath = toPath; + compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Failed Lookup Locations" /* FailedLookupLocations */); }; + compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Type roots" /* TypeRoots */); }; + compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; + compilerHost.onInvalidatedResolution = scheduleProgramUpdate; + compilerHost.onChangedAutomaticTypeDirectiveNames = function () { + hasChangedAutomaticTypeDirectiveNames = true; + scheduleProgramUpdate(); + }; + compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; + compilerHost.getCurrentProgram = getCurrentProgram; + compilerHost.writeLog = writeLog; // Cache for the module resolution var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) : @@ -90082,11 +90844,9 @@ var ts; } function createNewProgram(program, hasInvalidatedResolution) { // Compile the program - if (watchLogLevel !== ts.WatchLogLevel.None) { - writeLog("CreatingProgramWith::"); - writeLog(" roots: " + JSON.stringify(rootFileNames)); - writeLog(" options: " + JSON.stringify(compilerOptions)); - } + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; hasChangedCompilerOptions = false; hasChangedConfigFileParsingErrors = false; @@ -90149,7 +90909,7 @@ var ts; } // Create new source file if requested or the versions dont match if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { - var sourceFile = getNewSourceFile(); + var sourceFile = getNewSourceFile(fileName, languageVersion, onError); if (hostSourceFile) { if (shouldCreateNewSourceFile) { hostSourceFile.version++; @@ -90159,7 +90919,7 @@ var ts; hostSourceFile.sourceFile = sourceFile; sourceFile.version = hostSourceFile.version.toString(); if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file"); + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file" /* SourceFile */); } } else { @@ -90173,7 +90933,7 @@ var ts; else { if (sourceFile) { sourceFile.version = initialVersion.toString(); - var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file"); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file" /* SourceFile */); sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); } else { @@ -90183,21 +90943,6 @@ var ts; return sourceFile; } return hostSourceFile.sourceFile; - function getNewSourceFile() { - var text; - try { - ts.performance.mark("beforeIORead"); - text = host.readFile(fileName, compilerOptions.charset); - ts.performance.mark("afterIORead"); - ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); - } - catch (e) { - if (onError) { - onError(e.message); - } - } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; - } } function nextSourceFileVersion(path) { var hostSourceFile = sourceFilesCache.get(path); @@ -90324,7 +91069,7 @@ var ts; } } function watchMissingFilePath(missingFilePath) { - return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath, "Missing file"); + return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath, "Missing file" /* MissingFile */); } function onMissingFileChange(fileName, eventKind, missingFilePath) { updateCachedSystemWithFile(fileName, missingFilePath, eventKind); @@ -90368,28 +91113,7 @@ var ts; // Schedule Update the program scheduleProgramUpdate(); } - }, flags, "Wild card directories"); - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - host.createDirectory(directoryPath); - } - } - function writeFile(fileName, text, writeByteOrderMark, onError) { - try { - ts.performance.mark("beforeIOWrite"); - ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); - host.writeFile(fileName, text, writeByteOrderMark); - ts.performance.mark("afterIOWrite"); - ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); - } - catch (e) { - if (onError) { - onError(e.message); - } - } + }, flags, "Wild card directory" /* WildcardDirectory */); } } ts.createWatchProgram = createWatchProgram; @@ -90558,9 +91282,8 @@ var ts; }; } ts.createBuilderStatusReporter = createBuilderStatusReporter; - function createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus) { - if (system === void 0) { system = ts.sys; } - var host = ts.createCompilerHostWorker({}, /*setParentNodes*/ undefined, system); + function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) { + var host = ts.createProgramHost(system, createProgram); host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : function () { return undefined; }; host.setModifiedTime = system.setModifiedTime ? function (path, date) { return system.setModifiedTime(path, date); } : ts.noop; host.deleteFile = system.deleteFile ? function (path) { return system.deleteFile(path); } : ts.noop; @@ -90568,21 +91291,18 @@ var ts; host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system); return host; } - function createSolutionBuilderHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) { + function createSolutionBuilderHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) { if (system === void 0) { system = ts.sys; } - var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus); + var host = createSolutionBuilderHostBase(system, createProgram || ts.createAbstractBuilder, reportDiagnostic, reportSolutionBuilderStatus); host.reportErrorSummary = reportErrorSummary; return host; } ts.createSolutionBuilderHost = createSolutionBuilderHost; - function createSolutionBuilderWithWatchHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) { - var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus); + function createSolutionBuilderWithWatchHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + var host = createSolutionBuilderHostBase(system, createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportSolutionBuilderStatus); var watchHost = ts.createWatchHost(system, reportWatchStatus); - host.onWatchStatusChange = watchHost.onWatchStatusChange; - host.watchFile = watchHost.watchFile; - host.watchDirectory = watchHost.watchDirectory; - host.setTimeout = watchHost.setTimeout; - host.clearTimeout = watchHost.clearTimeout; + ts.copyProperties(host, watchHost); return host; } ts.createSolutionBuilderWithWatchHost = createSolutionBuilderWithWatchHost; @@ -90597,7 +91317,7 @@ var ts; var hostWithWatch = host; var currentDirectory = host.getCurrentDirectory(); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - var parseConfigFileHost = ts.parseConfigHostFromCompilerHost(host); + var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host); // State of the solution var options = defaultOptions; var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); @@ -90610,7 +91330,13 @@ var ts; var globalDependencyGraph; var writeFileName = function (s) { return host.trace && host.trace(s); }; var readFileWithCache = function (f) { return host.readFile(f); }; + var projectCompilerOptions = baseCompilerOptions; + var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return projectCompilerOptions; }); + var originalGetSourceFile = compilerHost.getSourceFile; + var computeHash = host.createHash || ts.generateDjb2Hash; + updateGetSourceFile(); // Watch state + var builderPrograms = createFileMap(toPath); var diagnostics = createFileMap(toPath); var projectPendingBuild = createFileMap(toPath); var projectErrorsReported = createFileMap(toPath); @@ -90618,6 +91344,7 @@ var ts; var nextProjectToBuild = 0; var timerToBuildInvalidatedProject; var reportFileChangeDetected = false; + var _a = ts.createWatchFactory(host, options), watchFile = _a.watchFile, watchFilePath = _a.watchFilePath, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog; // Watches for the solution var allWatchedWildcardDirectories = createFileMap(toPath); var allWatchedInputFiles = createFileMap(toPath); @@ -90658,6 +91385,30 @@ var ts; ts.clearMap(allWatchedWildcardDirectories, function (wildCardWatches) { return ts.clearMap(wildCardWatches, ts.closeFileWatcherOf); }); ts.clearMap(allWatchedInputFiles, function (inputFileWatches) { return ts.clearMap(inputFileWatches, ts.closeFileWatcher); }); ts.clearMap(allWatchedConfigFiles, ts.closeFileWatcher); + builderPrograms.clear(); + updateGetSourceFile(); + } + function updateGetSourceFile() { + if (options.watch) { + if (compilerHost.getSourceFile === originalGetSourceFile) { + compilerHost.getSourceFile = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args)); + if (result && options.watch) { + result.version = computeHash.call(host, result.text); + } + return result; + }; + } + } + else { + if (compilerHost.getSourceFile !== originalGetSourceFile) { + compilerHost.getSourceFile = originalGetSourceFile; + } + } } function isParsedCommandLine(entry) { return !!entry.options; @@ -90707,36 +91458,34 @@ var ts; } function watchConfigFile(resolved) { if (options.watch && !allWatchedConfigFiles.hasKey(resolved)) { - allWatchedConfigFiles.setValue(resolved, hostWithWatch.watchFile(resolved, function () { + allWatchedConfigFiles.setValue(resolved, watchFile(hostWithWatch, resolved, function () { invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.Full); - })); + }, ts.PollingInterval.High, "Config file" /* ConfigFile */, resolved)); } } function watchWildCardDirectories(resolved, parsed) { if (!options.watch) return; ts.updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(allWatchedWildcardDirectories, resolved), ts.createMapFromTemplate(parsed.configFileSpecs.wildcardDirectories), function (dir, flags) { - return hostWithWatch.watchDirectory(dir, function (fileOrDirectory) { + return watchDirectory(hostWithWatch, dir, function (fileOrDirectory) { var fileOrDirectoryPath = toPath(fileOrDirectory); if (fileOrDirectoryPath !== toPath(dir) && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, parsed.options)) { - // writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`); + writeLog("Project: " + resolved + " Detected file add/remove of non supported extension: " + fileOrDirectory); return; } if (isOutputFile(fileOrDirectory, parsed)) { - // writeLog(`${fileOrDirectory} is output file`); + writeLog(fileOrDirectory + " is output file"); return; } invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.Partial); - }, !!(flags & 1 /* Recursive */)); + }, flags, "Wild card directory" /* WildcardDirectory */, resolved); }); } function watchInputFiles(resolved, parsed) { if (!options.watch) return; ts.mutateMap(getOrCreateValueMapFromConfigFileMap(allWatchedInputFiles, resolved), ts.arrayToMap(parsed.fileNames, toPath), { - createNewValue: function (_key, input) { return hostWithWatch.watchFile(input, function () { - invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.None); - }); }, + createNewValue: function (path, input) { return watchFilePath(hostWithWatch, input, function () { return invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, path, "Source file" /* SourceFile */, resolved); }, onDeleteValue: ts.closeFileWatcher, }); } @@ -91056,18 +91805,39 @@ var ts; reportStatus(ts.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, resolved, status.upstreamProjectName); return; } + if (status.type === UpToDateStatusType.UpToDateWithUpstreamTypes) { + // Fake that files have been built by updating output file stamps + updateOutputTimestamps(proj); + return; + } var buildResult = buildSingleProject(resolved); - var dependencyGraph = getGlobalDependencyGraph(); - var referencingProjects = dependencyGraph.referencingProjectsMap.getValue(resolved); + if (buildResult & BuildResultFlags.AnyErrors) + return; + var _a = getGlobalDependencyGraph(), referencingProjectsMap = _a.referencingProjectsMap, buildQueue = _a.buildQueue; + var referencingProjects = referencingProjectsMap.getValue(resolved); if (!referencingProjects) return; // Always use build order to queue projects - for (var _i = 0, _a = dependencyGraph.buildQueue; _i < _a.length; _i++) { - var project = _a[_i]; + for (var index = buildQueue.indexOf(resolved) + 1; index < buildQueue.length; index++) { + var project = buildQueue[index]; var prepend = referencingProjects.getValue(project); - // If the project is referenced with prepend, always build downstream projectm, - // otherwise queue it only if declaration output changed - if (prepend || (prepend !== undefined && !(buildResult & BuildResultFlags.DeclarationOutputUnchanged))) { + if (prepend !== undefined) { + // If the project is referenced with prepend, always build downstream projects, + // If declaration output is changed, build the project + // otherwise mark the project UpToDateWithUpstreamTypes so it updates output time stamps + var status_1 = projectStatus.getValue(project); + if (prepend || !(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) { + if (status_1 && (status_1.type === UpToDateStatusType.UpToDate || status_1.type === UpToDateStatusType.UpToDateWithUpstreamTypes)) { + projectStatus.setValue(project, { + type: UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: status_1.oldestOutputFileName, + newerProjectName: resolved + }); + } + } + else if (status_1 && status_1.type === UpToDateStatusType.UpToDate) { + status_1.type = UpToDateStatusType.UpToDateWithUpstreamTypes; + } addProjToQueue(project); } } @@ -91138,19 +91908,12 @@ var ts; // Nothing to build - must be a solution file, basically return BuildResultFlags.None; } - var programOptions = { - projectReferences: configFile.projectReferences, - host: host, - rootNames: configFile.fileNames, - options: configFile.options, - configFileParsingDiagnostics: configFile.errors - }; - if (host.beforeCreateProgram) { - host.beforeCreateProgram(options); - } - var program = ts.createProgram(programOptions); + // TODO: handle resolve module name to cache result in project reference redirect + projectCompilerOptions = configFile.options; + var program = host.createProgram(configFile.fileNames, configFile.options, compilerHost, builderPrograms.getValue(proj), configFile.errors, configFile.projectReferences); + projectCompilerOptions = baseCompilerOptions; // Don't emit anything in the presence of syntactic errors or options diagnostics - var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); + var syntaxDiagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(), program.getGlobalDiagnostics(), program.getSyntacticDiagnostics()); if (syntaxDiagnostics.length) { return buildErrors(syntaxDiagnostics, BuildResultFlags.SyntaxErrors, "Syntactic"); } @@ -91159,6 +91922,8 @@ var ts; if (semanticDiagnostics.length) { return buildErrors(semanticDiagnostics, BuildResultFlags.TypeErrors, "Semantic"); } + // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly + program.backupState(); var newestDeclarationFileContentChangedTime = minimumDate; var anyDtsChanged = false; var declDiagnostics; @@ -91167,10 +91932,12 @@ var ts; ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }); // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { + program.restoreState(); return buildErrors(declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"); } // Actual Emit var emitterDiagnostics = ts.createDiagnosticCollection(); + var emittedOutputs = createFileMap(toPath); outputFiles.forEach(function (_a) { var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark; var priorChangeTime; @@ -91184,7 +91951,8 @@ var ts; anyDtsChanged = true; } } - ts.writeFile(host, emitterDiagnostics, name, text, writeByteOrderMark); + emittedOutputs.setValue(name, true); + ts.writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark); if (priorChangeTime !== undefined) { newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime); unchangedOutputs.setValue(name, priorChangeTime); @@ -91194,45 +91962,64 @@ var ts; if (emitDiagnostics.length) { return buildErrors(emitDiagnostics, BuildResultFlags.EmitErrors, "Emit"); } + // Update time stamps for rest of the outputs + newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(configFile, newestDeclarationFileContentChangedTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); var status = { type: UpToDateStatusType.UpToDate, - newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime + newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime, + oldestOutputFileName: outputFiles.length ? outputFiles[0].name : getFirstProjectOutput(configFile) }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); - if (host.afterProgramEmitAndDiagnostics) { - host.afterProgramEmitAndDiagnostics(program); - } + afterProgramCreate(proj, program); return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); - if (host.afterProgramEmitAndDiagnostics) { - host.afterProgramEmitAndDiagnostics(program); - } + afterProgramCreate(proj, program); return resultFlags; } } + function afterProgramCreate(proj, program) { + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } + if (options.watch) { + program.releaseProgram(); + builderPrograms.setValue(proj, program); + } + } function updateOutputTimestamps(proj) { if (options.dry) { return reportStatus(ts.Diagnostics.A_non_dry_build_would_build_project_0, proj.options.configFilePath); } - if (options.verbose) { - reportStatus(ts.Diagnostics.Updating_output_timestamps_of_project_0, proj.options.configFilePath); - } - var now = new Date(); - var outputs = getAllProjectOutputs(proj); - var priorNewestUpdateTime = minimumDate; - for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) { - var file = outputs_2[_i]; - if (isDeclarationFile(file)) { - priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime); - } - host.setModifiedTime(file, now); - } + var priorNewestUpdateTime = updateOutputTimestampsWorker(proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0); projectStatus.setValue(proj.options.configFilePath, { type: UpToDateStatusType.UpToDate, newestDeclarationFileContentChangedTime: priorNewestUpdateTime }); } + function updateOutputTimestampsWorker(proj, priorNewestUpdateTime, verboseMessage, skipOutputs) { + var outputs = getAllProjectOutputs(proj); + if (!skipOutputs || outputs.length !== skipOutputs.getSize()) { + if (options.verbose) { + reportStatus(verboseMessage, proj.options.configFilePath); + } + var now = host.now ? host.now() : new Date(); + for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) { + var file = outputs_2[_i]; + if (skipOutputs && skipOutputs.hasKey(file)) { + continue; + } + if (isDeclarationFile(file)) { + priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime); + } + host.setModifiedTime(file, now); + if (proj.options.listEmittedFiles) { + writeFileName("TSFILE: " + file); + } + } + } + return priorNewestUpdateTime; + } function getFilesToClean() { // Get the same graph for cleaning we'd use for building var graph = getGlobalDependencyGraph(); @@ -91279,9 +92066,17 @@ var ts; } // TODO:: In watch mode as well to use caches for incremental build once we can invalidate caches correctly and have right api // Override readFile for json files and output .d.ts to cache the text - var _a = ts.changeCompilerHostToUseCache(host, toPath, /*useCacheForSourceFile*/ true), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, originalGetSourceFile = _a.originalGetSourceFile, newReadFileWithCache = _a.readFileWithCache; var savedReadFileWithCache = readFileWithCache; + var savedGetSourceFile = compilerHost.getSourceFile; + var _a = ts.changeCompilerHostLikeToUseCache(host, toPath, function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return savedGetSourceFile.call.apply(savedGetSourceFile, [compilerHost].concat(args)); + }), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, newReadFileWithCache = _a.readFileWithCache; readFileWithCache = newReadFileWithCache; + compilerHost.getSourceFile = getSourceFileWithCache; var graph = getGlobalDependencyGraph(); reportBuildQueue(graph); var anyFailed = false; @@ -91333,8 +92128,8 @@ var ts; host.directoryExists = originalDirectoryExists; host.createDirectory = originalCreateDirectory; host.writeFile = originalWriteFile; + compilerHost.getSourceFile = savedGetSourceFile; readFileWithCache = savedReadFileWithCache; - host.getSourceFile = originalGetSourceFile; return anyFailed ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success; } function reportParseConfigFileDiagnostic(proj) { @@ -91357,7 +92152,7 @@ var ts; } } function relName(path) { - return ts.convertToRelativePath(path, host.getCurrentDirectory(), function (f) { return host.getCanonicalFileName(f); }); + return ts.convertToRelativePath(path, host.getCurrentDirectory(), function (f) { return compilerHost.getCanonicalFileName(f); }); } /** * Report the up-to-date status of a project if we're in verbose mode @@ -91390,6 +92185,19 @@ var ts; } } ts.getAllProjectOutputs = getAllProjectOutputs; + function getFirstProjectOutput(project) { + if (project.options.outFile || project.options.out) { + return ts.first(getOutFileOutputs(project)); + } + for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) { + var inputFile = _a[_i]; + var outputs = getOutputFileNames(inputFile, project); + if (outputs.length) { + return ts.first(outputs); + } + } + return ts.Debug.fail("project " + project.options.configFilePath + " expected to have at least one output"); + } function formatUpToDateStatus(configFileName, status, relName, formatMessage) { switch (status.type) { case UpToDateStatusType.OutOfDateWithSelf: @@ -91442,17 +92250,17 @@ var ts; } ts.inspectValue = inspectValue; function getRecurser() { - var seen = new Set(); + var seen = []; var nameStack = []; return function (obj, name, cbOk, cbFail) { - if (seen.has(obj) || nameStack.length > 4) { - return cbFail(seen.has(obj), nameStack); + if (seen.indexOf(obj) !== -1 || nameStack.length > 4) { + return cbFail(seen.indexOf(obj) !== -1, nameStack); } - seen.add(obj); + seen.push(obj); nameStack.push(name); var res = cbOk(); nameStack.pop(); - seen.delete(obj); + seen.pop(); return res; }; } @@ -91510,8 +92318,8 @@ var ts; return key === "constructor" ? undefined : getValueInfo(key, value, recurser); }); } - var ignoredProperties = new Set(["arguments", "caller", "constructor", "eval", "super_"]); - var reservedFunctionProperties = new Set(Object.getOwnPropertyNames(ts.noop)); + var ignoredProperties = ["arguments", "caller", "constructor", "eval", "super_"]; + var reservedFunctionProperties = Object.getOwnPropertyNames(ts.noop); function getEntriesOfObject(obj) { var seen = ts.createMap(); var entries = []; @@ -91520,8 +92328,8 @@ var ts; for (var _i = 0, _a = Object.getOwnPropertyNames(chain); _i < _a.length; _i++) { var key = _a[_i]; if (!isJsPrivate(key) && - !ignoredProperties.has(key) && - (typeof obj !== "function" || !reservedFunctionProperties.has(key)) && + ignoredProperties.indexOf(key) === -1 && + (typeof obj !== "function" || reservedFunctionProperties.indexOf(key) === -1) && // Don't add property from a higher prototype if it already exists in a lower one ts.addToSeen(seen, key)) { var value = safeGetPropertyOfObject(chain, key); @@ -91549,7 +92357,7 @@ var ts; return { kind: 0 /* Const */, name: name, typeName: "any", comment: comment }; } function isJsPrivate(name) { - return name.startsWith("_"); + return ts.startsWith(name, "_"); } ts.isJsPrivate = isJsPrivate; function tryRequire(fileNameToRequire) { @@ -91812,8 +92620,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_6 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_6.config; + var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_7.config; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. @@ -93388,7 +94196,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -93959,15 +94767,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -95245,7 +96056,7 @@ var ts; continue; var patterns = paths[path]; if (patterns) { - var _loop_10 = function (name, kind, extension) { + var _loop_11 = function (name, kind, extension) { // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. if (!result.some(function (entry) { return entry.name === name; })) { result.push(nameAndKind(name, kind, extension)); @@ -95253,7 +96064,7 @@ var ts; }; for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseDirectory, fileExtensions, host); _i < _a.length; _i++) { var _b = _a[_i], name = _b.name, kind = _b.kind, extension = _b.extension; - _loop_10(name, kind, extension); + _loop_11(name, kind, extension); } } } @@ -95288,7 +96099,7 @@ var ts; // (But do if we didn't find anything, e.g. 'package.json' missing.) var foundGlobal = false; if (fragmentDirectory === undefined) { - var _loop_11 = function (moduleName) { + var _loop_12 = function (moduleName) { if (!result.some(function (entry) { return entry.name === moduleName; })) { foundGlobal = true; result.push(nameAndKind(moduleName, "external module name" /* externalModuleName */, /*extension*/ undefined)); @@ -95296,7 +96107,7 @@ var ts; }; for (var _b = 0, _c = enumerateNodeModulesVisibleToScript(host, scriptPath); _b < _c.length; _b++) { var moduleName = _c[_b]; - _loop_11(moduleName); + _loop_12(moduleName); } } if (!foundGlobal) { @@ -95650,7 +96461,7 @@ var ts; getJSCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); // TODO: GH#18217 } else { - if ((!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { + if (!isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); @@ -95850,7 +96661,8 @@ var ts; }) || { type: "none" }; } function getSymbolName(symbol, origin, target) { - return origin && originIsExport(origin) && origin.isDefaultExport && symbol.escapedName === "default" /* Default */ + return origin && originIsExport(origin) && ((origin.isDefaultExport && symbol.escapedName === "default" /* Default */) || + (symbol.escapedName === "export=" /* ExportEquals */)) // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. ? ts.firstDefined(symbol.declarations, function (d) { return ts.isExportAssignment(d) && ts.isIdentifier(d.expression) ? d.expression.text : undefined; }) || ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) @@ -98511,9 +99323,9 @@ var ts; // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). if (node.parent.kind === 276 /* ShorthandPropertyAssignment */) { - var result_7 = []; - FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_7.push(nodeEntry(node)); }); - return result_7; + var result_8 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_8.push(nodeEntry(node)); }); + return result_8; } else if (node.kind === 98 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { // References to and accesses on the super keyword only have one possible implementation, so no @@ -98545,8 +99357,8 @@ var ts; case 0 /* Symbol */: { var symbol = def.symbol; var _a = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case 1 /* Label */: { var node_3 = def.node; @@ -98554,8 +99366,8 @@ var ts; } case 2 /* Keyword */: { var node_4 = def.node; - var name_4 = ts.tokenToString(node_4.kind); - return { node: node_4, name: name_4, kind: "keyword" /* keyword */, displayParts: [{ text: name_4, kind: "keyword" /* keyword */ }] }; + var name_5 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case 3 /* This */: { var node_5 = def.node; @@ -98581,8 +99393,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode, checker) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); + function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText) { + return __assign({}, entryToDocumentSpan(entry), (providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker))); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98693,6 +99505,11 @@ var ts; } return ts.createTextSpanFromBounds(start, end); } + function getTextSpanOfEntry(entry) { + return entry.kind === 0 /* Span */ ? entry.textSpan : + getTextSpan(entry.node, entry.node.getSourceFile()); + } + FindAllReferences.getTextSpanOfEntry = getTextSpanOfEntry; /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccessForReference(node) { var decl = ts.getDeclarationFromName(node); @@ -98786,24 +99603,100 @@ var ts; if (symbol.escapedName === "export=" /* ExportEquals */) { return getReferencedSymbolsForModule(program, symbol.parent, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet); } - var moduleReferences = ts.emptyArray; - var moduleSourceFile = isModuleSymbol(symbol); - var referencedNode = node; - if (moduleSourceFile) { - var exportEquals = symbol.exports.get("export=" /* ExportEquals */); - // If !!exportEquals, we're about to add references to `import("mod")` anyway, so don't double-count them. - moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); - if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) - return moduleReferences; - // Continue to get references to 'export ='. - symbol = ts.skipAlias(exportEquals, checker); - referencedNode = undefined; + var moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + if (moduleReferences && !(symbol.flags & 33554432 /* Transient */)) { + return moduleReferences; } - return ts.concatenate(moduleReferences, getReferencedSymbolsForSymbol(symbol, referencedNode, sourceFiles, sourceFilesSet, checker, cancellationToken, options)); + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker); + var moduleReferencesOfExportTarget = aliasedSymbol && + getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + var references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options); + return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget); } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function isModuleSymbol(symbol) { - return symbol.flags & 1536 /* Module */ ? ts.find(symbol.declarations, ts.isSourceFile) : undefined; + function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) { + if (node.parent && ts.isNamespaceExportDeclaration(node.parent)) { + var aliasedSymbol = checker.getAliasedSymbol(symbol); + var targetSymbol = checker.getMergedSymbol(aliasedSymbol); + if (aliasedSymbol !== targetSymbol) { + return targetSymbol; + } + } + return undefined; + } + function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + var moduleSourceFile = symbol.flags & 1536 /* Module */ ? ts.find(symbol.declarations, ts.isSourceFile) : undefined; + if (!moduleSourceFile) + return undefined; + var exportEquals = symbol.exports.get("export=" /* ExportEquals */); + // If !!exportEquals, we're about to add references to `import("mod")` anyway, so don't double-count them. + var moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); + if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) + return moduleReferences; + // Continue to get references to 'export ='. + var checker = program.getTypeChecker(); + symbol = ts.skipAlias(exportEquals, checker); + return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol(symbol, /*node*/ undefined, sourceFiles, sourceFilesSet, checker, cancellationToken, options)); + } + /** + * Merges the references by sorting them (by file index in sourceFiles and their location in it) that point to same definition symbol + */ + function mergeReferences(program) { + var referencesToMerge = []; + for (var _i = 1; _i < arguments.length; _i++) { + referencesToMerge[_i - 1] = arguments[_i]; + } + var result; + for (var _a = 0, referencesToMerge_1 = referencesToMerge; _a < referencesToMerge_1.length; _a++) { + var references = referencesToMerge_1[_a]; + if (!references || !references.length) + continue; + if (!result) { + result = references; + continue; + } + var _loop_13 = function (entry) { + if (!entry.definition || entry.definition.type !== 0 /* Symbol */) { + result.push(entry); + return "continue"; + } + var symbol = entry.definition.symbol; + var refIndex = ts.findIndex(result, function (ref) { return !!ref.definition && + ref.definition.type === 0 /* Symbol */ && + ref.definition.symbol === symbol; }); + if (refIndex === -1) { + result.push(entry); + return "continue"; + } + var reference = result[refIndex]; + result[refIndex] = { + definition: reference.definition, + references: reference.references.concat(entry.references).sort(function (entry1, entry2) { + var entry1File = getSourceFileIndexOfEntry(program, entry1); + var entry2File = getSourceFileIndexOfEntry(program, entry2); + if (entry1File !== entry2File) { + return ts.compareValues(entry1File, entry2File); + } + var entry1Span = FindAllReferences.getTextSpanOfEntry(entry1); + var entry2Span = FindAllReferences.getTextSpanOfEntry(entry2); + return entry1Span.start !== entry2Span.start ? + ts.compareValues(entry1Span.start, entry2Span.start) : + ts.compareValues(entry1Span.length, entry2Span.length); + }) + }; + }; + for (var _b = 0, references_1 = references; _b < references_1.length; _b++) { + var entry = references_1[_b]; + _loop_13(entry); + } + } + return result; + } + function getSourceFileIndexOfEntry(program, entry) { + var sourceFile = entry.kind === 0 /* Span */ ? + program.getSourceFile(entry.fileName) : + entry.node.getSourceFile(); + return program.getSourceFiles().indexOf(sourceFile); } function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) { ts.Debug.assert(!!symbol.valueDeclaration); @@ -98840,7 +99733,7 @@ var ts; break; default: // This may be merged with something. - ts.Debug.fail("Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); + ts.Debug.assert(!!(symbol.flags & 33554432 /* Transient */), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); } } var exported = symbol.exports.get("export=" /* ExportEquals */); @@ -98887,12 +99780,12 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options)) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + var exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); if (exportSpecifier) { // When renaming at an export specifier, rename the export and not the thing being exported. getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); @@ -98902,7 +99795,7 @@ var ts; searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { - var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.isForRename, !!options.implementations) : [symbol] }); + var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.isForRename, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] }); // Try to get the smallest valid scope that we can limit our search to; // otherwise we'll need to search globally (i.e. include each file). var scope = getSymbolScope(symbol); @@ -98935,14 +99828,17 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { var parent = node.parent; - if (ts.isExportSpecifier(parent) && !isForRename) { + if (ts.isExportSpecifier(parent) && useLocalSymbolForExportSpecifier) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { + // Ignore UMD module and global merge + if (symbol.flags & 33554432 /* Transient */) + return undefined; // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); } @@ -98957,6 +99853,12 @@ var ts; SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; })(SpecialSearchKind || (SpecialSearchKind = {})); + function getNonModuleSymbolOfMergedModuleSymbol(symbol) { + if (!(symbol.flags & (1536 /* Module */ | 33554432 /* Transient */))) + return undefined; + var decl = symbol.declarations && ts.find(symbol.declarations, function (d) { return !ts.isSourceFile(d) && !ts.isModuleDeclaration(d); }); + return decl && decl.symbol; + } /** * Holds all state needed for the finding references. * Unlike `Search`, there is only one `State`. @@ -99015,7 +99917,7 @@ var ts; // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form // here appears to be intentional). - var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b; + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : undefined; return { symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, allSearchSymbols: allSearchSymbols, includes: function (sym) { return ts.contains(allSearchSymbols, sym); } }; @@ -99399,6 +100301,7 @@ var ts; getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { + ts.Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled"); var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); @@ -99427,14 +100330,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!state.options.isForRename || alwaysGetReferences) { + if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99466,7 +100369,7 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename) { + if (!(isForRenameWithPrefixAndSuffixText(state.options))) { searchForImportedSymbol(symbol, state); } } @@ -99728,6 +100631,9 @@ var ts; }); return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } + function isParameterName(node) { + return node.kind === 72 /* Identifier */ && node.parent.kind === 151 /* Parameter */ && node.parent.name === node; + } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. @@ -99748,7 +100654,7 @@ var ts; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; case 279 /* SourceFile */: - if (ts.isExternalModule(searchSpaceNode)) { + if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through @@ -99780,7 +100686,7 @@ var ts; // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; case 279 /* SourceFile */: - return container.kind === 279 /* SourceFile */ && !ts.isExternalModule(container); + return container.kind === 279 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return FindAllReferences.nodeEntry(n); }); @@ -99804,13 +100710,13 @@ var ts; } // For certain symbol kinds, we need to include other symbols in the search set. // This is not needed when searching for re-exports. - function populateSearchSymbolSet(symbol, location, checker, isForRename, implementations) { + function populateSearchSymbolSet(symbol, location, checker, isForRename, providePrefixAndSuffixText, implementations) { var result = []; - forEachRelatedSymbol(symbol, location, checker, isForRename, function (sym, root, base) { result.push(base || root || sym); }, + forEachRelatedSymbol(symbol, location, checker, isForRename, !(isForRename && providePrefixAndSuffixText), function (sym, root, base) { result.push(base || root || sym); }, /*allowBaseTypes*/ function () { return !implementations; }); return result; } - function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, cbSymbol, allowBaseTypes) { + function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, cbSymbol, allowBaseTypes) { var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { /* Because in short-hand property assignment, location has two meaning : property name and as value of the property @@ -99847,6 +100753,13 @@ var ts; if (res2) return res2; } + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location, symbol, checker); + if (aliasedSymbol) { + // In case of UMD module and global merging, search for global as well + var res_2 = cbSymbol(aliasedSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 1 /* Node */); + if (res_2) + return res_2; + } var res = fromRoot(symbol); if (res) return res; @@ -99857,9 +100770,23 @@ var ts; return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } // symbolAtLocation for a binding element is the local symbol. See if the search symbol is the property. - // Don't do this when populating search set for a rename -- just rename the local. + // Don't do this when populating search set for a rename when prefix and suffix text will be provided -- just rename the local. if (!isForRenamePopulateSearchSymbolSet) { - var bindingElementPropertySymbol = ts.isObjectBindingElementWithoutPropertyName(location.parent) ? ts.getPropertySymbolFromBindingElement(checker, location.parent) : undefined; + var bindingElementPropertySymbol = void 0; + if (onlyIncludeBindingElementAtReferenceLocation) { + bindingElementPropertySymbol = ts.isObjectBindingElementWithoutPropertyName(location.parent) ? ts.getPropertySymbolFromBindingElement(checker, location.parent) : undefined; + } + else { + bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + } + return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); + } + ts.Debug.assert(isForRenamePopulateSearchSymbolSet); + // due to the above assert and the arguments at the uses of this function, + // (onlyIncludeBindingElementAtReferenceLocation <=> !providePrefixAndSuffixTextForRename) holds + var includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation; + if (includeOriginalSymbolOfBindingElement) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); } function fromRoot(sym, kind) { @@ -99877,10 +100804,17 @@ var ts; : undefined); }); } + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { + var bindingElement = ts.getDeclarationOfKind(symbol, 186 /* BindingElement */); + if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { + return ts.getPropertySymbolFromBindingElement(checker, bindingElement); + } + } } function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { var checker = state.checker; - return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, function (sym, rootSymbol, baseSymbol, kind) { return search.includes(baseSymbol || rootSymbol || sym) + return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, + /*onlyIncludeBindingElementAtReferenceLocation*/ !state.options.isForRename || !!state.options.providePrefixAndSuffixTextForRename, function (sym, rootSymbol, baseSymbol, kind) { return search.includes(baseSymbol || rootSymbol || sym) // For a base type, use the symbol for the derived type. For a synthetic (e.g. union) property, use the union symbol. ? { symbol: rootSymbol && !(ts.getCheckFlags(sym) & 6 /* Synthetic */) ? rootSymbol : sym, kind: kind } : undefined; }, @@ -99922,7 +100856,8 @@ var ts; Core.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; function isImplementation(node) { return !!(node.flags & 4194304 /* Ambient */) - || (ts.isVariableLike(node) ? ts.hasInitializer(node) + ? !(ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) + : (ts.isVariableLike(node) ? ts.hasInitializer(node) : ts.isFunctionLikeDeclaration(node) ? !!node.body : ts.isClassLike(node) || ts.isModuleOrEnumDeclaration(node)); } @@ -99965,6 +100900,9 @@ var ts; }); return res.length === 0 ? undefined : res; } + function isForRenameWithPrefixAndSuffixText(options) { + return options.isForRename && options.providePrefixAndSuffixTextForRename; + } })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -100077,7 +101015,7 @@ var ts; } function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) { var allFiles = program.getSourceFiles(); - var _loop_12 = function (sourceFile) { + var _loop_14 = function (sourceFile) { var newFromOld = oldToNew(sourceFile.path); var newImportFromPath = newFromOld !== undefined ? newFromOld : sourceFile.path; var newImportFromDirectory = ts.getDirectoryPath(newImportFromPath); @@ -100099,7 +101037,7 @@ var ts; var toImport = oldFromNew !== undefined // If we're at the new location (file was already renamed), need to redo module resolution starting from the old location. // TODO:GH#18217 - ? getSourceFileToImportFromResolved(ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, host) + ? getSourceFileToImportFromResolved(ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew); // Need an update if the imported file moved, or the importing file moved and was using a relative path. return toImport !== undefined && (toImport.updated || (importingSourceFileMoved && ts.pathIsRelative(importLiteral.text))) @@ -100109,7 +101047,7 @@ var ts; }; for (var _i = 0, allFiles_1 = allFiles; _i < allFiles_1.length; _i++) { var sourceFile = allFiles_1[_i]; - _loop_12(sourceFile); + _loop_14(sourceFile); } } function combineNormal(pathA, pathB) { @@ -100129,23 +101067,32 @@ var ts; var resolved = host.resolveModuleNames ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName) : program.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName); - return getSourceFileToImportFromResolved(resolved, oldToNew, host); + return getSourceFileToImportFromResolved(resolved, oldToNew); } } - function getSourceFileToImportFromResolved(resolved, oldToNew, host) { + function getSourceFileToImportFromResolved(resolved, oldToNew) { // Search through all locations looking for a moved file, and only then test already existing files. // This is because if `a.ts` is compiled to `a.js` and `a.ts` is moved, we don't want to resolve anything to `a.js`, but to `a.ts`'s new location. - return tryEach(tryGetNewFile) || tryEach(tryGetOldFile); - function tryEach(cb) { - return resolved && ((resolved.resolvedModule && cb(resolved.resolvedModule.resolvedFileName)) || ts.firstDefined(resolved.failedLookupLocations, cb)); + if (!resolved) + return undefined; + // First try resolved module + if (resolved.resolvedModule) { + var result_9 = tryChange(resolved.resolvedModule.resolvedFileName); + if (result_9) + return result_9; } - function tryGetNewFile(oldFileName) { - var newFileName = oldToNew(oldFileName); - return newFileName !== undefined && host.fileExists(newFileName) ? { newFileName: newFileName, updated: true } : undefined; // TODO: GH#18217 + // Then failed lookups except package.json since we dont want to touch them (only included ts/js files) + var result = ts.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson); + if (result) + return result; + // If nothing changed, then result is resolved module file thats not updated + return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false }; + function tryChangeWithIgnoringPackageJson(oldFileName) { + return !ts.endsWith(oldFileName, "/package.json") ? tryChange(oldFileName) : undefined; } - function tryGetOldFile(oldFileName) { + function tryChange(oldFileName) { var newFileName = oldToNew(oldFileName); - return host.fileExists(oldFileName) ? newFileName !== undefined ? { newFileName: newFileName, updated: true } : { newFileName: oldFileName, updated: false } : undefined; // TODO: GH#18217 + return newFileName && { newFileName: newFileName, updated: true }; } } function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) { @@ -100242,10 +101189,10 @@ var ts; // bar(({pr/*goto*/op1})=>{}); if (ts.isPropertyName(node) && ts.isBindingElement(parent) && ts.isObjectBindingPattern(parent.parent) && (node === (parent.propertyName || parent.name))) { - var name_5 = ts.getNameFromPropertyName(node); + var name_6 = ts.getNameFromPropertyName(node); var type = typeChecker.getTypeAtLocation(parent.parent); - return name_5 === undefined ? ts.emptyArray : ts.flatMap(type.isUnion() ? type.types : [type], function (t) { - var prop = t.getProperty(name_5); + return name_6 === undefined ? ts.emptyArray : ts.flatMap(type.isUnion() ? type.types : [type], function (t) { + var prop = t.getProperty(name_6); return prop && getDefinitionFromSymbol(typeChecker, prop, node); }); } @@ -100890,7 +101837,7 @@ var ts; if (!patternMatcher) return ts.emptyArray; var rawItems = []; - var _loop_13 = function (sourceFile) { + var _loop_15 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && sourceFile.isDeclarationFile) { return "continue"; @@ -100902,7 +101849,7 @@ var ts; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { var sourceFile = sourceFiles_6[_i]; - _loop_13(sourceFile); + _loop_15(sourceFile); } rawItems.sort(compareNavigateToItems); return (maxResultCount === undefined ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); @@ -101594,7 +102541,7 @@ var ts; else if (ts.isCallExpression(parent)) { var name = getCalledExpressionName(parent.expression); if (name !== undefined) { - var args = ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteral(a) ? a.getText(curSourceFile) : undefined; }).join(", "); + var args = ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "); return name + "(" + args + ") callback"; } } @@ -101647,10 +102594,12 @@ var ts; organizeImportsWorker(topLevelExportDecls, coalesceExports); for (var _i = 0, _a = sourceFile.statements.filter(ts.isAmbientModule); _i < _a.length; _i++) { var ambientModule = _a[_i]; - var ambientModuleBody = getModuleBlock(ambientModule); // TODO: GH#18217 - var ambientModuleImportDecls = ambientModuleBody.statements.filter(ts.isImportDeclaration); + if (!ambientModule.body) { + continue; + } + var ambientModuleImportDecls = ambientModule.body.statements.filter(ts.isImportDeclaration); organizeImportsWorker(ambientModuleImportDecls, coalesceAndOrganizeImports); - var ambientModuleExportDecls = ambientModuleBody.statements.filter(ts.isExportDeclaration); + var ambientModuleExportDecls = ambientModule.body.statements.filter(ts.isExportDeclaration); organizeImportsWorker(ambientModuleExportDecls, coalesceExports); } return changeTracker.getChanges(); @@ -101690,13 +102639,9 @@ var ts; } } OrganizeImports.organizeImports = organizeImports; - function getModuleBlock(moduleDecl) { - var body = moduleDecl.body; - return body && !ts.isIdentifier(body) ? (ts.isModuleBlock(body) ? body : getModuleBlock(body)) : undefined; - } function removeUnusedImports(oldImports, sourceFile, program) { var typeChecker = program.getTypeChecker(); - var jsxNamespace = typeChecker.getJsxNamespace(); + var jsxNamespace = typeChecker.getJsxNamespace(sourceFile); var jsxElementsPresent = !!(sourceFile.transformFlags & 4 /* ContainsJsx */); var usedImports = []; for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) { @@ -101956,6 +102901,9 @@ var ts; if (ts.isDeclaration(n)) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } var span = getOutliningSpanForNode(n, sourceFile); if (span) out.push(span); @@ -101973,6 +102921,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -102088,6 +103043,7 @@ var ts; case 245 /* ModuleBlock */: return spanForNode(n.parent); case 240 /* ClassDeclaration */: + case 209 /* ClassExpression */: case 241 /* InterfaceDeclaration */: case 243 /* EnumDeclaration */: case 246 /* CaseBlock */: @@ -102116,10 +103072,10 @@ var ts; } function spanForObjectOrArrayLiteral(node, open) { if (open === void 0) { open = 18 /* OpenBraceToken */; } - // If the block has no leading keywords and is inside an array literal, + // If the block has no leading keywords and is inside an array literal or call expression, // we only want to collapse the span of the block. // Otherwise, the collapsed section will include the end of the previous line. - return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent), open); + return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent) && !ts.isCallExpression(node.parent), open); } function spanForNode(hintSpanNode, autoCollapse, useFullStart, open) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -102421,15 +103377,15 @@ var ts; // Assumes 'value' is already lowercase. function indexOfIgnoringCase(str, value) { var n = str.length - value.length; - var _loop_14 = function (start) { + var _loop_16 = function (start) { if (every(value, function (valueChar, i) { return toLowerCase(str.charCodeAt(i + start)) === valueChar; })) { return { value: start }; } }; for (var start = 0; start <= n; start++) { - var state_3 = _loop_14(start); - if (typeof state_3 === "object") - return state_3.value; + var state_4 = _loop_16(start); + if (typeof state_4 === "object") + return state_4.value; } return -1; } @@ -102943,15 +103899,15 @@ var ts; (function (ts) { var Rename; (function (Rename) { - function getRenameInfo(program, sourceFile, position) { + function getRenameInfo(program, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position); var renameInfo = node && nodeIsEligibleForRename(node) - ? getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, function (declaration) { return program.isSourceFileDefaultLibrary(declaration.getSourceFile()); }) + ? getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, function (declaration) { return program.isSourceFileDefaultLibrary(declaration.getSourceFile()); }, options) : undefined; return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); } Rename.getRenameInfo = getRenameInfo; - function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) return; @@ -102968,7 +103924,7 @@ var ts; return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { - return getRenameInfoForModule(node, sourceFile, symbol); + return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 149 /* ComputedPropertyName */) @@ -102985,7 +103941,7 @@ var ts; var moduleSourceFile = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (!moduleSourceFile) return undefined; - var withoutIndex = node.text.endsWith("/index") || node.text.endsWith("/index.js") ? undefined : ts.tryRemoveSuffix(ts.removeFileExtension(moduleSourceFile.fileName), "/index"); + var withoutIndex = ts.endsWith(node.text, "/index") || ts.endsWith(node.text, "/index.js") ? undefined : ts.tryRemoveSuffix(ts.removeFileExtension(moduleSourceFile.fileName), "/index"); var name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; var kind = withoutIndex === undefined ? "module" /* moduleElement */ : "directory" /* directory */; var indexAfterLastSlash = node.text.lastIndexOf("/") + 1; @@ -103440,7 +104396,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) { - var _loop_15 = function (n) { + var _loop_17 = function (n) { // If the node is not a subspan of its parent, this is a big problem. // There have been crashes that might be caused by this violation. ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.showSyntaxKind(n) + ", parent: " + ts.Debug.showSyntaxKind(n.parent); }); @@ -103449,10 +104405,10 @@ var ts; return { value: argumentInfo }; } }; - for (var n = node; isManuallyInvoked || (!ts.isBlock(n) && !ts.isSourceFile(n)); n = n.parent) { - var state_4 = _loop_15(n); - if (typeof state_4 === "object") - return state_4.value; + for (var n = node; !ts.isSourceFile(n) && (isManuallyInvoked || !ts.isBlock(n)); n = n.parent) { + var state_5 = _loop_17(n); + if (typeof state_5 === "object") + return state_5.value; } return undefined; } @@ -103565,86 +104521,47 @@ var ts; var ts; (function (ts) { var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/; - function getSourceMapper(useCaseSensitiveFileNames, currentDirectory, log, host, getProgram) { - var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - var sourcemappedFileCache; + function getSourceMapper(host) { + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var currentDirectory = host.getCurrentDirectory(); + var sourceFileLike = ts.createMap(); + var documentPositionMappers = ts.createMap(); return { tryGetSourcePosition: tryGetSourcePosition, tryGetGeneratedPosition: tryGetGeneratedPosition, toLineColumnOffset: toLineColumnOffset, clearCache: clearCache }; function toPath(fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } - function scanForSourcemapURL(fileName) { - var mappedFile = sourcemappedFileCache.get(toPath(fileName)); - if (!mappedFile) { - return; + function getDocumentPositionMapper(generatedFileName, sourceFileName) { + var path = toPath(generatedFileName); + var value = documentPositionMappers.get(path); + if (value) + return value; + var mapper; + if (host.getDocumentPositionMapper) { + mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); } - return ts.tryGetSourceMappingURL(mappedFile.text, ts.getLineStarts(mappedFile)); - } - function convertDocumentToSourceMapper(file, contents, mapFileName) { - var map = ts.tryParseRawSourceMap(contents); - if (!map || !map.sources || !map.file || !map.mappings) { - // obviously invalid map - return file.sourceMapper = ts.identitySourceMapConsumer; + else if (host.readFile) { + var file = getSourceFileLike(generatedFileName); + mapper = file && ts.getDocumentPositionMapper({ getSourceFileLike: getSourceFileLike, getCanonicalFileName: getCanonicalFileName, log: function (s) { return host.log(s); } }, generatedFileName, ts.getLineInfo(file.text, ts.getLineStarts(file)), function (f) { return !host.fileExists || host.fileExists(f) ? host.readFile(f) : undefined; }); } - var program = getProgram(); - return file.sourceMapper = ts.createDocumentPositionMapper({ - getSourceFileLike: function (s) { - // Lookup file in program, if provided - var file = program && program.getSourceFileByPath(s); - // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file - if (file === undefined || file.resolvedPath !== s) { - // Otherwise check the cache (which may hit disk) - return sourcemappedFileCache.get(s); - } - return file; - }, - getCanonicalFileName: getCanonicalFileName, - log: log, - }, map, mapFileName); - } - function getSourceMapper(fileName, file) { - if (!host.readFile || !host.fileExists) { - return file.sourceMapper = ts.identitySourceMapConsumer; - } - if (file.sourceMapper) { - return file.sourceMapper; - } - var mapFileName = scanForSourcemapURL(fileName); - if (mapFileName) { - var match = base64UrlRegExp.exec(mapFileName); - if (match) { - if (match[1]) { - var base64Object = match[1]; - return convertDocumentToSourceMapper(file, ts.base64decode(ts.sys, base64Object), fileName); - } - // Not a data URL we can parse, skip it - mapFileName = undefined; - } - } - var possibleMapLocations = []; - if (mapFileName) { - possibleMapLocations.push(mapFileName); - } - possibleMapLocations.push(fileName + ".map"); - for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) { - var location = possibleMapLocations_1[_i]; - var mapPath = ts.toPath(location, ts.getDirectoryPath(fileName), getCanonicalFileName); - if (host.fileExists(mapPath)) { - return convertDocumentToSourceMapper(file, host.readFile(mapPath), mapPath); // TODO: GH#18217 - } - } - return file.sourceMapper = ts.identitySourceMapConsumer; + documentPositionMappers.set(path, mapper || ts.identitySourceMapConsumer); + return mapper || ts.identitySourceMapConsumer; } function tryGetSourcePosition(info) { if (!ts.isDeclarationFileName(info.fileName)) return undefined; - var file = getFile(info.fileName); + var file = getSourceFile(info.fileName); if (!file) return undefined; - var newLoc = getSourceMapper(info.fileName, file).getSourcePosition(info); - return newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; + var newLoc = getDocumentPositionMapper(info.fileName).getSourcePosition(info); + return !newLoc || newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; } function tryGetGeneratedPosition(info) { - var program = getProgram(); + if (ts.isDeclarationFileName(info.fileName)) + return undefined; + var sourceFile = getSourceFile(info.fileName); + if (!sourceFile) + return undefined; + var program = host.getProgram(); var options = program.getCompilerOptions(); var outPath = options.outFile || options.out; var declarationPath = outPath ? @@ -103652,49 +104569,96 @@ var ts; ts.getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - var declarationFile = getFile(declarationPath); - if (!declarationFile) - return undefined; - var newLoc = getSourceMapper(declarationPath, declarationFile).getGeneratedPosition(info); + var newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info); return newLoc === info ? undefined : newLoc; } - function getFile(fileName) { + function getSourceFile(fileName) { + var program = host.getProgram(); + if (!program) + return undefined; var path = toPath(fileName); - var file = getProgram().getSourceFileByPath(path); - if (file && file.resolvedPath === path) { - return file; + // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file + var file = program.getSourceFileByPath(path); + return file && file.resolvedPath === path ? file : undefined; + } + function getOrCreateSourceFileLike(fileName) { + var path = toPath(fileName); + var fileFromCache = sourceFileLike.get(path); + if (fileFromCache !== undefined) + return fileFromCache ? fileFromCache : undefined; + if (!host.readFile || host.fileExists && !host.fileExists(path)) { + sourceFileLike.set(path, false); + return undefined; } - return sourcemappedFileCache.get(path); + // And failing that, check the disk + var text = host.readFile(path); + var file = text ? createSourceFileLike(text) : false; + sourceFileLike.set(path, file); + return file ? file : undefined; + } + // This can be called from source mapper in either source program or program that includes generated file + function getSourceFileLike(fileName) { + return !host.getSourceFileLike ? + getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : + host.getSourceFileLike(fileName); } function toLineColumnOffset(fileName, position) { - var file = getFile(fileName); // TODO: GH#18217 + var file = getSourceFileLike(fileName); // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } function clearCache() { - sourcemappedFileCache = createSourceFileLikeCache(host); + sourceFileLike.clear(); + documentPositionMappers.clear(); } } ts.getSourceMapper = getSourceMapper; - function createSourceFileLikeCache(host) { - var cached = ts.createMap(); - return { - get: function (path) { - if (cached.has(path)) { - return cached.get(path); + function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) { + var mapFileName = ts.tryGetSourceMappingURL(generatedFileLineInfo); + if (mapFileName) { + var match = base64UrlRegExp.exec(mapFileName); + if (match) { + if (match[1]) { + var base64Object = match[1]; + return convertDocumentToSourceMapper(host, ts.base64decode(ts.sys, base64Object), generatedFileName); } - if (!host.fileExists || !host.readFile || !host.fileExists(path)) - return; - // And failing that, check the disk - var text = host.readFile(path); // TODO: GH#18217 - var file = { - text: text, - lineMap: undefined, - getLineAndCharacterOfPosition: function (pos) { - return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos); - } - }; - cached.set(path, file); - return file; + // Not a data URL we can parse, skip it + mapFileName = undefined; + } + } + var possibleMapLocations = []; + if (mapFileName) { + possibleMapLocations.push(mapFileName); + } + possibleMapLocations.push(generatedFileName + ".map"); + var originalMapFileName = mapFileName && ts.getNormalizedAbsolutePath(mapFileName, ts.getDirectoryPath(generatedFileName)); + for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) { + var location = possibleMapLocations_1[_i]; + var mapFileName_1 = ts.getNormalizedAbsolutePath(location, ts.getDirectoryPath(generatedFileName)); + var mapFileContents = readMapFile(mapFileName_1, originalMapFileName); + if (ts.isString(mapFileContents)) { + return convertDocumentToSourceMapper(host, mapFileContents, mapFileName_1); + } + if (mapFileContents !== undefined) { + return mapFileContents || undefined; + } + } + return undefined; + } + ts.getDocumentPositionMapper = getDocumentPositionMapper; + function convertDocumentToSourceMapper(host, contents, mapFileName) { + var map = ts.tryParseRawSourceMap(contents); + if (!map || !map.sources || !map.file || !map.mappings) { + // obviously invalid map + return undefined; + } + return ts.createDocumentPositionMapper(host, map, mapFileName); + } + function createSourceFileLike(text, lineMap) { + return { + text: text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { + return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos); } }; } @@ -103702,6 +104666,7 @@ var ts; /* @internal */ var ts; (function (ts) { + var visitedNestedConvertibleFunctions = ts.createMap(); function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { program.getSemanticDiagnostics(sourceFile, cancellationToken); var diags = []; @@ -103712,6 +104677,7 @@ var ts; diags.push(ts.createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); } var isJsFile = ts.isSourceFileJS(sourceFile); + visitedNestedConvertibleFunctions.clear(); check(sourceFile); if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -103809,13 +104775,17 @@ var ts; } } function addConvertToAsyncFunctionDiagnostics(node, checker, diags) { - if (!ts.isAsyncFunction(node) && + // need to check function before checking map so that deeper levels of nested callbacks are checked + if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) { + diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function)); + } + } + function isConvertibleFunction(node, checker) { + return !ts.isAsyncFunction(node) && node.body && ts.isBlock(node.body) && hasReturnStatementWithPromiseHandler(node.body) && - returnsPromise(node, checker)) { - diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function)); - } + returnsPromise(node, checker); } function returnsPromise(node, checker) { var functionType = checker.getTypeAtLocation(node); @@ -103856,16 +104826,21 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 96 /* NullKeyword */: - case 72 /* Identifier */: // identifier includes undefined case 239 /* FunctionDeclaration */: case 196 /* FunctionExpression */: case 197 /* ArrowFunction */: + visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); + /* falls through */ + case 96 /* NullKeyword */: + case 72 /* Identifier */: // identifier includes undefined return true; default: return false; } } + function getKeyFromNode(exp) { + return exp.pos.toString() + ":" + exp.end.toString(); + } })(ts || (ts = {})); /* @internal */ var ts; @@ -104588,7 +105563,7 @@ var ts; return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.cloneCompilerOptions(options); - var _loop_16 = function (opt) { + var _loop_18 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -104607,7 +105582,7 @@ var ts; }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_16(opt); + _loop_18(opt); } return options; } @@ -107779,7 +108754,7 @@ var ts; ChangeTracker.prototype.finishDeleteDeclarations = function () { var _this = this; var deletedNodesInLists = new ts.NodeSet(); // Stores nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. - var _loop_17 = function (sourceFile, node) { + var _loop_19 = function (sourceFile, node) { if (!this_1.deletedNodes.some(function (d) { return d.sourceFile === sourceFile && ts.rangeContainsRangeExclusive(d.node, node); })) { if (ts.isArray(node)) { this_1.deleteRange(sourceFile, ts.rangeOfTypeParameters(node)); @@ -107792,7 +108767,7 @@ var ts; var this_1 = this; for (var _i = 0, _a = this.deletedNodes; _i < _a.length; _i++) { var _b = _a[_i], sourceFile = _b.sourceFile, node = _b.node; - _loop_17(sourceFile, node); + _loop_19(sourceFile, node); } deletedNodesInLists.forEach(function (node) { var sourceFile = node.getSourceFile(); @@ -107849,14 +108824,14 @@ var ts; // order changes by start position // If the start position is the same, put the shorter range first, since an empty range (x, x) may precede (x, y) but not vice-versa. var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); }); - var _loop_18 = function (i) { + var _loop_20 = function (i) { ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () { return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range); }); }; // verify that change intervals do not overlap, except possibly at end points. for (var i = 0; i < normalized.length - 1; i++) { - _loop_18(i); + _loop_20(i); } var textChanges = normalized.map(function (c) { return ts.createTextChange(ts.createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate)); @@ -108460,6 +109435,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addNameToNamelessParameter"; + var errorCodes = [ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_parameter_name, fixId, ts.Diagnostics.Add_names_to_all_parameters_without_names)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, + }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos); + if (!ts.isIdentifier(token)) { + return ts.Debug.fail("add-name-to-nameless-parameter operates on identifiers, but got a " + ts.formatSyntaxKind(token.kind)); + } + var param = token.parent; + if (!ts.isParameter(param)) { + return ts.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts.formatSyntaxKind(token.kind)); + } + var i = param.parent.parameters.indexOf(param); + ts.Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); + ts.Debug.assert(i > -1, "Parameter not found in parent parameter list."); + var replacement = ts.createParameter( + /*decorators*/ undefined, param.modifiers, param.dotDotDotToken, "arg" + i, param.questionToken, ts.createTypeReferenceNode(token, /*typeArguments*/ undefined), param.initializer); + changeTracker.replaceNode(sourceFile, token, replacement); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -108952,8 +109961,8 @@ var ts; (function (InferFromReference) { function inferTypesFromReferences(references, checker, cancellationToken) { var usageContext = {}; - for (var _i = 0, references_1 = references; _i < references_1.length; _i++) { - var reference = references_1[_i]; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } @@ -108969,8 +109978,8 @@ var ts; return undefined; } var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; + for (var _i = 0, references_3 = references; _i < references_3.length; _i++) { + var reference = references_3[_i]; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } @@ -109610,7 +110619,7 @@ var ts; var newNodes = transformExpression(node, transformer, node); changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); } - var _loop_19 = function (statement) { + var _loop_21 = function (statement) { ts.forEachChild(statement, function visit(node) { if (ts.isCallExpression(node)) { startTransformation(node, statement); @@ -109622,7 +110631,7 @@ var ts; }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { var statement = returnStatements_1[_i]; - _loop_19(statement); + _loop_21(statement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -110530,11 +111539,10 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var program = context.program, sourceFile = context.sourceFile, span = context.span; + var sourceFile = context.sourceFile, span = context.span; var classDeclaration = getClass(sourceFile, span.start); - var checker = program.getTypeChecker(); return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences); }); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences); }); return changes.length === 0 ? undefined : codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, ts.Diagnostics.Implement_all_unimplemented_interfaces); }); }, @@ -110546,7 +111554,7 @@ var ts; if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { var implementedTypeNode = _a[_i]; - addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes, context.preferences); + addMissingDeclarations(context, implementedTypeNode, diag.file, classDeclaration, changes, context.preferences); } } }); @@ -110558,7 +111566,8 @@ var ts; function symbolPointsToNonPrivateMember(symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); } - function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + var checker = context.program.getTypeChecker(); var maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker); // Note that this is ultimately derived from a map indexed by symbol names, // so duplicates cannot occur. @@ -110572,11 +111581,11 @@ var ts; if (!classType.getStringIndexType()) { createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); } - codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, context, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); if (indexInfoOfKind) { - changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration, /*flags*/ undefined, codefix.getNoopSymbolTrackerWithResolver(context))); } } } @@ -110902,7 +111911,7 @@ var ts; var symbolName = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken && (ts.isIntrinsicJsxName(symbolToken.text) || checker.resolveName(symbolToken.text, symbolToken, 67108863 /* All */, /*excludeGlobals*/ false)) - ? checker.getJsxNamespace() + ? checker.getJsxNamespace(sourceFile) : symbolToken.text; // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default" /* Default */); @@ -111274,7 +112283,7 @@ var ts; }); typeDeclToMembers.forEach(function (infos, classDeclaration) { var supers = getAllSupers(classDeclaration, checker); - var _loop_20 = function (info) { + var _loop_22 = function (info) { // If some superclass added this property, don't add it again. if (supers.some(function (superClassOrInterface) { var superInfos = typeDeclToMembers.get(superClassOrInterface); @@ -111301,7 +112310,7 @@ var ts; }; for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { var info = infos_1[_i]; - _loop_20(info); + _loop_22(info); } }); })); @@ -111450,7 +112459,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0, token.text], fixId, ts.Diagnostics.Add_all_missing_members); } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { - var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, !ts.isInterfaceDeclaration(typeDecl)); + var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); var containingMethodDeclaration = ts.getAncestor(callExpression, 156 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); @@ -111476,6 +112485,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addMissingNewOperator"; + var errorCodes = [ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingNewOperator(t, sourceFile, span); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_new_operator_to_call, fixId, ts.Diagnostics.Add_missing_new_operator_to_all_calls)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return addMissingNewOperator(changes, context.sourceFile, diag); + }); }, + }); + function addMissingNewOperator(changes, sourceFile, span) { + var call = ts.cast(findAncestorMatchingSpan(sourceFile, span), ts.isCallExpression); + var newExpression = ts.createNew(call.expression, call.typeArguments, call.arguments); + changes.replaceNode(sourceFile, call, newExpression); + } + function findAncestorMatchingSpan(sourceFile, span) { + var token = ts.getTokenAtPosition(sourceFile, span.start); + var end = ts.textSpanEnd(span); + while (token.end < end) { + token = token.parent; + } + return token; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -111553,10 +112596,10 @@ var ts; var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile); if (!tsconfigObjectLiteral) return undefined; - var compilerOptionsProperty = findProperty(tsconfigObjectLiteral, "compilerOptions"); + var compilerOptionsProperty = codefix.findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); if (!compilerOptionsProperty) { var newCompilerOptions = ts.createObjectLiteral([makeDefaultBaseUrl(), makeDefaultPaths()]); - changes.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment("compilerOptions", newCompilerOptions)); + changes.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, codefix.createJsonPropertyAssignment("compilerOptions", newCompilerOptions)); return defaultTypesDirectoryName; } var compilerOptions = compilerOptionsProperty.initializer; @@ -111568,10 +112611,10 @@ var ts; } var defaultBaseUrl = "."; function makeDefaultBaseUrl() { - return createJsonPropertyAssignment("baseUrl", ts.createStringLiteral(defaultBaseUrl)); + return codefix.createJsonPropertyAssignment("baseUrl", ts.createStringLiteral(defaultBaseUrl)); } function getOrAddBaseUrl(changes, tsconfig, compilerOptions) { - var baseUrlProp = findProperty(compilerOptions, "baseUrl"); + var baseUrlProp = codefix.findJsonProperty(compilerOptions, "baseUrl"); if (baseUrlProp) { return ts.isStringLiteral(baseUrlProp.initializer) ? baseUrlProp.initializer.text : defaultBaseUrl; } @@ -111582,13 +112625,13 @@ var ts; } var defaultTypesDirectoryName = "types"; function makeDefaultPathMapping() { - return createJsonPropertyAssignment("*", ts.createArrayLiteral([ts.createStringLiteral(defaultTypesDirectoryName + "/*")])); + return codefix.createJsonPropertyAssignment("*", ts.createArrayLiteral([ts.createStringLiteral(defaultTypesDirectoryName + "/*")])); } function makeDefaultPaths() { - return createJsonPropertyAssignment("paths", ts.createObjectLiteral([makeDefaultPathMapping()])); + return codefix.createJsonPropertyAssignment("paths", ts.createObjectLiteral([makeDefaultPathMapping()])); } function getOrAddPathMapping(changes, tsconfig, compilerOptions) { - var paths = findProperty(compilerOptions, "paths"); + var paths = codefix.findJsonProperty(compilerOptions, "paths"); if (!paths || !ts.isObjectLiteralExpression(paths.initializer)) { changes.insertNodeAtObjectStart(tsconfig, compilerOptions, makeDefaultPaths()); return defaultTypesDirectoryName; @@ -111604,12 +112647,6 @@ var ts; changes.insertNodeAtObjectStart(tsconfig, paths.initializer, makeDefaultPathMapping()); return defaultTypesDirectoryName; } - function createJsonPropertyAssignment(name, initializer) { - return ts.createPropertyAssignment(ts.createStringLiteral(name), initializer); - } - function findProperty(obj, name) { - return ts.find(obj.properties, function (p) { return ts.isPropertyAssignment(p) && !!p.name && ts.isStringLiteral(p.name) && p.name.text === name; }); - } function getInstallCommand(fileName, packageName) { return { type: "install package", file: fileName, packageName: packageName }; } @@ -111638,9 +112675,9 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var program = context.program, sourceFile = context.sourceFile, span = context.span; + var sourceFile = context.sourceFile, span = context.span; var changes = ts.textChanges.ChangeTracker.with(context, function (t) { - return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t, context.preferences); + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, context, t, context.preferences); }); return changes.length === 0 ? undefined : [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Implement_inherited_abstract_class, fixId, ts.Diagnostics.Implement_all_inherited_abstract_classes)]; }, @@ -111650,7 +112687,7 @@ var ts; return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var classDeclaration = getClass(diag.file, diag.start); if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { - addMissingMembers(classDeclaration, context.sourceFile, context.program.getTypeChecker(), changes, context.preferences); + addMissingMembers(classDeclaration, context.sourceFile, context, changes, context.preferences); } }); }, @@ -111661,13 +112698,14 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); return ts.cast(token.parent, ts.isClassLike); } - function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker, preferences) { + function addMissingMembers(classDeclaration, sourceFile, context, changeTracker, preferences) { var extendsNode = ts.getEffectiveBaseTypeNode(classDeclaration); + var checker = context.program.getTypeChecker(); var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); // Note that this is ultimately derived from a map indexed by symbol names, // so duplicates cannot occur. var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); - codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, context, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files @@ -111766,6 +112804,32 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "enableExperimentalDecorators"; + var errorCodes = [ + ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning.code + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var configFile = context.program.getCompilerOptions().configFile; + if (configFile === undefined) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) { return makeChange(changeTracker, configFile); }); + return [codefix.createCodeFixActionNoFixId(fixId, changes, ts.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; + }, + fixIds: [fixId], + }); + function makeChange(changeTracker, configFile) { + codefix.setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", ts.createTrue()); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -112409,24 +113473,43 @@ var ts; * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. * @returns Empty string iff there are no member insertions. */ - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, preferences, out) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, context, preferences, out) { var classMembers = classDeclaration.symbol.members; for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { var symbol = possiblyMissingSymbols_1[_i]; if (!classMembers.has(symbol.escapedName)) { - addNewNodeForMemberSymbol(symbol, classDeclaration, checker, preferences, out); + addNewNodeForMemberSymbol(symbol, classDeclaration, context, preferences, out); } } } codefix.createMissingMemberNodes = createMissingMemberNodes; + function getModuleSpecifierResolverHost(context) { + return { + directoryExists: context.host.directoryExists ? function (d) { return context.host.directoryExists(d); } : undefined, + fileExists: context.host.fileExists ? function (f) { return context.host.fileExists(f); } : undefined, + getCurrentDirectory: context.host.getCurrentDirectory ? function () { return context.host.getCurrentDirectory(); } : undefined, + readFile: context.host.readFile ? function (f) { return context.host.readFile(f); } : undefined, + useCaseSensitiveFileNames: context.host.useCaseSensitiveFileNames ? function () { return context.host.useCaseSensitiveFileNames(); } : undefined, + getSourceFiles: function () { return context.program.getSourceFiles(); }, + getCommonSourceDirectory: function () { return context.program.getCommonSourceDirectory(); }, + }; + } + function getNoopSymbolTrackerWithResolver(context) { + return { + trackSymbol: ts.noop, + moduleResolverHost: getModuleSpecifierResolverHost(context), + }; + } + codefix.getNoopSymbolTrackerWithResolver = getNoopSymbolTrackerWithResolver; /** * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. */ - function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, preferences, out) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, context, preferences, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } + var checker = context.program.getTypeChecker(); var declaration = declarations[0]; var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration), /*includeTrivia*/ false); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); @@ -112438,7 +113521,7 @@ var ts; case 159 /* SetAccessor */: case 153 /* PropertySignature */: case 154 /* PropertyDeclaration */: - var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(56 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); @@ -112478,13 +113561,14 @@ var ts; break; } function outputMethod(signature, modifiers, name, body) { - var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + var method = signatureToMethodDeclaration(context, signature, enclosingDeclaration, modifiers, name, optional, body); if (method) out(method); } } - function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 156 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + function signatureToMethodDeclaration(context, signature, enclosingDeclaration, modifiers, name, optional, body) { + var program = context.program; + var signatureDeclaration = program.getTypeChecker().signatureToSignatureDeclaration(signature, 156 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -112495,19 +113579,21 @@ var ts; signatureDeclaration.body = body; return signatureDeclaration; } - function createMethodFromCallExpression(context, call, methodName, inJs, makeStatic, preferences, body) { + function createMethodFromCallExpression(context, call, methodName, inJs, makeStatic, preferences, contextNode) { + var body = !ts.isInterfaceDeclaration(contextNode); var typeArguments = call.typeArguments, args = call.arguments, parent = call.parent; var checker = context.program.getTypeChecker(); + var tracker = getNoopSymbolTrackerWithResolver(context); var types = ts.map(args, function (arg) { // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" - return checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg))); + return checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg)), contextNode, /*flags*/ undefined, tracker); }); var names = ts.map(args, function (arg) { return ts.isIdentifier(arg) ? arg.text : ts.isPropertyAccessExpression(arg) ? arg.name.text : undefined; }); var contextualType = checker.getContextualType(call); - var returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, call) || ts.createKeywordTypeNode(120 /* AnyKeyword */); + var returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker) || ts.createKeywordTypeNode(120 /* AnyKeyword */); return ts.createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [ts.createToken(116 /* StaticKeyword */)] : undefined, @@ -112576,7 +113662,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { @@ -112588,6 +113676,38 @@ var ts; } return undefined; } + function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) { + var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile); + if (!tsconfigObjectLiteral) + return undefined; + var compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); + if (compilerOptionsProperty === undefined) { + changeTracker.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment("compilerOptions", ts.createObjectLiteral([ + createJsonPropertyAssignment(optionName, optionValue), + ]))); + return; + } + var compilerOptions = compilerOptionsProperty.initializer; + if (!ts.isObjectLiteralExpression(compilerOptions)) { + return; + } + var optionProperty = findJsonProperty(compilerOptions, optionName); + if (optionProperty === undefined) { + changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue)); + } + else { + changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue); + } + } + codefix.setJsonCompilerOptionValue = setJsonCompilerOptionValue; + function createJsonPropertyAssignment(name, initializer) { + return ts.createPropertyAssignment(ts.createStringLiteral(name), initializer); + } + codefix.createJsonPropertyAssignment = createJsonPropertyAssignment; + function findJsonProperty(obj, name) { + return ts.find(obj.properties, function (p) { return ts.isPropertyAssignment(p) && !!p.name && ts.isStringLiteral(p.name) && p.name.text === name; }); + } + codefix.findJsonProperty = findJsonProperty; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -112949,9 +114069,9 @@ var ts; forEachOwnNodeOfFunction(fnAst, function (node) { if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && ts.isPropertyAccessExpression(node.left) && node.left.expression.kind === 100 /* ThisKeyword */) { - var name_6 = node.left.name.text; - if (!ts.isJsPrivate(name_6)) { - ts.getOrUpdate(members, name_6, function () { return ts.createProperty(/*decorators*/ undefined, /*modifiers*/ undefined, name_6, /*questionOrExclamationToken*/ undefined, anyType(), /*initializer*/ undefined); }); + var name_7 = node.left.name.text; + if (!ts.isJsPrivate(name_7)) { + ts.getOrUpdate(members, name_7, function () { return ts.createProperty(/*decorators*/ undefined, /*modifiers*/ undefined, name_7, /*questionOrExclamationToken*/ undefined, anyType(), /*initializer*/ undefined); }); } } }); @@ -113466,7 +114586,7 @@ var ts; }); var namespaceImportName = namespaceNameConflicts ? ts.getUniqueName(preferredName, sourceFile) : preferredName; var neededNamedImports = []; - var _loop_21 = function (element) { + var _loop_23 = function (element) { var propertyName = (element.propertyName || element.name).text; ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) { var access = ts.createPropertyAccess(ts.createIdentifier(namespaceImportName), propertyName); @@ -113485,7 +114605,7 @@ var ts; }; for (var _i = 0, _a = toConvert.elements; _i < _a.length; _i++) { var element = _a[_i]; - _loop_21(element); + _loop_23(element); } changes.replaceNode(sourceFile, toConvert, ts.createNamespaceImport(ts.createIdentifier(namespaceImportName))); if (neededNamedImports.length) { @@ -113880,32 +115000,30 @@ var ts; case 100 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 233 /* LabeledStatement */: - { - var label = node.label; - (seenLabels || (seenLabels = [])).push(label.escapedText); - ts.forEachChild(node, visit); - seenLabels.pop(); - break; - } + case 233 /* LabeledStatement */: { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: - { - var label = node.label; - if (label) { - if (!ts.contains(seenLabels, label.escapedText)) { - // attempts to jump to label that is not in range to be extracted - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); - } + case 228 /* ContinueStatement */: { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + // attempts to jump to label that is not in range to be extracted + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); } - else { - if (!(permittedJumps & (node.kind === 229 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { - // attempt to break or continue in a forbidden context - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); - } - } - break; } + else { + if (!(permittedJumps & (node.kind === 229 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + // attempt to break or continue in a forbidden context + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } case 201 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; @@ -114717,7 +115835,7 @@ var ts; : ts.getEnclosingBlockScopeContainer(scopes[0]); ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - var _loop_22 = function (i) { + var _loop_24 = function (i) { var scopeUsages = usagesPerScope[i]; // Special case: in the innermost scope, all usages are available. // (The computed value reflects the value at the top-level of the scope, but the @@ -114757,7 +115875,7 @@ var ts; } }; for (var i = 0; i < scopes.length; i++) { - _loop_22(i); + _loop_24(i); } return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations }; function isInGenericContext(node) { @@ -115308,10 +116426,10 @@ var ts; } function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newModuleName) { var checker = program.getTypeChecker(); - var _loop_23 = function (sourceFile) { + var _loop_25 = function (sourceFile) { if (sourceFile === oldFile) return "continue"; - var _loop_24 = function (statement) { + var _loop_26 = function (statement) { forEachImportInStatement(statement, function (importNode) { if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol) return; @@ -115333,12 +116451,12 @@ var ts; }; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - _loop_24(statement); + _loop_26(statement); } }; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - _loop_23(sourceFile); + _loop_25(sourceFile); } } function getNamespaceLikeImport(node) { @@ -115581,6 +116699,11 @@ var ts; var movedSymbols = new SymbolSet(); var oldImportsNeededByNewFile = new SymbolSet(); var newFileImportsFromOldFile = new SymbolSet(); + var containsJsx = ts.find(toMove, function (statement) { return !!(statement.transformFlags & 4 /* ContainsJsx */); }); + var jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx); + if (jsxNamespaceSymbol) { // Might not exist (e.g. in non-compiling code) + oldImportsNeededByNewFile.add(jsxNamespaceSymbol); + } for (var _i = 0, toMove_1 = toMove; _i < toMove_1.length; _i++) { var statement = toMove_1[_i]; forEachTopLevelDeclaration(statement, function (decl) { @@ -115609,6 +116732,10 @@ var ts; var statement = _c[_b]; if (ts.contains(toMove, statement)) continue; + // jsxNamespaceSymbol will only be set iff it is in oldImportsNeededByNewFile. + if (jsxNamespaceSymbol && !!(statement.transformFlags & 4 /* ContainsJsx */)) { + unusedImportsFromOldFile.delete(jsxNamespaceSymbol); + } forEachReference(statement, checker, function (symbol) { if (movedSymbols.has(symbol)) oldFileImportsFromNewFile.add(symbol); @@ -115616,6 +116743,19 @@ var ts; }); } return { movedSymbols: movedSymbols, newFileImportsFromOldFile: newFileImportsFromOldFile, oldFileImportsFromNewFile: oldFileImportsFromNewFile, oldImportsNeededByNewFile: oldImportsNeededByNewFile, unusedImportsFromOldFile: unusedImportsFromOldFile }; + function getJsxNamespaceSymbol(containsJsx) { + if (containsJsx === undefined) { + return undefined; + } + var jsxNamespace = checker.getJsxNamespace(containsJsx); + // Strictly speaking, this could resolve to a symbol other than the JSX namespace. + // This will produce erroneous output (probably, an incorrectly copied import) but + // is expected to be very rare and easily reversible. + var jsxNamespaceSymbol = checker.resolveName(jsxNamespace, containsJsx, 1920 /* Namespace */, /*excludeGlobals*/ true); + return !!jsxNamespaceSymbol && ts.some(jsxNamespaceSymbol.declarations, isInImport) + ? jsxNamespaceSymbol + : undefined; + } } // Below should all be utilities function isInImport(decl) { @@ -115634,7 +116774,7 @@ var ts; } function isVariableDeclarationInImport(decl) { return ts.isSourceFile(decl.parent.parent.parent) && - decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true); + !!decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true); } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { @@ -116388,8 +117528,8 @@ var ts; SourceFileObject.prototype.getLineStarts = function () { return ts.getLineStarts(this); }; - SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character) { - return ts.getPositionOfLineAndCharacter(this, line, character); + SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character, allowEdits) { + return ts.computePositionOfLineAndCharacter(ts.getLineStarts(this), line, character, this.text, allowEdits); }; SourceFileObject.prototype.getLineEndOfPosition = function (pos) { var line = this.getLineAndCharacterOfPosition(pos).line; @@ -116839,7 +117979,16 @@ var ts; } var useCaseSensitiveFileNames = ts.hostUsesCaseSensitiveFileNames(host); var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - var sourceMapper = ts.getSourceMapper(useCaseSensitiveFileNames, currentDirectory, log, host, function () { return program; }); + var sourceMapper = ts.getSourceMapper({ + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCurrentDirectory: function () { return currentDirectory; }, + getProgram: getProgram, + fileExists: host.fileExists && (function (f) { return host.fileExists(f); }), + readFile: host.readFile && (function (f, encoding) { return host.readFile(f, encoding); }), + getDocumentPositionMapper: host.getDocumentPositionMapper && (function (generatedFileName, sourceFileName) { return host.getDocumentPositionMapper(generatedFileName, sourceFileName); }), + getSourceFileLike: host.getSourceFileLike && (function (f) { return host.getSourceFileLike(f); }), + log: log + }); function getValidSourceFile(fileName) { var sourceFile = program.getSourceFile(fileName); if (!sourceFile) { @@ -116892,15 +118041,7 @@ var ts; writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, fileExists: fileExists, - readFile: function (fileName) { - // stub missing host functionality - var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); - var entry = hostCache && hostCache.getEntryByPath(path); - if (entry) { - return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); - } - return host.readFile && host.readFile(fileName); - }, + readFile: readFile, realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); @@ -116954,6 +118095,15 @@ var ts; !ts.isString(entry) : (!!host.fileExists && host.fileExists(fileName)); } + function readFile(fileName) { + // stub missing host functionality + var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); + var entry = hostCache && hostCache.getEntryByPath(path); + if (entry) { + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); + } + return host.readFile && host.readFile(fileName); + } // Release any files we have acquired in the old program but are // not part of the new program. function onReleaseOldSourceFile(oldSourceFile, oldOptions) { @@ -117165,7 +118315,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function findRenameLocations(fileName, position, findInStrings, findInComments) { + function findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); @@ -117176,7 +118326,7 @@ var ts; }); } else { - return getReferencesWorker(node, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }, ts.FindAllReferences.toRenameLocation); + return getReferencesWorker(node, position, { findInStrings: findInStrings, findInComments: findInComments, providePrefixAndSuffixTextForRename: providePrefixAndSuffixTextForRename, isForRename: true }, function (entry, originalNode, checker) { return ts.FindAllReferences.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false); }); } } function getReferencesAtPosition(fileName, position) { @@ -117600,9 +118750,9 @@ var ts; return ts.stringContains(path, "/node_modules/"); } } - function getRenameInfo(fileName, position) { + function getRenameInfo(fileName, position, options) { synchronizeHostData(); - return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position); + return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position, options); } function getRefactorContext(file, positionOrRange, preferences, formatOptions) { var _a = typeof positionOrRange === "number" ? [positionOrRange, undefined] : [positionOrRange.pos, positionOrRange.end], startPosition = _a[0], endPosition = _a[1]; @@ -118860,13 +120010,13 @@ var ts; var _this = this; return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { + LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) { var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); }); + return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); }); }; - LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { + LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); }); }; /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { diff --git a/src/lib/typescriptServices.d.ts b/src/lib/typescriptServices.d.ts index 7356bd5d..32e2a03e 100644 --- a/src/lib/typescriptServices.d.ts +++ b/src/lib/typescriptServices.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } @@ -1726,15 +1726,18 @@ declare namespace ts { } interface InputFiles extends Node { kind: SyntaxKind.InputFiles; + javascriptPath?: string; javascriptText: string; javascriptMapPath?: string; javascriptMapText?: string; + declarationPath?: string; declarationText: string; declarationMapPath?: string; declarationMapText?: string; } interface UnparsedSource extends Node { kind: SyntaxKind.UnparsedSource; + fileName?: string; text: string; sourceMapPath?: string; sourceMapText?: string; @@ -1778,7 +1781,7 @@ declare namespace ts { type ResolvedConfigFileName = string & { _isResolvedConfigFileName: never; }; - type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles?: ReadonlyArray) => void; + type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: ReadonlyArray) => void; class OperationCanceledException { } interface CancellationToken { @@ -2214,6 +2217,7 @@ declare namespace ts { } interface UniqueESSymbolType extends Type { symbol: Symbol; + escapedName: __String; } interface StringLiteralType extends LiteralType { value: string; @@ -2689,7 +2693,6 @@ declare namespace ts { getDefaultLibLocation?(): string; writeFile: WriteFileCallback; getCurrentDirectory(): string; - getDirectories(path: string): string[]; getCanonicalFileName(fileName: string): string; useCaseSensitiveFileNames(): boolean; getNewLine(): string; @@ -3006,13 +3009,14 @@ declare namespace ts { } interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; readonly includeCompletionsForModuleExports?: boolean; readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */ readonly importModuleSpecifierEnding?: "minimal" | "index" | "js"; readonly allowTextChangesInNewFiles?: boolean; + readonly providePrefixAndSuffixTextForRename?: boolean; } /** Represents a bigint literal value without requiring bigint support */ interface PseudoBigInt { @@ -3097,6 +3101,7 @@ declare namespace ts { scanJsxIdentifier(): SyntaxKind; scanJsxAttributeValue(): SyntaxKind; reScanJsxToken(): JsxTokenSyntaxKind; + reScanLessThanToken(): SyntaxKind; scanJsxToken(): JsxTokenSyntaxKind; scanJSDocToken(): JsDocSyntaxKind; scan(): SyntaxKind; @@ -3978,9 +3983,11 @@ declare namespace ts { function updateCommaList(node: CommaListExpression, elements: ReadonlyArray): CommaListExpression; function createBundle(sourceFiles: ReadonlyArray, prepends?: ReadonlyArray): Bundle; function createUnparsedSourceFile(text: string): UnparsedSource; + function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts"): UnparsedSource; function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; - function createInputFiles(javascript: string, declaration: string): InputFiles; - function createInputFiles(javascript: string, declaration: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; + function createInputFiles(javascriptText: string, declarationText: string): InputFiles; + function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined): InputFiles; + function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; function updateBundle(node: Bundle, sourceFiles: ReadonlyArray, prepends?: ReadonlyArray): Bundle; function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray): CallExpression; function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray, param: ParameterDeclaration, paramValue: Expression): CallExpression; @@ -4278,6 +4285,10 @@ declare namespace ts { * Get the syntax diagnostics, for all source files if source file is not supplied */ getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get the declaration diagnostics, for all source files if source file is not supplied + */ + getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; /** * Get all the dependencies of the file */ @@ -4364,13 +4375,11 @@ declare namespace ts { /** If provided, will be used to reset existing delayed compilation */ clearTimeout?(timeoutId: any): void; } - interface WatchCompilerHost extends WatchHost { + interface ProgramHost { /** * Used to create the program when need for program creation or recreation detected */ createProgram: CreateProgram; - /** If provided, callback to invoke after every new program creation */ - afterProgramCreate?(program: T): void; useCaseSensitiveFileNames(): boolean; getNewLine(): string; getCurrentDirectory(): string; @@ -4404,6 +4413,10 @@ declare namespace ts { /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[]; } + interface WatchCompilerHost extends ProgramHost, WatchHost { + /** If provided, callback to invoke after every new program creation */ + afterProgramCreate?(program: T): void; + } /** * Host to create watch with root files and options */ @@ -4706,8 +4719,8 @@ declare namespace ts { getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan | undefined; getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan | undefined; getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): ReadonlyArray | undefined; + getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo; + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): ReadonlyArray | undefined; getDefinitionAtPosition(fileName: string, position: number): ReadonlyArray | undefined; getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined; getTypeDefinitionAtPosition(fileName: string, position: number): ReadonlyArray | undefined; @@ -5150,6 +5163,9 @@ declare namespace ts { canRename: false; localizedErrorMessage: string; } + interface RenameInfoOptions { + readonly allowRenameOfImportPath?: boolean; + } interface SignatureHelpParameter { name: string; documentation: SymbolDisplayPart[]; diff --git a/src/lib/typescriptServices.js b/src/lib/typescriptServices.js index a6c7a8a3..35dcd58e 100644 --- a/src/lib/typescriptServices.js +++ b/src/lib/typescriptServices.js @@ -73,9 +73,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".2"; + ts.version = ts.versionMajorMinor + ".3333"; })(ts || (ts = {})); (function (ts) { /* @internal */ @@ -1267,6 +1267,18 @@ var ts; return result; } ts.extend = extend; + function copyProperties(first, second) { + for (var id in second) { + if (hasOwnProperty.call(second, id)) { + first[id] = second[id]; + } + } + } + ts.copyProperties = copyProperties; + function maybeBind(obj, fn) { + return fn ? fn.bind(obj) : undefined; + } + ts.maybeBind = maybeBind; function createMultiMap() { var map = createMap(); map.add = multiMapAdd; @@ -1985,7 +1997,11 @@ var ts; } ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; function fill(length, cb) { - return new Array(length).fill(0).map(function (_, i) { return cb(i); }); + var result = Array(length); + for (var i = 0; i < length; i++) { + result[i] = cb(i); + } + return result; } ts.fill = fill; })(ts || (ts = {})); @@ -3242,15 +3258,17 @@ var ts; CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; - CheckFlags[CheckFlags["ContainsPublic"] = 64] = "ContainsPublic"; - CheckFlags[CheckFlags["ContainsProtected"] = 128] = "ContainsProtected"; - CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; - CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; - CheckFlags[CheckFlags["Late"] = 1024] = "Late"; - CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; - CheckFlags[CheckFlags["OptionalParameter"] = 4096] = "OptionalParameter"; - CheckFlags[CheckFlags["RestParameter"] = 8192] = "RestParameter"; + CheckFlags[CheckFlags["HasLiteralType"] = 64] = "HasLiteralType"; + CheckFlags[CheckFlags["ContainsPublic"] = 128] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 256] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 512] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 1024] = "ContainsStatic"; + CheckFlags[CheckFlags["Late"] = 2048] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 4096] = "ReverseMapped"; + CheckFlags[CheckFlags["OptionalParameter"] = 8192] = "OptionalParameter"; + CheckFlags[CheckFlags["RestParameter"] = 16384] = "RestParameter"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; + CheckFlags[CheckFlags["Discriminant"] = 96] = "Discriminant"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; (function (InternalSymbolName) { @@ -4002,6 +4020,16 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + /* @internal */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + ts.generateDjb2Hash = generateDjb2Hash; /** * Set a high stack trace limit to provide more information in case of an error. * Called for command-line and server use cases. @@ -4643,6 +4671,9 @@ var ts; Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), use_strict_directive_used_here: diag(1349, ts.DiagnosticCategory.Error, "use_strict_directive_used_here_1349", "'use strict' directive used here."), Print_the_final_configuration_instead_of_building: diag(1350, ts.DiagnosticCategory.Message, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), + An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, ts.DiagnosticCategory.Error, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), + A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts.DiagnosticCategory.Error, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), + A_bigint_literal_must_be_an_integer: diag(1353, ts.DiagnosticCategory.Error, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -4798,8 +4829,6 @@ var ts; Type_alias_0_circularly_references_itself: diag(2456, ts.DiagnosticCategory.Error, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), Type_alias_name_cannot_be_0: diag(2457, ts.DiagnosticCategory.Error, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, ts.DiagnosticCategory.Error, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), - Type_0_has_no_property_1_and_no_string_index_signature: diag(2459, ts.DiagnosticCategory.Error, "Type_0_has_no_property_1_and_no_string_index_signature_2459", "Type '{0}' has no property '{1}' and no string index signature."), - Type_0_has_no_property_1: diag(2460, ts.DiagnosticCategory.Error, "Type_0_has_no_property_1_2460", "Type '{0}' has no property '{1}'."), Type_0_is_not_an_array_type: diag(2461, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, ts.DiagnosticCategory.Error, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), @@ -4813,7 +4842,7 @@ var ts; A_computed_property_name_of_the_form_0_must_be_of_type_symbol: diag(2471, ts.DiagnosticCategory.Error, "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471", "A computed property name of the form '{0}' must be of type 'symbol'."), Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), - In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), + const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, ts.DiagnosticCategory.Error, "const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474", "const enum member initializers can only contain literal values and other computed enum values."), const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), @@ -4829,11 +4858,11 @@ var ts; The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: diag(2490, ts.DiagnosticCategory.Error, "The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the 'next()' method of an iterator must have a 'value' property."), The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, ts.DiagnosticCategory.Error, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: diag(2493, ts.DiagnosticCategory.Error, "Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2_2493", "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'."), + Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, ts.DiagnosticCategory.Error, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, ts.DiagnosticCategory.Error, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), Type_0_is_not_an_array_type_or_a_string_type: diag(2495, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, ts.DiagnosticCategory.Error, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496", "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."), - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: diag(2497, ts.DiagnosticCategory.Error, "Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct_2497", "Module '{0}' resolves to a non-module entity and cannot be imported using this construct."), + This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, ts.DiagnosticCategory.Error, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, ts.DiagnosticCategory.Error, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), @@ -4903,7 +4932,6 @@ var ts; Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), - Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2568, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568", "Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators."), Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."), Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: diag(2570, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570", "Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?"), Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), @@ -4998,7 +5026,7 @@ var ts; Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, ts.DiagnosticCategory.Error, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), Type_parameter_0_has_a_circular_default: diag(2716, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), - Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), + Duplicate_property_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_property_0_2718", "Duplicate property '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), @@ -5013,6 +5041,7 @@ var ts; An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), + Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), It_is_highly_likely_that_you_are_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "It_is_highly_likely_that_you_are_missing_a_semicolon_2734", "It is highly likely that you are missing a semicolon."), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), @@ -5022,6 +5051,11 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), + No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, ts.DiagnosticCategory.Error, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), + Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, ts.DiagnosticCategory.Error, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), + This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), + This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), + _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5371,6 +5405,7 @@ var ts; Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6368, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6368", "Build all projects, including those that appear to be up to date"), Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), + Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts.DiagnosticCategory.Message, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), @@ -5449,6 +5484,7 @@ var ts; JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, ts.DiagnosticCategory.Error, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), You_cannot_rename_a_module_via_a_global_import: diag(8031, ts.DiagnosticCategory.Error, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), + Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts.DiagnosticCategory.Error, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause."), class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, "class_expressions_are_not_currently_supported_9003", "'class' expressions are not currently supported."), Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, "Language_service_is_disabled_9004", "Language service is disabled."), @@ -5585,6 +5621,7 @@ var ts; Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), + Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), }; })(ts || (ts = {})); var ts; @@ -5809,16 +5846,13 @@ var ts; return result; } ts.computeLineStarts = computeLineStarts; - function getPositionOfLineAndCharacter(sourceFile, line, character) { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); + function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) { + return sourceFile.getPositionOfLineAndCharacter ? + sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : + computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); - } - ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; - /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { if (allowEdits) { @@ -6295,6 +6329,7 @@ var ts; scanJsxIdentifier: scanJsxIdentifier, scanJsxAttributeValue: scanJsxAttributeValue, reScanJsxToken: reScanJsxToken, + reScanLessThanToken: reScanLessThanToken, scanJsxToken: scanJsxToken, scanJSDocToken: scanJSDocToken, scan: scan, @@ -6394,6 +6429,7 @@ var ts; result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } if (decimalFragment !== undefined || tokenFlags & 16 /* Scientific */) { + checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & 16 /* Scientific */)); return { type: 8 /* NumericLiteral */, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -6402,9 +6438,29 @@ var ts; else { tokenValue = result; var type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint + checkForIdentifierStartAfterNumericLiteral(start); return { type: type, value: tokenValue }; } } + function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { + if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) { + return; + } + var identifierStart = pos; + var length = scanIdentifierParts().length; + if (length === 1 && text[identifierStart] === "n") { + if (isScientific) { + error(ts.Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); + } + else { + error(ts.Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); + } + } + else { + error(ts.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + pos = identifierStart; + } + } function scanOctalDigits() { var start = pos; while (isOctalDigit(text.charCodeAt(pos))) { @@ -7270,6 +7326,13 @@ var ts; pos = tokenPos = startPos; return token = scanJsxToken(); } + function reScanLessThanToken() { + if (token === 46 /* LessThanLessThanToken */) { + pos = tokenPos + 1; + return token = 28 /* LessThanToken */; + } + return token; + } function scanJsxToken() { startPos = tokenPos = pos; if (pos >= end) { @@ -8206,7 +8269,9 @@ var ts; case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); case 149 /* ComputedPropertyName */: - return isStringOrNumericLiteralLike(name.expression) ? ts.escapeLeadingUnderscores(name.expression.text) : undefined; // TODO: GH#18217 Almost all uses of this assume the result to be defined! + if (isStringOrNumericLiteralLike(name.expression)) + return ts.escapeLeadingUnderscores(name.expression.text); + return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); default: return ts.Debug.assertNever(name); } @@ -8313,7 +8378,7 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, node.pos); } var isMissing = nodeIsMissing(errorNode); - var pos = isMissing + var pos = isMissing || ts.isJsxText(node) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); // These asserts should all be satisfied for a properly constructed `errorNode`. @@ -9508,6 +9573,7 @@ var ts; return node.initializer; } } + ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration = getSingleInitializerOfVariableStatementOrPropertyDeclaration; function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) ? ts.firstOrUndefined(node.declarationList.declarations) : undefined; } @@ -11546,10 +11612,10 @@ var ts; } if (getCheckFlags(s) & 6 /* Synthetic */) { var checkFlags = s.checkFlags; - var accessModifier = checkFlags & 256 /* ContainsPrivate */ ? 8 /* Private */ : - checkFlags & 64 /* ContainsPublic */ ? 4 /* Public */ : + var accessModifier = checkFlags & 512 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 128 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */; - var staticModifier = checkFlags & 512 /* ContainsStatic */ ? 32 /* Static */ : 0; + var staticModifier = checkFlags & 1024 /* ContainsStatic */ ? 32 /* Static */ : 0; return accessModifier | staticModifier; } if (s.flags & 4194304 /* Prototype */) { @@ -11796,6 +11862,10 @@ var ts; || kind === 290 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; + function isAccessExpression(node) { + return node.kind === 189 /* PropertyAccessExpression */ || node.kind === 190 /* ElementAccessExpression */; + } + ts.isAccessExpression = isAccessExpression; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -14674,6 +14744,8 @@ var ts; return path; } ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; function comparePathsWorker(a, b, componentComparer) { if (a === b) return 0 /* EqualTo */; @@ -14681,14 +14753,30 @@ var ts; return -1 /* LessThan */; if (b === undefined) return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, ts.getRootLength(a)); + var bRoot = b.substring(0, ts.getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. var aComponents = ts.reducePathComponents(ts.getPathComponents(a)); var bComponents = ts.reducePathComponents(ts.getPathComponents(b)); var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 0; i < sharedLength; i++) { - var stringComparer = i === 0 ? ts.compareStringsCaseInsensitive : componentComparer; - var result = stringComparer(aComponents[i], bComponents[i]); - if (result !== 0 /* EqualTo */) { - return result; + for (var i = 1; i < sharedLength; i++) { + var result_1 = componentComparer(aComponents[i], bComponents[i]); + if (result_1 !== 0 /* EqualTo */) { + return result_1; } } return ts.compareValues(aComponents.length, bComponents.length); @@ -16180,15 +16268,15 @@ var ts; if (setParentNodes === void 0) { setParentNodes = false; } scriptKind = ts.ensureScriptKind(fileName, scriptKind); if (scriptKind === 6 /* JSON */) { - var result_1 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes); - ts.convertToObjectWorker(result_1, result_1.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined); - result_1.referencedFiles = ts.emptyArray; - result_1.typeReferenceDirectives = ts.emptyArray; - result_1.libReferenceDirectives = ts.emptyArray; - result_1.amdDependencies = ts.emptyArray; - result_1.hasNoDefaultLib = false; - result_1.pragmas = ts.emptyMap; - return result_1; + var result_2 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes); + ts.convertToObjectWorker(result_2, result_2.parseDiagnostics, /*returnValue*/ false, /*knownRootOptions*/ undefined, /*jsonConversionNotifier*/ undefined); + result_2.referencedFiles = ts.emptyArray; + result_2.typeReferenceDirectives = ts.emptyArray; + result_2.libReferenceDirectives = ts.emptyArray; + result_2.amdDependencies = ts.emptyArray; + result_2.hasNoDefaultLib = false; + result_2.pragmas = ts.emptyMap; + return result_2; } initializeState(sourceText, languageVersion, syntaxCursor, scriptKind); var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes, scriptKind); @@ -16529,6 +16617,9 @@ var ts; function reScanTemplateToken() { return currentToken = scanner.reScanTemplateToken(); } + function reScanLessThanToken() { + return currentToken = scanner.reScanLessThanToken(); + } function scanJsxIdentifier() { return currentToken = scanner.scanJsxIdentifier(); } @@ -17067,6 +17158,8 @@ var ts; return parseElement(); } function currentNode(parsingContext) { + // If we don't have a cursor or the parsing context isn't reusable, there's nothing to reuse. + // // If there is an outstanding parse error that we've encountered, but not attached to // some node, then we cannot get a node from the old source tree. This is because we // want to mark the next node we encounter as being unusable. @@ -17074,25 +17167,15 @@ var ts; // Note: This may be too conservative. Perhaps we could reuse the node and set the bit // on it (or its leftmost child) as having the error. For now though, being conservative // is nice and likely won't ever affect perf. - if (parseErrorBeforeNextFinishedNode) { - return undefined; - } - if (!syntaxCursor) { - // if we don't have a cursor, we could never return a node from the old tree. + if (!syntaxCursor || !isReusableParsingContext(parsingContext) || parseErrorBeforeNextFinishedNode) { return undefined; } var node = syntaxCursor.currentNode(scanner.getStartPos()); // Can't reuse a missing node. - if (ts.nodeIsMissing(node)) { - return undefined; - } // Can't reuse a node that intersected the change range. - if (node.intersectsChange) { - return undefined; - } // Can't reuse a node that contains a parse error. This is necessary so that we // produce the same set of errors again. - if (ts.containsParseError(node)) { + if (ts.nodeIsMissing(node) || node.intersectsChange || ts.containsParseError(node)) { return undefined; } // We can only reuse a node if it was parsed under the same strict mode that we're @@ -17127,6 +17210,22 @@ var ts; nextToken(); return node; } + function isReusableParsingContext(parsingContext) { + switch (parsingContext) { + case 5 /* ClassMembers */: + case 2 /* SwitchClauses */: + case 0 /* SourceElements */: + case 1 /* BlockStatements */: + case 3 /* SwitchClauseStatements */: + case 6 /* EnumMembers */: + case 4 /* TypeMembers */: + case 8 /* VariableDeclarations */: + case 17 /* JSDocParameters */: + case 16 /* Parameters */: + return true; + } + return false; + } function canReuseNode(node, parsingContext) { switch (parsingContext) { case 5 /* ClassMembers */: @@ -17146,22 +17245,20 @@ var ts; case 17 /* JSDocParameters */: case 16 /* Parameters */: return isReusableParameter(node); - case 18 /* RestProperties */: - return false; // Any other lists we do not care about reusing nodes in. But feel free to add if // you can do so safely. Danger areas involve nodes that may involve speculative // parsing. If speculative parsing is involved with the node, then the range the // parser reached while looking ahead might be in the edited range (see the example // in canReuseVariableDeclaratorNode for a good case of this). - case 22 /* HeritageClauses */: + // case ParsingContext.HeritageClauses: // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. - case 19 /* TypeParameters */: + // case ParsingContext.TypeParameters: // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in // unambiguous *type* contexts. While type *arguments* occur in very ambiguous // *expression* contexts. - case 21 /* TupleElementTypes */: + // case ParsingContext.TupleElementTypes: // This would probably be safe to reuse. There is no speculative parsing with // tuple types. // Technically, type argument list types are probably safe to reuse. While @@ -17169,24 +17266,24 @@ var ts; // produced from speculative parsing a < as a type argument list), we only have // the types because speculative parsing succeeded. Thus, the lookahead never // went past the end of the list and rewound. - case 20 /* TypeArguments */: + // case ParsingContext.TypeArguments: // Note: these are almost certainly not safe to ever reuse. Expressions commonly // need a large amount of lookahead, and we should not reuse them as they may // have actually intersected the edit. - case 11 /* ArgumentExpressions */: + // case ParsingContext.ArgumentExpressions: // This is not safe to reuse for the same reason as the 'AssignmentExpression' // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. - case 12 /* ObjectLiteralMembers */: + // case ParsingContext.ObjectLiteralMembers: // This is probably not safe to reuse. There can be speculative parsing with // type names in a heritage clause. There can be generic names in the type // name list, and there can be left hand side expressions (which can have type // arguments.) - case 7 /* HeritageClauseElement */: + // case ParsingContext.HeritageClauseElement: // Perhaps safe to reuse, but it's unlikely we'd see more than a dozen attributes // on any given element. Same for children. - case 13 /* JsxAttributes */: - case 14 /* JsxChildren */: + // case ParsingContext.JsxAttributes: + // case ParsingContext.JsxChildren: } return false; } @@ -17534,7 +17631,7 @@ var ts; function parseTypeReference() { var node = createNode(164 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); - if (!scanner.hasPrecedingLineBreak() && token() === 28 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 28 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 28 /* LessThanToken */, 30 /* GreaterThanToken */); } return finishNode(node); @@ -19556,7 +19653,8 @@ var ts; function parseCallExpressionRest(expression) { while (true) { expression = parseMemberExpressionRest(expression); - if (token() === 28 /* LessThanToken */) { + // handle 'foo<()' + if (token() === 28 /* LessThanToken */ || token() === 46 /* LessThanLessThanToken */) { // See if this is the start of a generic invocation. If so, consume it and // keep checking for postfix expressions. Otherwise, it's just a '<' that's // part of an arithmetic expression. Break out so we consume it higher in the @@ -19593,9 +19691,10 @@ var ts; return result; } function parseTypeArgumentsInExpression() { - if (!parseOptional(28 /* LessThanToken */)) { + if (reScanLessThanToken() !== 28 /* LessThanToken */) { return undefined; } + nextToken(); var typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType); if (!parseExpected(30 /* GreaterThanToken */)) { // If it doesn't have the closing `>` then it's definitely not an type argument list. @@ -22416,17 +22515,18 @@ var ts; var libReferenceDirectives_1 = context.libReferenceDirectives; ts.forEach(ts.toArray(entryOrList), function (arg) { // TODO: GH#18217 + var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path; if (arg.arguments["no-default-lib"]) { context.hasNoDefaultLib = true; } - else if (arg.arguments.types) { - typeReferenceDirectives_1.push({ pos: arg.arguments.types.pos, end: arg.arguments.types.end, fileName: arg.arguments.types.value }); + else if (types) { + typeReferenceDirectives_1.push({ pos: types.pos, end: types.end, fileName: types.value }); } - else if (arg.arguments.lib) { - libReferenceDirectives_1.push({ pos: arg.arguments.lib.pos, end: arg.arguments.lib.end, fileName: arg.arguments.lib.value }); + else if (lib) { + libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value }); } - else if (arg.arguments.path) { - referencedFiles_1.push({ pos: arg.arguments.path.pos, end: arg.arguments.path.end, fileName: arg.arguments.path.value }); + else if (path) { + referencedFiles_1.push({ pos: path.pos, end: path.end, fileName: path.value }); } else { reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, ts.Diagnostics.Invalid_reference_directive_syntax); @@ -24103,7 +24203,7 @@ var ts; var config = __assign({ compilerOptions: __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) { var _a; return (__assign({}, prev, (_a = {}, _a[cur[0]] = cur[1], _a))); - }, {}), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined }), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign({}, r, { path: r.originalPath, originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (configParseResult.configFileSpecs ? { + }, {}), { showConfig: undefined, configFile: undefined, configFilePath: undefined, help: undefined, init: undefined, listFiles: undefined, listEmittedFiles: undefined, project: undefined, build: undefined, version: undefined }), references: ts.map(configParseResult.projectReferences, function (r) { return (__assign({}, r, { path: r.originalPath, originalPath: undefined })); }), files: ts.length(files) ? files : undefined }, (configParseResult.configFileSpecs ? { include: filterSameAsDefaultInclude(configParseResult.configFileSpecs.validatedIncludeSpecs), exclude: configParseResult.configFileSpecs.validatedExcludeSpecs } : {}), { compilerOnSave: !!configParseResult.compileOnSave ? true : undefined }); @@ -24137,7 +24237,7 @@ var ts; return function (_) { return true; }; } function getCustomTypeMapOfCommandLineOption(optionDefinition) { - if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { + if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean" || optionDefinition.type === "object") { // this is of a type CommandLineOptionOfPrimitiveType return undefined; } @@ -24294,7 +24394,7 @@ var ts; result.push(tab + "}"); } result.push("}"); - return result.join(newLine); + return result.join(newLine) + newLine; } } ts.generateTSConfig = generateTSConfig; @@ -26467,6 +26567,7 @@ var ts; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; })(ContainerFlags || (ContainerFlags = {})); + var flowNodeCreated = ts.identity; var binder = createBinder(); function bindSourceFile(file, options) { ts.performance.mark("beforeBind"); @@ -26579,6 +26680,10 @@ var ts; if (symbolFlags & (32 /* Class */ | 64 /* Interface */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && !symbol.members) { symbol.members = ts.createSymbolTable(); } + // On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate) + if (symbol.constEnumOnlyModule && (symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */))) { + symbol.constEnumOnlyModule = false; + } if (symbolFlags & 67220415 /* Value */) { setValueDeclaration(symbol, node); } @@ -26851,6 +26956,7 @@ var ts; blockScopeContainer.locals = undefined; } if (containerFlags & 4 /* IsControlFlowContainer */) { + var saveFlowNodeCreated = flowNodeCreated; var saveCurrentFlow = currentFlow; var saveBreakTarget = currentBreakTarget; var saveContinueTarget = currentContinueTarget; @@ -26874,6 +26980,7 @@ var ts; currentContinueTarget = undefined; activeLabels = undefined; hasExplicitReturn = false; + flowNodeCreated = ts.identity; bindChildren(node); // Reset all reachability check related flags on node (for incremental scenarios) node.flags &= ~1408 /* ReachabilityAndEmitFlags */; @@ -26900,6 +27007,7 @@ var ts; currentReturnTarget = saveReturnTarget; activeLabels = saveActiveLabels; hasExplicitReturn = saveHasExplicitReturn; + flowNodeCreated = saveFlowNodeCreated; } else if (containerFlags & 64 /* IsInterface */) { seenThisKeyword = false; @@ -27067,7 +27175,7 @@ var ts; } function isNarrowableReference(expr) { return expr.kind === 72 /* Identifier */ || expr.kind === 100 /* ThisKeyword */ || expr.kind === 98 /* SuperKeyword */ || - ts.isPropertyAccessExpression(expr) && isNarrowableReference(expr.expression) || + (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || ts.isElementAccessExpression(expr) && expr.argumentExpression && (ts.isStringLiteral(expr.argumentExpression) || ts.isNumericLiteral(expr.argumentExpression)) && isNarrowableReference(expr.expression); @@ -27163,22 +27271,22 @@ var ts; return antecedent; } setFlowNodeReferenced(antecedent); - return { flags: flags, expression: expression, antecedent: antecedent }; + return flowNodeCreated({ flags: flags, expression: expression, antecedent: antecedent }); } function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { if (!isNarrowingExpression(switchStatement.expression)) { return antecedent; } setFlowNodeReferenced(antecedent); - return { flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }; + return flowNodeCreated({ flags: 128 /* SwitchClause */, switchStatement: switchStatement, clauseStart: clauseStart, clauseEnd: clauseEnd, antecedent: antecedent }); } function createFlowAssignment(antecedent, node) { setFlowNodeReferenced(antecedent); - return { flags: 16 /* Assignment */, antecedent: antecedent, node: node }; + return flowNodeCreated({ flags: 16 /* Assignment */, antecedent: antecedent, node: node }); } function createFlowArrayMutation(antecedent, node) { setFlowNodeReferenced(antecedent); - var res = { flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }; + var res = flowNodeCreated({ flags: 256 /* ArrayMutation */, antecedent: antecedent, node: node }); return res; } function finishFlowLabel(flow) { @@ -27366,18 +27474,50 @@ var ts; function bindTryStatement(node) { var preFinallyLabel = createBranchLabel(); var preTryFlow = currentFlow; - // TODO: Every statement in try block is potentially an exit point! + var tryPriors = []; + var oldFlowNodeCreated = flowNodeCreated; + // We hook the creation of all flow nodes within the `try` scope and store them so we can add _all_ of them + // as possible antecedents of the start of the `catch` or `finally` blocks. + // Don't bother intercepting the call if there's no finally or catch block that needs the information + if (node.catchClause || node.finallyBlock) { + flowNodeCreated = function (node) { return (tryPriors.push(node), node); }; + } bind(node.tryBlock); + flowNodeCreated = oldFlowNodeCreated; addAntecedent(preFinallyLabel, currentFlow); var flowAfterTry = currentFlow; var flowAfterCatch = unreachableFlow; if (node.catchClause) { currentFlow = preTryFlow; + if (tryPriors.length) { + var preCatchFlow = createBranchLabel(); + addAntecedent(preCatchFlow, currentFlow); + for (var _i = 0, tryPriors_1 = tryPriors; _i < tryPriors_1.length; _i++) { + var p = tryPriors_1[_i]; + addAntecedent(preCatchFlow, p); + } + currentFlow = finishFlowLabel(preCatchFlow); + } bind(node.catchClause); addAntecedent(preFinallyLabel, currentFlow); flowAfterCatch = currentFlow; } if (node.finallyBlock) { + // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block + // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will + // have the end of the `try` block and the end of the `catch` block) + var preFinallyPrior = preTryFlow; + if (!node.catchClause) { + if (tryPriors.length) { + var preFinallyFlow_1 = createBranchLabel(); + addAntecedent(preFinallyFlow_1, preTryFlow); + for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) { + var p = tryPriors_2[_a]; + addAntecedent(preFinallyFlow_1, p); + } + preFinallyPrior = finishFlowLabel(preFinallyFlow_1); + } + } // in finally flow is combined from pre-try/flow from try/flow from catch // pre-flow is necessary to make sure that finally is reachable even if finally flows in both try and finally blocks are unreachable // also for finally blocks we inject two extra edges into the flow graph. @@ -27404,7 +27544,7 @@ var ts; // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} }; + var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); bind(node.finallyBlock); @@ -27422,7 +27562,7 @@ var ts; } } if (!(currentFlow.flags & 1 /* Unreachable */)) { - var afterFinallyFlow = { flags: 4096 /* AfterFinally */, antecedent: currentFlow }; + var afterFinallyFlow = flowNodeCreated({ flags: 4096 /* AfterFinally */, antecedent: currentFlow }); preFinallyFlow.lock = afterFinallyFlow; currentFlow = afterFinallyFlow; } @@ -30511,10 +30651,10 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); - var markerSuperType = createType(262144 /* TypeParameter */); - var markerSubType = createType(262144 /* TypeParameter */); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); markerSubType.constraint = markerSuperType; - var markerOtherType = createType(262144 /* TypeParameter */); + var markerOtherType = createTypeParameter(); var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); @@ -30704,7 +30844,6 @@ var ts; var _jsxFactoryEntity; var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); - var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); @@ -31422,13 +31561,18 @@ var ts; } } break; + case 197 /* ArrowFunction */: + // when targeting ES6 or higher there is no 'arguments' in an arrow function + // for lower compile targets the resolved symbol is used to emit an error + if (compilerOptions.target >= 2 /* ES2015 */) { + break; + } + // falls through case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: case 157 /* Constructor */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -31562,7 +31706,8 @@ var ts; } // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 67220415 /* Value */) === 67220415 /* Value */ && !(originalLocation.flags & 2097152 /* JSDoc */)) { - if (ts.some(result.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) { + var merged = getMergedSymbol(result); + if (ts.length(merged.declarations) && ts.every(merged.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); // TODO: GH#18217 } } @@ -32322,7 +32467,10 @@ var ts; var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 279 /* SourceFile */)) { - error(referencingLocation, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 + ? "allowSyntheticDefaultImports" + : "esModuleInterop"; + error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); return symbol; } if (compilerOptions.esModuleInterop) { @@ -32617,6 +32765,12 @@ var ts; function createTypeofType() { return getUnionType(ts.arrayFrom(typeofEQFacts.keys(), getLiteralType)); } + function createTypeParameter(symbol) { + var type = createType(262144 /* TypeParameter */); + if (symbol) + type.symbol = symbol; + return type; + } // A reserved member name starts with two underscores, but the third character cannot be an underscore // or the @ symbol. A third underscore indicates an escaped form of an identifer that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES @@ -33570,12 +33724,12 @@ var ts; return ts.createKeywordTypeNode(120 /* AnyKeyword */); } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 4096 /* ReverseMapped */); var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; - if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { + if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 2048 /* Late */) { var decl = ts.first(propertySymbol.declarations); if (hasLateBindableName(decl)) { trackComputedName(decl.name, saveEnclosingDeclaration, context); @@ -33748,7 +33902,7 @@ var ts; } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined; - var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192 /* RestParameter */; + var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 16384 /* RestParameter */; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -33757,7 +33911,7 @@ var ts; cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); - var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 4096 /* OptionalParameter */; + var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192 /* OptionalParameter */; var questionToken = isOptional ? ts.createToken(56 /* QuestionToken */) : undefined; var parameterNode = ts.createParameter( /*decorators*/ undefined, modifiers, dotDotDotToken, name, questionToken, parameterTypeNode, @@ -34153,6 +34307,21 @@ var ts; function isDefaultBindingContext(location) { return location.kind === 279 /* SourceFile */ || ts.isAmbientModule(location); } + function getNameOfSymbolFromNameType(symbol, context) { + var nameType = symbol.nameType; + if (nameType) { + if (nameType.flags & 384 /* StringOrNumberLiteral */) { + var name = "" + nameType.value; + if (!ts.isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) { + return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + } + return name; + } + if (nameType.flags & 8192 /* UniqueESSymbol */) { + return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]"; + } + } + } /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -34172,12 +34341,19 @@ var ts; } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; - var name = ts.getNameOfDeclaration(declaration); - if (name) { + var name_2 = ts.getNameOfDeclaration(declaration); + if (name_2) { if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) { return ts.symbolName(symbol); } - return ts.declarationNameToString(name); + if (ts.isComputedPropertyName(name_2) && !(ts.getCheckFlags(symbol) & 2048 /* Late */) && symbol.nameType && symbol.nameType.flags & 384 /* StringOrNumberLiteral */) { + // Computed property name isn't late bound, but has a well-known name type - use name type to generate a symbol name + var result = getNameOfSymbolFromNameType(symbol, context); + if (result !== undefined) { + return result; + } + } + return ts.declarationNameToString(name_2); } if (declaration.parent && declaration.parent.kind === 237 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); @@ -34192,16 +34368,8 @@ var ts; return declaration.kind === 209 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } - var nameType = symbol.nameType; - if (nameType) { - if (nameType.flags & 128 /* StringLiteral */ && !ts.isIdentifierText(nameType.value, compilerOptions.target)) { - return "\"" + ts.escapeString(nameType.value, 34 /* doubleQuote */) + "\""; - } - if (nameType && nameType.flags & 8192 /* UniqueESSymbol */) { - return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]"; - } - } - return ts.symbolName(symbol); + var name = getNameOfSymbolFromNameType(symbol, context); + return name !== undefined ? name : ts.symbolName(symbol); } function isDeclarationVisible(node) { if (node) { @@ -34421,6 +34589,9 @@ var ts; var prop = getPropertyOfType(type, name); return prop ? getTypeOfSymbol(prop) : undefined; } + function getTypeOfPropertyOrIndexSignature(type, name) { + return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || unknownType; + } function isTypeAny(type) { return type && (type.flags & 1 /* Any */) !== 0; } @@ -34467,6 +34638,64 @@ var ts; var numberIndexInfo = getIndexInfoOfType(source, 1 /* Number */); return createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); } + // Determine the control flow type associated with a destructuring declaration or assignment. The following + // forms of destructuring are possible: + // let { x } = obj; // BindingElement + // let [ x ] = obj; // BindingElement + // { x } = obj; // ShorthandPropertyAssignment + // { x: v } = obj; // PropertyAssignment + // [ x ] = obj; // Expression + // We construct a synthetic element access expression corresponding to 'obj.x' such that the control + // flow analyzer doesn't have to handle all the different syntactic forms. + function getFlowTypeOfDestructuring(node, declaredType) { + var reference = getSyntheticElementAccess(node); + return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; + } + function getSyntheticElementAccess(node) { + var parentAccess = getParentElementAccess(node); + if (parentAccess && parentAccess.flowNode) { + var propName = getDestructuringPropertyName(node); + if (propName) { + var result = ts.createNode(190 /* ElementAccessExpression */, node.pos, node.end); + result.parent = node; + result.expression = parentAccess; + var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); + literal.parent = result; + literal.text = propName; + result.argumentExpression = literal; + result.flowNode = parentAccess.flowNode; + return result; + } + } + } + function getParentElementAccess(node) { + var ancestor = node.parent.parent; + switch (ancestor.kind) { + case 186 /* BindingElement */: + case 275 /* PropertyAssignment */: + return getSyntheticElementAccess(ancestor); + case 187 /* ArrayLiteralExpression */: + return getSyntheticElementAccess(node.parent); + case 237 /* VariableDeclaration */: + return ancestor.initializer; + case 204 /* BinaryExpression */: + return ancestor.right; + } + } + function getDestructuringPropertyName(node) { + var parent = node.parent; + if (node.kind === 186 /* BindingElement */ && parent.kind === 184 /* ObjectBindingPattern */) { + return getLiteralPropertyNameText(node.propertyName || node.name); + } + if (node.kind === 275 /* PropertyAssignment */ || node.kind === 276 /* ShorthandPropertyAssignment */) { + return getLiteralPropertyNameText(node.name); + } + return "" + parent.elements.indexOf(node); + } + function getLiteralPropertyNameText(name) { + var type = getLiteralTypeFromPropertyName(name); + return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : undefined; + } /** Return the inferred type for a binding element */ function getTypeForBindingElement(declaration) { var pattern = declaration.parent; @@ -34507,9 +34736,9 @@ var ts; else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; - var exprType = getLiteralTypeFromPropertyName(name); - var declaredType = checkIndexedAccessIndexType(getIndexedAccessType(parentType, exprType, name), name); - type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name)); + var indexType = getLiteralTypeFromPropertyName(name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); } } else { @@ -34526,21 +34755,13 @@ var ts; mapType(parentType, function (t) { return sliceTupleType(t, index_1); }) : createArrayType(elementType); } + else if (isArrayLikeType(parentType)) { + var indexType = getLiteralType(index_1); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, declaration.name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); + } else { - // Use specific property type when parent is a tuple or numeric index type when parent is an array - var index_2 = pattern.elements.indexOf(declaration); - type = everyType(parentType, isTupleLikeType) ? - getTupleElementType(parentType, index_2) || declaration.initializer && checkDeclarationInitializer(declaration) : - elementType; - if (!type) { - if (isTupleType(parentType)) { - error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), getTypeReferenceArity(parentType), pattern.elements.length); - } - else { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), "" + index_2); - } - return errorType; - } + type = elementType; } } // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -34867,16 +35088,17 @@ var ts; var objectFlags = 128 /* ObjectLiteral */; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; - if (isComputedNonLiteralName(name)) { - // do not include computed properties in the implied type - objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; - return; - } if (e.dotDotDotToken) { stringIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); return; } - var text = ts.getTextOfPropertyName(name); + var exprType = getLiteralTypeFromPropertyName(name); + if (!isTypeUsableAsPropertyName(exprType)) { + // do not include computed properties in the implied type + objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; + return; + } + var text = getPropertyNameFromType(exprType); var flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0); var symbol = createSymbol(flags, text); symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors); @@ -34991,12 +35213,11 @@ var ts; return anyType; } // Handle export default expressions - if (ts.isSourceFile(declaration)) { - var jsonSourceFile = ts.cast(declaration, ts.isJsonSourceFile); - if (!jsonSourceFile.statements.length) { + if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) { + if (!declaration.statements.length) { return emptyObjectType; } - var type_1 = getWidenedLiteralType(checkExpression(jsonSourceFile.statements[0].expression)); + var type_1 = getWidenedLiteralType(checkExpression(declaration.statements[0].expression)); if (type_1.flags & 524288 /* Object */) { return getRegularTypeOfObjectLiteral(type_1); } @@ -35007,6 +35228,10 @@ var ts; } // Handle variable, parameter or property if (!pushTypeResolution(symbol, 0 /* Type */)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & 512 /* ValueModule */) { + return getTypeOfFuncClassEnumModule(symbol); + } return errorType; } var type; @@ -35020,7 +35245,8 @@ var ts; || ts.isClassDeclaration(declaration) || ts.isFunctionDeclaration(declaration) || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) - || ts.isMethodSignature(declaration)) { + || ts.isMethodSignature(declaration) + || ts.isSourceFile(declaration)) { // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); @@ -35060,6 +35286,10 @@ var ts; return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol)); } if (!popTypeResolution()) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & 512 /* ValueModule */) { + return getTypeOfFuncClassEnumModule(symbol); + } type = reportCircularityError(symbol); } return type; @@ -35253,7 +35483,7 @@ var ts; if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (ts.getCheckFlags(symbol) & 2048 /* ReverseMapped */) { + if (ts.getCheckFlags(symbol) & 4096 /* ReverseMapped */) { return getTypeOfReverseMappedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -35632,9 +35862,8 @@ var ts; type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; - type.thisType = createType(262144 /* TypeParameter */); + type.thisType = createTypeParameter(symbol); type.thisType.isThisType = true; - type.thisType.symbol = symbol; type.thisType.constraint = type; } } @@ -35770,19 +35999,11 @@ var ts; } function getDeclaredTypeOfTypeParameter(symbol) { var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(262144 /* TypeParameter */); - type.symbol = symbol; - links.declaredType = type; - } - return links.declaredType; + return links.declaredType || (links.declaredType = createTypeParameter(symbol)); } function getDeclaredTypeOfAlias(symbol) { var links = getSymbolLinks(symbol); - if (!links.declaredType) { - links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol)); - } - return links.declaredType; + return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol))); } function getDeclaredTypeOfSymbol(symbol) { return tryGetDeclaredTypeOfSymbol(symbol) || errorType; @@ -35919,9 +36140,9 @@ var ts; return type; } /** - * Indicates whether a type can be used as a late-bound name. + * Indicates whether a type can be used as a property name. */ - function isTypeUsableAsLateBoundName(type) { + function isTypeUsableAsPropertyName(type) { return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */); } /** @@ -35935,7 +36156,7 @@ var ts; function isLateBindableName(node) { return ts.isComputedPropertyName(node) && ts.isEntityNameExpression(node.expression) - && isTypeUsableAsLateBoundName(checkComputedPropertyName(node)); + && isTypeUsableAsPropertyName(checkComputedPropertyName(node)); } function isLateBoundName(name) { return name.charCodeAt(0) === 95 /* _ */ && @@ -35962,11 +36183,11 @@ var ts; return ts.isDynamicName(node) && !isLateBindableName(node); } /** - * Gets the symbolic name for a late-bound member from its type. + * Gets the symbolic name for a member from its type. */ - function getLateBoundNameFromType(type) { + function getPropertyNameFromType(type) { if (type.flags & 8192 /* UniqueESSymbol */) { - return "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol); + return type.escapedName; } if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) { return ts.escapeLeadingUnderscores("" + type.value); @@ -35979,7 +36200,7 @@ var ts; * members. */ function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { - ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 1024 /* Late */), "Expected a late-bound symbol."); + ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 2048 /* Late */), "Expected a late-bound symbol."); symbol.flags |= symbolFlags; getSymbolLinks(member.symbol).lateSymbol = symbol; if (!symbol.declarations) { @@ -36030,13 +36251,13 @@ var ts; // fall back to the early-bound name of this member. links.resolvedSymbol = decl.symbol; var type = checkComputedPropertyName(decl.name); - if (isTypeUsableAsLateBoundName(type)) { - var memberName = getLateBoundNameFromType(type); + if (isTypeUsableAsPropertyName(type)) { + var memberName = getPropertyNameFromType(type); var symbolFlags = decl.symbol.flags; // Get or add a late-bound symbol for the member. This allows us to merge late-bound accessor declarations. var lateSymbol = lateSymbols.get(memberName); if (!lateSymbol) - lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */)); + lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */)); // Report an error if a late-bound member has the same name as an early-bound member, // or if we have another early-bound symbol declaration with the same name and // conflicting flags. @@ -36045,10 +36266,10 @@ var ts; // If we have an existing early-bound member, combine its declarations so that we can // report an error at each declaration. var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; - var name_2 = ts.declarationNameToString(decl.name); - ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Duplicate_declaration_0, name_2); }); - error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_2); - lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */); + var name_3 = !(type.flags & 8192 /* UniqueESSymbol */) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(decl.name); + ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_3); }); + error(decl.name || decl, ts.Diagnostics.Duplicate_property_0, name_3); + lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */); } lateSymbol.nameType = type; addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); @@ -36224,8 +36445,8 @@ var ts; var tupleRestIndex_1 = restType.target.hasRestElement ? elementTypes.length - 1 : -1; var restParams = ts.map(elementTypes, function (t, i) { var name = getParameterNameAtPosition(sig, restIndex_1 + i); - var checkFlags = i === tupleRestIndex_1 ? 8192 /* RestParameter */ : - i >= minLength_1 ? 4096 /* OptionalParameter */ : 0; + var checkFlags = i === tupleRestIndex_1 ? 16384 /* RestParameter */ : + i >= minLength_1 ? 8192 /* OptionalParameter */ : 0; var symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags); symbol.type = i === tupleRestIndex_1 ? createArrayType(t) : t; return symbol; @@ -36298,7 +36519,13 @@ var ts; // type is the union of the constituent return types. function getUnionSignatures(signatureLists) { var result; + var indexWithLengthOverOne; for (var i = 0; i < signatureLists.length; i++) { + if (signatureLists[i].length === 0) + return ts.emptyArray; + if (signatureLists[i].length > 1) { + indexWithLengthOverOne = indexWithLengthOverOne === undefined ? i : -1; // -1 is a signal there are multiple overload sets + } for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) { var signature = _a[_i]; // Only process signatures with parameter lists that aren't already in the result list @@ -36323,8 +36550,82 @@ var ts; } } } + if (!ts.length(result) && indexWithLengthOverOne !== -1) { + // No sufficiently similar signature existed to subsume all the other signatures in the union - time to see if we can make a single + // signature that handles all over them. We only do this when there are overloads in only one constituent. + // (Overloads are conditional in nature and having overloads in multiple constituents would necessitate making a power set of + // signatures from the type, whose ordering would be non-obvious) + var masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0]; + var results = masterList.slice(); + var _loop_5 = function (signatures) { + if (signatures !== masterList) { + var signature_1 = signatures[0]; + ts.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); + results = signature_1.typeParameters && ts.some(results, function (s) { return !!s.typeParameters; }) ? undefined : ts.map(results, function (sig) { return combineSignaturesOfUnionMembers(sig, signature_1); }); + if (!results) { + return "break"; + } + } + }; + for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) { + var signatures = signatureLists_1[_b]; + var state_2 = _loop_5(signatures); + if (state_2 === "break") + break; + } + result = results; + } return result || ts.emptyArray; } + function combineUnionThisParam(left, right) { + if (!left || !right) { + return left || right; + } + // A signature `this` type might be a read or a write position... It's very possible that it should be invariant + // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be + // permissive when calling, for now, we'll union the `this` types just like the overlapping-union-signature check does + var thisType = getUnionType([getTypeOfSymbol(left), getTypeOfSymbol(right)], 2 /* Subtype */); + return createSymbolWithType(left, thisType); + } + function combineUnionParameters(left, right) { + var longest = getParameterCount(left) >= getParameterCount(right) ? left : right; + var shorter = longest === left ? right : left; + var longestCount = getParameterCount(longest); + var eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right)); + var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (var i = 0; i < longestCount; i++) { + var longestParamType = tryGetTypeAtPosition(longest, i); + var shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType; + var unionParamType = getIntersectionType([longestParamType, shorterParamType]); + var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1); + var isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter); + var leftName = getParameterNameAtPosition(left, i); + var rightName = getParameterNameAtPosition(right, i); + var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), leftName === rightName ? leftName : "arg" + i); + paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i] = paramSymbol; + } + if (needsExtraRestElement) { + var restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args"); + restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfUnionMembers(left, right) { + var declaration = left.declaration; + var params = combineUnionParameters(left, right); + var thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter); + var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + var hasRestParam = left.hasRestParameter || right.hasRestParameter; + var hasLiteralTypes = left.hasLiteralTypes || right.hasLiteralTypes; + var result = createSignature(declaration, left.typeParameters || right.typeParameters, thisParam, params, + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, minArgCount, hasRestParam, hasLiteralTypes); + result.unionSignatures = ts.concatenate(left.unionSignatures || [left], [right]); + return result; + } function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; @@ -36342,7 +36643,7 @@ var ts; function resolveUnionTypeMembers(type) { // The members and properties collections are empty for union types. To get all properties of a union // type use getPropertiesOfType (only the language service uses this). - var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 0 /* Call */); })); + var callSignatures = getUnionSignatures(ts.map(type.types, function (t) { return t === globalFunctionType ? [unknownSignature] : getSignaturesOfType(t, 0 /* Call */); })); var constructSignatures = getUnionSignatures(ts.map(type.types, function (t) { return getSignaturesOfType(t, 1 /* Construct */); })); var stringIndexInfo = getUnionIndexInfo(type.types, 0 /* String */); var numberIndexInfo = getUnionIndexInfo(type.types, 1 /* Number */); @@ -36378,7 +36679,7 @@ var ts; var numberIndexInfo; var types = type.types; var mixinCount = ts.countWhere(types, isMixinConstructorType); - var _loop_5 = function (i) { + var _loop_6 = function (i) { var t = type.types[i]; // When an intersection type contains mixin constructor types, the construct signatures from // those types are discarded and their return types are mixed into the return types of all @@ -36401,7 +36702,7 @@ var ts; numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1 /* Number */)); }; for (var i = 0; i < types.length; i++) { - _loop_5(i); + _loop_6(i); } setStructuredTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); } @@ -36477,7 +36778,7 @@ var ts; var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { var prop = _a[_i]; - var checkFlags = 2048 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var checkFlags = 4096 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); inferredProp.declarations = prop.declarations; inferredProp.nameType = prop.nameType; @@ -36488,6 +36789,37 @@ var ts; } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); } + // Return the lower bound of the key type in a mapped type. Intuitively, the lower + // bound includes those keys that are known to always be present, for example because + // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). + function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } + if (type.flags & 4194304 /* Index */) { + return getIndexType(getApparentType(type.type)); + } + if (type.flags & 16777216 /* Conditional */) { + return getLowerBoundOfConditionalType(type); + } + if (type.flags & 1048576 /* Union */) { + return getUnionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); + } + if (type.flags & 2097152 /* Intersection */) { + return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); + } + return neverType; + } + function getLowerBoundOfConditionalType(type) { + if (type.root.isDistributive) { + var constraint = getLowerBoundOfKeyType(type.checkType); + if (constraint !== type.checkType) { + var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + } + } + return type; + } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -36517,10 +36849,7 @@ var ts; } } else { - // If the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. - // Then iterate over the constituents of the key type. - var iterationType = constraintType.flags & 4194304 /* Index */ ? getIndexType(getApparentType(constraintType.type)) : constraintType; - forEachType(iterationType, addMemberForKeyType); + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); function addMemberForKeyType(t) { @@ -36531,8 +36860,8 @@ var ts; var propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (t.flags & 8576 /* StringOrNumberLiteralOrUnique */) { - var propName = getLateBoundNameFromType(t); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); @@ -36702,9 +37031,10 @@ var ts; function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) { var list = obj.properties; return list.some(function (property) { - var name = property.name && ts.getTextOfPropertyName(property.name); + var nameType = property.name && getLiteralTypeFromPropertyName(property.name); + var name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; var expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name); - return !!expected && typeIsLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); + return !!expected && isLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); }); } function getAllPossiblePropertiesOfTypes(types) { @@ -36768,7 +37098,7 @@ var ts; if (type.root.isDistributive) { var simplified = getSimplifiedType(type.checkType); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; - if (constraint) { + if (constraint && constraint !== type.checkType) { var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); if (!(instantiated.flags & 131072 /* Never */)) { @@ -37013,10 +37343,10 @@ var ts; commonFlags &= prop.flags; props = ts.appendIfUnique(props, prop); checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | - (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 64 /* ContainsPublic */ : 0) | - (modifiers & 16 /* Protected */ ? 128 /* ContainsProtected */ : 0) | - (modifiers & 8 /* Private */ ? 256 /* ContainsPrivate */ : 0) | - (modifiers & 32 /* Static */ ? 512 /* ContainsStatic */ : 0); + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 128 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 256 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 512 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 1024 /* ContainsStatic */ : 0); if (!isPrototypeProperty(prop)) { syntheticFlag = 2 /* SyntheticProperty */; } @@ -37040,39 +37370,42 @@ var ts; return props[0]; } var declarations; - var commonType; + var firstType; var nameType; var propTypes = []; - var first = true; - var commonValueDeclaration; + var firstValueDeclaration; var hasNonUniformValueDeclaration = false; for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { var prop = props_1[_b]; - if (!commonValueDeclaration) { - commonValueDeclaration = prop.valueDeclaration; + if (!firstValueDeclaration) { + firstValueDeclaration = prop.valueDeclaration; } - else if (prop.valueDeclaration !== commonValueDeclaration) { + else if (prop.valueDeclaration !== firstValueDeclaration) { hasNonUniformValueDeclaration = true; } declarations = ts.addRange(declarations, prop.declarations); var type = getTypeOfSymbol(prop); - if (first) { - commonType = type; + if (!firstType) { + firstType = type; nameType = prop.nameType; - first = false; } - else { - if (type !== commonType) { - checkFlags |= 32 /* HasNonUniformType */; - } + else if (type !== firstType) { + checkFlags |= 32 /* HasNonUniformType */; + } + if (isLiteralType(type)) { + checkFlags |= 64 /* HasLiteralType */; } propTypes.push(type); } ts.addRange(propTypes, indexTypes); var result = createSymbol(4 /* Property */ | commonFlags, name, syntheticFlag | checkFlags); result.containingType = containingType; - if (!hasNonUniformValueDeclaration && commonValueDeclaration) { - result.valueDeclaration = commonValueDeclaration; + if (!hasNonUniformValueDeclaration && firstValueDeclaration) { + result.valueDeclaration = firstValueDeclaration; + // Inherit information about parent type. + if (firstValueDeclaration.symbol.parent) { + result.parent = firstValueDeclaration.symbol.parent; + } } result.declarations = declarations; result.nameType = nameType; @@ -37272,21 +37605,17 @@ var ts; var numTypeArguments = ts.length(typeArguments); if (isJavaScriptImplicitAny || (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters)) { var result = typeArguments ? typeArguments.slice() : []; - // Map an unsatisfied type parameter with a default type. - // If a type parameter does not have a default type, or if the default type - // is a forward reference, the empty object type is used. - var baseDefaultType_1 = getDefaultTypeArgumentType(isJavaScriptImplicitAny); - var circularityMapper = createTypeMapper(typeParameters, ts.map(typeParameters, function () { return baseDefaultType_1; })); + // Map invalid forward references in default types to the error type for (var i = numTypeArguments; i < numTypeParameters; i++) { - result[i] = instantiateType(getConstraintFromTypeParameter(typeParameters[i]) || baseDefaultType_1, circularityMapper); + result[i] = errorType; } + var baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); for (var i = numTypeArguments; i < numTypeParameters; i++) { - var mapper = createTypeMapper(typeParameters, result); var defaultType = getDefaultFromTypeParameter(typeParameters[i]); if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) { defaultType = anyType; } - result[i] = defaultType ? instantiateType(defaultType, mapper) : baseDefaultType_1; + result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result)) : baseDefaultType; } result.length = typeParameters.length; return result; @@ -37375,7 +37704,7 @@ var ts; var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); - var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 8192 /* RestParameter */); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 16384 /* RestParameter */); syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType; if (lastParamVariadicType) { // Replace the last parameter with a rest parameter. @@ -37935,21 +38264,16 @@ var ts; * the type of this reference is just the type of the value we resolved to. */ function getJSDocTypeReference(node, symbol, typeArguments) { - if (!pushTypeResolution(symbol, 6 /* JSDocTypeReference */)) { - return errorType; - } - var assignedType = getAssignedClassType(symbol); - var valueType = getTypeOfSymbol(symbol); - var referenceType = valueType.symbol && valueType.symbol !== symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); - if (!popTypeResolution()) { - getSymbolLinks(symbol).resolvedJSDocType = errorType; - error(node, ts.Diagnostics.JSDoc_type_0_circularly_references_itself, symbolToString(symbol)); - return errorType; - } - if (referenceType || assignedType) { - // TODO: GH#18217 (should the `|| assignedType` be at a lower precedence?) - var type = (referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType); - return getSymbolLinks(symbol).resolvedJSDocType = type; + // In the case of an assignment of a function expression (binary expressions, variable declarations, etc.), we will get the + // correct instance type for the symbol on the LHS by finding the type for RHS. For example if we want to get the type of the symbol `foo`: + // var foo = function() {} + // We will find the static type of the assigned anonymous function. + var staticType = getTypeOfSymbol(symbol); + var instanceType = staticType.symbol && + staticType.symbol !== symbol && // Make sure this is an assignment like expression by checking that symbol -> type -> symbol doesn't roundtrips. + getTypeReferenceTypeWorker(node, staticType.symbol, typeArguments); // Get the instance type of the RHS symbol. + if (instanceType) { + return getSymbolLinks(symbol).resolvedJSDocType = instanceType; } } function getTypeReferenceTypeWorker(node, symbol, typeArguments) { @@ -37967,8 +38291,11 @@ var ts; } if (symbol.flags & 16 /* Function */ && isJSDocTypeReference(node) && - (symbol.members || ts.getJSDocClassTag(symbol.valueDeclaration))) { - return getInferredClassType(symbol); + isJSConstructor(symbol.valueDeclaration)) { + var resolved = resolveStructuredTypeMembers(getTypeOfSymbol(symbol)); + if (resolved.callSignatures.length === 1) { + return getReturnTypeOfSignature(resolved.callSignatures[0]); + } } } function getSubstitutionType(typeVariable, substitute) { @@ -38246,7 +38573,7 @@ var ts; if (arity) { typeParameters = new Array(arity); for (var i = 0; i < arity; i++) { - var typeParameter = typeParameters[i] = createType(262144 /* TypeParameter */); + var typeParameter = typeParameters[i] = createTypeParameter(); if (i < maxLength) { var property = createSymbol(4 /* Property */ | (i >= minLength ? 16777216 /* Optional */ : 0), "" + i); property.type = typeParameter; @@ -38268,7 +38595,7 @@ var ts; type.instantiations.set(getTypeListId(type.typeParameters), type); type.target = type; type.typeArguments = type.typeParameters; - type.thisType = createType(262144 /* TypeParameter */); + type.thisType = createTypeParameter(); type.thisType.isThisType = true; type.thisType.constraint = type; type.declaredProperties = properties; @@ -38865,14 +39192,14 @@ var ts; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol, missingType) { var accessExpression = accessNode && accessNode.kind === 190 /* ElementAccessExpression */ ? accessNode : undefined; - var propName = isTypeUsableAsLateBoundName(indexType) - ? getLateBoundNameFromType(indexType) - : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) - ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) - : accessNode && ts.isPropertyName(accessNode) + var propName = isTypeUsableAsPropertyName(indexType) ? + getPropertyNameFromType(indexType) : + accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? + ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : + accessNode && ts.isPropertyName(accessNode) ? // late bound names are handled in the first branch, so here we only need to handle normal names - ? ts.getPropertyNameForPropertyNameNode(accessNode) - : undefined; + ts.getPropertyNameForPropertyNameNode(accessNode) : + undefined; if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { @@ -38894,7 +39221,12 @@ var ts; if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) { if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; })) { var indexNode = getIndexNodeForAccessExpression(accessNode); - error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); + if (isTupleType(objectType)) { + error(indexNode, ts.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType), getTypeReferenceArity(objectType), ts.unescapeLeadingUnderscores(propName)); + } + else { + error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); + } } return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } @@ -39019,24 +39351,14 @@ var ts; // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2] // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we - // construct the type Box. We do not further simplify the result because mapped types can be recursive - // and we might never terminate. + // construct the type Box. if (isGenericMappedType(objectType)) { - return type.simplified = substituteIndexedMappedType(objectType, type); - } - if (objectType.flags & 262144 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(objectType); - if (constraint && isGenericMappedType(constraint)) { - return type.simplified = substituteIndexedMappedType(constraint, type); - } + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = combineTypeMappers(objectType.mapper, mapper); + return type.simplified = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType); } return type.simplified = type; } - function substituteIndexedMappedType(objectType, type) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var templateMapper = combineTypeMappers(objectType.mapper, mapper); - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); - } function getIndexedAccessType(objectType, indexType, accessNode, missingType) { if (missingType === void 0) { missingType = accessNode ? errorType : unknownType; } if (objectType === wildcardType || indexType === wildcardType) { @@ -39124,14 +39446,11 @@ var ts; if (checkType === wildcardType || extendsType === wildcardType) { return wildcardType; } - // If this is a distributive conditional type and the check type is generic we need to defer - // resolution of the conditional type such that a later instantiation will properly distribute - // over union types. - var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 63176704 /* Instantiable */); + var checkTypeInstantiable = maybeTypeOfKind(checkType, 63176704 /* Instantiable */ | 134217728 /* GenericMappedType */); var combinedMapper; if (root.inferTypeParameters) { var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */); - if (!isDeferred) { + if (!checkTypeInstantiable) { // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. @@ -39139,28 +39458,30 @@ var ts; } combinedMapper = combineTypeMappers(mapper, context); } - if (!isDeferred) { - if (extendsType.flags & 3 /* AnyOrUnknown */) { + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // We attempt to resolve the conditional type only when the check and extends types are non-generic + if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, 63176704 /* Instantiable */ | 134217728 /* GenericMappedType */)) { + if (inferredExtendsType.flags & 3 /* AnyOrUnknown */) { return instantiateType(root.trueType, mapper); } // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } - // Instantiate the extends type including inferences for 'infer T' type parameters - var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; // Return falseType for a definitely false extends check. We check an instantations of the two // types with type parameters mapped to the wildcard type, the most permissive instantiations // possible (the wildcard type is assignable to and from all types). If those are not related, // then no instatiations will be and we can just return the false branch type. - if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(inferredExtendsType))) { + if (!isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType))) { return instantiateType(root.falseType, mapper); } - // Return trueType for a definitely true extends check. The definitely assignable relation excludes - // type variable constraints from consideration. Without the definitely assignable relation, the type + // Return trueType for a definitely true extends check. We check instantiations of the two + // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter + // that has no constraint. This ensures that, for example, the type // type Foo = T extends { x: string } ? string : number - // would immediately resolve to 'string' instead of being deferred. - if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + // doesn't immediately resolve to 'string' instead of being deferred. + if (isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { return instantiateType(root.trueType, combinedMapper || mapper); } } @@ -39516,6 +39837,7 @@ var ts; function createUniqueESSymbolType(symbol) { var type = createType(8192 /* UniqueESSymbol */); type.symbol = symbol; + type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol); return type; } function getESSymbolLikeTypeForNode(node) { @@ -39709,12 +40031,19 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } - function wildcardMapper(type) { + function permissiveMapper(type) { return type.flags & 262144 /* TypeParameter */ ? wildcardType : type; } + function getRestrictiveTypeParameter(tp) { + return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), + tp.restrictiveInstantiation.constraint = unknownType, + tp.restrictiveInstantiation); + } + function restrictiveMapper(type) { + return type.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(type) : type; + } function cloneTypeParameter(typeParameter) { - var result = createType(262144 /* TypeParameter */); - result.symbol = typeParameter.symbol; + var result = createTypeParameter(typeParameter.symbol); result.target = typeParameter; return result; } @@ -39773,7 +40102,7 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (1024 /* Late */ | 4096 /* OptionalParameter */ | 8192 /* RestParameter */)); + var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (2048 /* Late */ | 8192 /* OptionalParameter */ | 16384 /* RestParameter */)); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -40045,9 +40374,13 @@ var ts; } return type; } - function getWildcardInstantiation(type) { + function getPermissiveInstantiation(type) { return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : - type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper)); + } + function getRestrictiveInstantiation(type) { + return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : + type.restrictiveInstantiation || (type.restrictiveInstantiation = instantiateType(type, restrictiveMapper)); } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); @@ -40111,8 +40444,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - var body = node.body; - return body.kind === 218 /* Block */ ? false : isContextSensitive(body); + return !!node.body && node.body.kind !== 218 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -40229,7 +40561,7 @@ var ts; case 187 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation); case 268 /* JsxAttributes */: - return elaborateJsxAttributes(node, source, target, relation); + return elaborateJsxComponents(node, source, target, relation); case 197 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation); } @@ -40320,7 +40652,7 @@ var ts; } if (resultObj.error) { var reportedDiag = resultObj.error; - var propertyName = isTypeUsableAsLateBoundName(nameType) ? getLateBoundNameFromType(nameType) : undefined; + var propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined; var targetProp = propertyName !== undefined ? getPropertyOfType(target, propertyName) : undefined; var issuedElaboration = false; if (!targetProp) { @@ -40370,8 +40702,117 @@ var ts; } }); } - function elaborateJsxAttributes(node, source, target, relation) { - return elaborateElementwise(generateJsxAttributes(node), source, target, relation); + function generateJsxChildren(node, getInvalidTextDiagnostic) { + var memberOffset, i, child, nameType, elem; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!ts.length(node.children)) + return [2 /*return*/]; + memberOffset = 0; + i = 0; + _a.label = 1; + case 1: + if (!(i < node.children.length)) return [3 /*break*/, 5]; + child = node.children[i]; + nameType = getLiteralType(i - memberOffset); + elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic); + if (!elem) return [3 /*break*/, 3]; + return [4 /*yield*/, elem]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + memberOffset++; + _a.label = 4; + case 4: + i++; + return [3 /*break*/, 1]; + case 5: return [2 /*return*/]; + } + }); + } + function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { + switch (child.kind) { + case 270 /* JsxExpression */: + // child is of the type of the expression + return { errorNode: child, innerExpression: child.expression, nameType: nameType }; + case 11 /* JsxText */: + if (child.containsOnlyWhiteSpaces) { + break; // Whitespace only jsx text isn't real jsx text + } + // child is a string + return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; + case 260 /* JsxElement */: + case 261 /* JsxSelfClosingElement */: + case 264 /* JsxFragment */: + // child is of type JSX.Element + return { errorNode: child, innerExpression: child, nameType: nameType }; + default: + return ts.Debug.assertNever(child, "Found invalid jsx child"); + } + } + function elaborateJsxComponents(node, source, target, relation) { + var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation); + var invalidTextDiagnostic; + if (ts.isJsxOpeningElement(node.parent) && ts.isJsxElement(node.parent.parent)) { + var containingElement = node.parent.parent; + var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); + var childrenNameType = getLiteralType(childrenPropName); + var childrenTargetType = getIndexedAccessType(target, childrenNameType); + var validChildren = ts.filter(containingElement.children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyWhiteSpaces; }); + if (!ts.length(validChildren)) { + return result; + } + var moreThanOneRealChildren = ts.length(validChildren) > 1; + var arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType); + var nonArrayLikeTargetParts = filterType(childrenTargetType, function (t) { return !isArrayOrTupleLikeType(t); }); + if (moreThanOneRealChildren) { + if (arrayLikeTargetParts !== neverType) { + var realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */)); + result = elaborateElementwise(generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic), realSource, arrayLikeTargetParts, relation) || result; + } + else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + // arity mismatch + result = true; + error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType)); + } + } + else { + if (nonArrayLikeTargetParts !== neverType) { + var child = validChildren[0]; + var elem_1 = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic); + if (elem_1) { + result = elaborateElementwise((function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, elem_1]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); })(), source, target, relation) || result; + } + } + else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + // arity mismatch + result = true; + error(containingElement.openingElement.tagName, ts.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType)); + } + } + } + return result; + function getInvalidTextualChildDiagnostic() { + if (!invalidTextDiagnostic) { + var tagNameText = ts.getTextOfNode(node.parent.tagName); + var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); + var childrenTargetType = getIndexedAccessType(target, getLiteralType(childrenPropName)); + var diagnostic = ts.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2; + invalidTextDiagnostic = __assign({}, diagnostic, { key: "!!ALREADY FORMATTED!!", message: ts.formatMessage(/*_dummy*/ undefined, diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) }); + } + return invalidTextDiagnostic; + } } function generateLimitedTupleElements(node, target) { var len, i, elem, nameType; @@ -40624,7 +41065,7 @@ var ts; !t.numberIndexInfo; } function isEmptyObjectType(type) { - return type.flags & 524288 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + return type.flags & 524288 /* Object */ ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) : type.flags & 67108864 /* NonPrimitive */ ? true : type.flags & 1048576 /* Union */ ? ts.some(type.types, isEmptyObjectType) : type.flags & 2097152 /* Intersection */ ? ts.every(type.types, isEmptyObjectType) : @@ -40707,9 +41148,7 @@ var ts; return true; if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */) return true; - if (s & 8192 /* UniqueESSymbol */ || t & 8192 /* UniqueESSymbol */) - return false; - if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -40879,7 +41318,7 @@ var ts; target = target.regularType; } if (source.flags & 33554432 /* Substitution */) { - source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute; + source = source.substitute; } if (target.flags & 33554432 /* Substitution */) { target = target.typeVariable; @@ -41054,9 +41493,9 @@ var ts; if (!noImplicitAny && ts.getObjectFlags(target) & 16384 /* JSLiteral */) { return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny } - if (maybeTypeOfKind(target, 524288 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { + if (isExcessPropertyCheckTarget(target)) { var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); - if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && + if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } @@ -41064,9 +41503,12 @@ var ts; // check excess properties against discriminant type only, not the entire union return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } - var _loop_6 = function (prop) { + var _loop_7 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { + // Report error in terms of object types in the target as those are the only ones + // we check in isKnownProperty. + var errorTarget = filterType(target, isExcessPropertyCheckTarget); // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. @@ -41076,7 +41518,7 @@ var ts; // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. // However, using an object-literal error message will be very confusing to the users so we give different a message. // TODO: Spelling suggestions for excess jsx attributes (needs new diagnostic messages) - reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(errorTarget)); } else { // use the property's value declaration if the property is assigned inside the literal itself @@ -41088,14 +41530,14 @@ var ts; errorNode = propDeclaration; var name = propDeclaration.name; if (ts.isIdentifier(name)) { - suggestion = getSuggestionForNonexistentProperty(name, target); + suggestion = getSuggestionForNonexistentProperty(name, errorTarget); } } if (suggestion !== undefined) { - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(target), suggestion); + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString(prop), typeToString(errorTarget), suggestion); } else { - reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); + reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); } } } @@ -41104,9 +41546,9 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_2 = _loop_6(prop); - if (typeof state_2 === "object") - return state_2.value; + var state_3 = _loop_7(prop); + if (typeof state_3 === "object") + return state_3.value; } } return false; @@ -41191,16 +41633,16 @@ var ts; matchingCount = Infinity; } else if (overlap.flags & 1048576 /* Union */) { - // Some subset overlap if we have only string literals. + // We only want to account for literal types otherwise. // If we have a union of index types, it seems likely that we // needed to elaborate between two generic mapped types anyway. - var len = ts.length(overlap.types); + var len = ts.length(ts.filter(overlap.types, isUnitType)); if (len >= matchingCount) { bestMatch = target_1; matchingCount = len; } } - else if (!(overlap.flags & 131072 /* Never */) && 1 >= matchingCount) { + else if (isUnitType(overlap) && 1 >= matchingCount) { bestMatch = target_1; matchingCount = 1; } @@ -41380,30 +41822,27 @@ var ts; } return result; } - function getConstraintForRelation(type) { - return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); - } function structuredTypeRelatedTo(source, target, reportErrors, isIntersectionConstituent) { var flags = source.flags & target.flags; if (relation === identityRelation && !(flags & 524288 /* Object */)) { if (flags & 4194304 /* Index */) { return isRelatedTo(source.type, target.type, /*reportErrors*/ false); } - var result_2 = 0 /* False */; + var result_3 = 0 /* False */; if (flags & 8388608 /* IndexedAccess */) { - if (result_2 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { - return result_2; + if (result_3 = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result_3; } } } if (flags & 16777216 /* Conditional */) { if (source.root.isDistributive === target.root.isDistributive) { - if (result_2 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { - if (result_2 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { - return result_2; + if (result_3 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { + return result_3; } } } @@ -41452,24 +41891,23 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // simplified form of T or, if T doesn't simplify, the constraint of T. - if (relation !== definitelyAssignableRelation) { - var simplified = getSimplifiedType(target.type); - var constraint = simplified !== target.type ? simplified : getConstraintOfType(target.type); - if (constraint) { - // We require Ternary.True here such that circular constraints don't cause - // false positives. For example, given 'T extends { [K in keyof T]: string }', - // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when - // related to other types. - if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) { - return -1 /* True */; - } + var simplified = getSimplifiedType(target.type); + var constraint = simplified !== target.type ? simplified : getConstraintOfType(target.type); + if (constraint) { + // We require Ternary.True here such that circular constraints don't cause + // false positives. For example, given 'T extends { [K in keyof T]: string }', + // 'keyof T' has itself as its constraint and produces a Ternary.Maybe when + // related to other types. + if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1 /* True */) { + return -1 /* True */; } } } else if (target.flags & 8388608 /* IndexedAccess */) { // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, // where C is the base constraint of T[K] - if (relation !== identityRelation && !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) { + if (relation !== identityRelation && + !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) { var constraint = getBaseConstraintOfType(target); if (constraint && constraint !== target) { if (result = isRelatedTo(source, constraint, reportErrors)) { @@ -41510,8 +41948,8 @@ var ts; return result; } } - var constraint = getConstraintForRelation(source); - if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 3 /* AnyOrUnknown */)) { + var constraint = getConstraintOfType(source); + if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) { // A type variable with no constraint is not related to the non-primitive object type. if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) { errorInfo = saveErrorInfo; @@ -41551,7 +41989,7 @@ var ts; } } } - else if (relation !== definitelyAssignableRelation) { + else { var distributiveConstraint = getConstraintOfDistributiveConditionalType(source); if (distributiveConstraint) { if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) { @@ -41570,7 +42008,7 @@ var ts; } else { // An empty object type is related to any mapped type that includes a '?' modifier. - if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) { + if (relation !== subtypeRelation && isPartialMappedType(target) && isEmptyObjectType(source)) { return -1 /* True */; } if (isGenericMappedType(target)) { @@ -41582,9 +42020,6 @@ var ts; } return 0 /* False */; } - if (relation === definitelyAssignableRelation && isGenericMappedType(source)) { - return 0 /* False */; - } var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */); if (relation !== identityRelation) { source = getApparentType(source); @@ -41664,10 +42099,10 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_3; - if (result_3 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var result_4; + if (result_4 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - return result_3 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + return result_4 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -41677,10 +42112,10 @@ var ts; return propertiesIdenticalTo(source, target); } var requireOptionalProperties = relation === subtypeRelation && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source); - var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties); + var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false); if (unmatchedProperty) { if (reportErrors) { - var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties)); + var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false)); if (!headMessage || (headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) { suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it @@ -41756,7 +42191,7 @@ var ts; var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { var hasDifferingDeclarations = sourceProp.valueDeclaration !== targetProp.valueDeclaration; - if (ts.getCheckFlags(sourceProp) & 256 /* ContainsPrivate */ && hasDifferingDeclarations) { + if (ts.getCheckFlags(sourceProp) & 512 /* ContainsPrivate */ && hasDifferingDeclarations) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); } @@ -42432,6 +42867,9 @@ var ts; function isTupleLikeType(type) { return isTupleType(type) || !!getPropertyOfType(type, "0"); } + function isArrayOrTupleLikeType(type) { + return isArrayLikeType(type) || isTupleLikeType(type); + } function getTupleElementType(type, index) { var propType = getTypeOfPropertyOfType(type, "" + index); if (propType) { @@ -42721,6 +43159,9 @@ var ts; // union includes empty object types (e.g. reducing {} | string to just {}). return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } + if (type.flags & 2097152 /* Intersection */) { + return getIntersectionType(ts.sameMap(type.types, getWidenedType)); + } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); } @@ -42807,6 +43248,10 @@ var ts; break; case 186 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; + if (!noImplicitAny) { + // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. + return; + } break; case 289 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); @@ -43004,8 +43449,8 @@ var ts; inferTypes([inference], sourceType, templateType); return getTypeFromInference(inference); } - function getUnmatchedProperties(source, target, requireOptionalProperties) { - var properties, _i, properties_4, targetProp, sourceProp; + function getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { + var properties, _i, properties_4, targetProp, sourceProp, targetType, sourceType; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -43013,24 +43458,34 @@ var ts; _i = 0, properties_4 = properties; _a.label = 1; case 1: - if (!(_i < properties_4.length)) return [3 /*break*/, 4]; + if (!(_i < properties_4.length)) return [3 /*break*/, 6]; targetProp = properties_4[_i]; - if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */))) return [3 /*break*/, 3]; + if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */))) return [3 /*break*/, 5]; sourceProp = getPropertyOfType(source, targetProp.escapedName); if (!!sourceProp) return [3 /*break*/, 3]; return [4 /*yield*/, targetProp]; case 2: _a.sent(); - _a.label = 3; + return [3 /*break*/, 5]; case 3: + if (!matchDiscriminantProperties) return [3 /*break*/, 5]; + targetType = getTypeOfSymbol(targetProp); + if (!(targetType.flags & 109440 /* Unit */)) return [3 /*break*/, 5]; + sourceType = getTypeOfSymbol(sourceProp); + if (!!(sourceType.flags & 1 /* Any */ || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) return [3 /*break*/, 5]; + return [4 /*yield*/, targetProp]; + case 4: + _a.sent(); + _a.label = 5; + case 5: _i++; return [3 /*break*/, 1]; - case 4: return [2 /*return*/]; + case 6: return [2 /*return*/]; } }); } - function getUnmatchedProperty(source, target, requireOptionalProperties) { - return getUnmatchedProperties(source, target, requireOptionalProperties).next().value; + function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { + return getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next().value; } function tupleTypesDefinitelyUnrelated(source, target) { return target.target.minLength > source.target.minLength || @@ -43040,7 +43495,8 @@ var ts; // Two tuple types with incompatible arities are definitely unrelated. // Two object types that each have a property that is unmatched in the other are definitely unrelated. return isTupleType(source) && isTupleType(target) && tupleTypesDefinitelyUnrelated(source, target) || - !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false) && !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false); + !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true) && + !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true); } function getTypeFromInference(inference) { return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : @@ -43356,7 +43812,11 @@ var ts; priority |= 4 /* MappedTypeConstraint */; inferFromTypes(getIndexType(source), constraintType); priority = savePriority; - inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); + var valueTypes = ts.compact([ + getIndexTypeOfType(source, 0 /* String */), + getIndexTypeOfType(source, 1 /* Number */) + ].concat(ts.map(getPropertiesOfType(source), getTypeOfSymbol))); + inferFromTypes(getUnionType(valueTypes), getTemplateTypeFromMappedType(target)); return true; } return false; @@ -43645,48 +44105,31 @@ var ts; // occurring in an apparent type position with '@' because the control flow type // of such nodes may be based on the apparent type instead of the declared type. function getFlowCacheKey(node) { - if (node.kind === 72 /* Identifier */) { - var symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; - } - if (node.kind === 100 /* ThisKeyword */) { - return "0"; - } - if (node.kind === 189 /* PropertyAccessExpression */) { - var key = getFlowCacheKey(node.expression); - return key && key + "." + ts.idText(node.name); - } - if (node.kind === 186 /* BindingElement */) { - var container = node.parent.parent; - var key = container.kind === 186 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); - var text = getBindingElementNameText(node); - var result = key && text && (key + "." + text); - return result; + switch (node.kind) { + case 72 /* Identifier */: + var symbol = getResolvedSymbol(node); + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + case 100 /* ThisKeyword */: + return "0"; + case 213 /* NonNullExpression */: + case 195 /* ParenthesizedExpression */: + return getFlowCacheKey(node.expression); + case 189 /* PropertyAccessExpression */: + case 190 /* ElementAccessExpression */: + var propName = getAccessedPropertyName(node); + if (propName !== undefined) { + var key = getFlowCacheKey(node.expression); + return key && key + "." + propName; + } } return undefined; } - function getBindingElementNameText(element) { - var parent = element.parent; - if (parent.kind === 184 /* ObjectBindingPattern */) { - var name = element.propertyName || element.name; - switch (name.kind) { - case 72 /* Identifier */: - return ts.idText(name); - case 149 /* ComputedPropertyName */: - return ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined; - case 10 /* StringLiteral */: - case 8 /* NumericLiteral */: - return name.text; - default: - // Per types, array and object binding patterns remain, however they should never be present if propertyName is not defined - ts.Debug.fail("Unexpected name kind for binding element name"); - } - } - else { - return "" + parent.elements.indexOf(element); - } - } function isMatchingReference(source, target) { + switch (target.kind) { + case 195 /* ParenthesizedExpression */: + case 213 /* NonNullExpression */: + return isMatchingReference(source, target.expression); + } switch (source.kind) { case 72 /* Identifier */: return target.kind === 72 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || @@ -43696,34 +44139,24 @@ var ts; return target.kind === 100 /* ThisKeyword */; case 98 /* SuperKeyword */: return target.kind === 98 /* SuperKeyword */; + case 213 /* NonNullExpression */: + case 195 /* ParenthesizedExpression */: + return isMatchingReference(source.expression, target); case 189 /* PropertyAccessExpression */: case 190 /* ElementAccessExpression */: - return (ts.isPropertyAccessExpression(target) || ts.isElementAccessExpression(target)) && + return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); - case 186 /* BindingElement */: - if (target.kind !== 189 /* PropertyAccessExpression */) - return false; - var t = target; - if (t.name.escapedText !== getBindingElementNameText(source)) - return false; - if (source.parent.parent.kind === 186 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { - return true; - } - if (source.parent.parent.kind === 237 /* VariableDeclaration */) { - var maybeId = source.parent.parent.initializer; - return !!maybeId && isMatchingReference(maybeId, t.expression); - } } return false; } function getAccessedPropertyName(access) { - return ts.isPropertyAccessExpression(access) ? access.name.escapedText : + return access.kind === 189 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringLiteral(access.argumentExpression) || ts.isNumericLiteral(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } function containsMatchingReference(source, target) { - while (source.kind === 189 /* PropertyAccessExpression */) { + while (ts.isAccessExpression(source)) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -43736,42 +44169,37 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 189 /* PropertyAccessExpression */ && + var name; + return ts.isAccessExpression(target) && containsMatchingReference(source, target.expression) && - isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); + (name = getAccessedPropertyName(target)) !== undefined && + isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), name); } function getDeclaredTypeOfReference(expr) { if (expr.kind === 72 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 189 /* PropertyAccessExpression */) { + if (ts.isAccessExpression(expr)) { var type = getDeclaredTypeOfReference(expr.expression); - return type && getTypeOfPropertyOfType(type, expr.name.escapedText); + if (type) { + var propName = getAccessedPropertyName(expr); + return propName !== undefined ? getTypeOfPropertyOfType(type, propName) : undefined; + } } return undefined; } function isDiscriminantType(type) { - if (type.flags & 1048576 /* Union */) { - if (type.flags & (16 /* Boolean */ | 1024 /* EnumLiteral */)) { - return true; - } - var combined = 0; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - combined |= t.flags; - } - if (combined & 109440 /* Unit */ && !(combined & 63176704 /* Instantiable */)) { - return true; - } - } - return false; + return !!(type.flags & 1048576 /* Union */ && + (type.flags & (16 /* Boolean */ | 1024 /* EnumLiteral */) || !isGenericIndexType(type))); } function isDiscriminantProperty(type, name) { if (type && type.flags & 1048576 /* Union */) { var prop = getUnionOrIntersectionProperty(type, name); if (prop && ts.getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { - prop.isDiscriminantProperty = !!(prop.checkFlags & 32 /* HasNonUniformType */) && isDiscriminantType(getTypeOfSymbol(prop)); + prop.isDiscriminantProperty = + (prop.checkFlags & 96 /* Discriminant */) === 96 /* Discriminant */ && + isDiscriminantType(getTypeOfSymbol(prop)); } return !!prop.isDiscriminantProperty; } @@ -43945,7 +44373,10 @@ var ts; return type; } function getTypeOfDestructuredProperty(type, name) { - var text = ts.getTextOfPropertyName(name); + var nameType = getLiteralTypeFromPropertyName(name); + if (!isTypeUsableAsPropertyName(nameType)) + return errorType; + var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */) || @@ -44503,9 +44934,6 @@ var ts; } function getTypeAtSwitchClause(flow) { var expr = flow.switchStatement.expression; - if (containsMatchingReferenceDiscriminant(reference, expr)) { - return declaredType; - } var flowType = getTypeAtFlowNode(flow.antecedent); var type = getTypeFromFlowType(flowType); if (isMatchingReference(reference, expr)) { @@ -44517,6 +44945,9 @@ var ts; else if (expr.kind === 199 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } + else if (containsMatchingReferenceDiscriminant(reference, expr)) { + type = declaredType; + } return createFlowType(type, isIncomplete(flowType)); } function getTypeAtFlowBranchLabel(flow) { @@ -44630,25 +45061,23 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - if (!(computedType.flags & 1048576 /* Union */) || - expr.kind !== 189 /* PropertyAccessExpression */ && expr.kind !== 190 /* ElementAccessExpression */) { + if (!(computedType.flags & 1048576 /* Union */) || !ts.isAccessExpression(expr)) { return false; } - var access = expr; - var name = getAccessedPropertyName(access); - if (!name) { + var name = getAccessedPropertyName(expr); + if (name === undefined) { return false; } - return isMatchingReference(reference, access.expression) && isDiscriminantProperty(computedType, name); + return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, name); } function narrowTypeByDiscriminant(type, access, narrowType) { var propName = getAccessedPropertyName(access); - if (!propName) { + if (propName === undefined) { return type; } var propType = getTypeOfPropertyOfType(type, propName); var narrowedPropType = propType && narrowType(propType); - return propType === narrowedPropType ? type : filterType(type, function (t) { return isTypeComparableTo(getTypeOfPropertyOfType(t, propName), narrowedPropType); }); + return propType === narrowedPropType ? type : filterType(type, function (t) { return isTypeComparableTo(getTypeOfPropertyOrIndexSignature(t, propName), narrowedPropType); }); } function narrowTypeByTruthiness(type, expr, assumeTrue) { if (isMatchingReference(reference, expr)) { @@ -44993,9 +45422,8 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 190 /* ElementAccessExpression */ || invokedExpression.kind === 189 /* PropertyAccessExpression */) { - var accessExpression = invokedExpression; - var possibleReference = ts.skipParentheses(accessExpression.expression); + if (ts.isAccessExpression(invokedExpression)) { + var possibleReference = ts.skipParentheses(invokedExpression.expression); if (isMatchingReference(reference, possibleReference)) { return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf); } @@ -45412,7 +45840,7 @@ var ts; } function checkThisBeforeSuper(node, container, diagnosticMessage) { var containingClassDecl = container.parent; - var baseTypeNode = ts.getEffectiveBaseTypeNode(containingClassDecl); + var baseTypeNode = ts.getClassExtendsHeritageElement(containingClassDecl); // If a containing class does not have extends clause or the class extends null // skip checking whether super statement is called before "this" accessing. if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { @@ -45512,7 +45940,7 @@ var ts; else if (isInJS && (container.kind === 196 /* FunctionExpression */ || container.kind === 239 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { - var classType = getJSClassType(container.symbol); + var classType = getJSClassType(getMergedSymbol(container.symbol)); if (classType) { return getFlowTypeOfReference(node, classType); } @@ -45733,7 +46161,7 @@ var ts; } // at this point the only legal case for parent is ClassLikeDeclaration var classLikeDeclaration = container.parent; - if (!ts.getEffectiveBaseTypeNode(classLikeDeclaration)) { + if (!ts.getClassExtendsHeritageElement(classLikeDeclaration)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); return errorType; } @@ -45890,6 +46318,31 @@ var ts; tryGetTypeAtPosition(contextualSignature, index); } } + function getContextualTypeForVariableLikeDeclaration(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + switch (declaration.kind) { + case 151 /* Parameter */: + return getContextuallyTypedParameterType(declaration); + case 186 /* BindingElement */: + return getContextualTypeForBindingElement(declaration); + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent + } + } + function getContextualTypeForBindingElement(declaration) { + var parentDeclaration = declaration.parent.parent; + var name = declaration.propertyName || declaration.name; + var parentType = getContextualTypeForVariableLikeDeclaration(parentDeclaration); + if (parentType && !ts.isBindingPattern(name) && !isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } + } + } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. // Otherwise, in a parameter declaration of a contextually typed function expression, @@ -45901,32 +46354,13 @@ var ts; function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (ts.hasInitializer(declaration) && node === declaration.initializer) { - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - return getTypeFromTypeNode(typeNode); + var result = getContextualTypeForVariableLikeDeclaration(declaration); + if (result) { + return result; } - if (declaration.kind === 151 /* Parameter */) { - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (ts.isBindingPattern(declaration.name)) { + if (ts.isBindingPattern(declaration.name)) { // This is less a contextual type and more an implied shape - in some cases, this may be undesirable return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false); } - if (ts.isBindingPattern(declaration.parent)) { - var parentDeclaration = declaration.parent.parent; - var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 186 /* BindingElement */) { - var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); - if (parentTypeNode && !ts.isBindingPattern(name)) { - var text = ts.getTextOfPropertyName(name); - if (text) { - return getTypeOfPropertyOfType(getTypeFromTypeNode(parentTypeNode), text); - } - } - } - } } return undefined; } @@ -46179,18 +46613,30 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } - function getContextualTypeForChildJsxExpression(node) { + function getContextualTypeForChildJsxExpression(node, child) { var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); - return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { + return undefined; + } + var childIndex = node.children.indexOf(child); + var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); + return childFieldType && mapType(childFieldType, function (t) { + if (isArrayLikeType(t)) { + return getIndexedAccessType(t, getLiteralType(childIndex)); + } + else { + return t; + } + }, /*noReductions*/ true); } function getContextualTypeForJsxExpression(node) { var exprParent = node.parent; return ts.isJsxAttributeLike(exprParent) ? getContextualType(node) : ts.isJsxElement(exprParent) - ? getContextualTypeForChildJsxExpression(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent, node) : undefined; } function getContextualTypeForJsxAttribute(attribute) { @@ -46357,6 +46803,27 @@ var ts; return propsType; } function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) { + if (sig.unionSignatures) { + // JSX Elements using the legacy `props`-field based lookup (eg, react class components) need to treat the `props` member as an input + // instead of an output position when resolving the signature. We need to go back to the input signatures of the composite signature, + // get the type of `props` on each return type individually, and then _intersect them_, rather than union them (as would normally occur + // for a union signature). It's an unfortunate quirk of looking in the output of the signature for the type we want to use for the input. + // The default behavior of `getTypeOfFirstParameterOfSignatureWithFallback` when no `props` member name is defined is much more sane. + var results = []; + for (var _i = 0, _a = sig.unionSignatures; _i < _a.length; _i++) { + var signature = _a[_i]; + var instance = getReturnTypeOfSignature(signature); + if (isTypeAny(instance)) { + return instance; + } + var propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); + if (!propType) { + return; + } + results.push(propType); + } + return getIntersectionType(results); + } var instanceType = getReturnTypeOfSignature(sig); return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); } @@ -46745,10 +47212,9 @@ var ts; } } typeFlags |= type.flags; - var nameType = computedNameType && computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */ ? - computedNameType : undefined; + var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined; var prop = nameType ? - createSymbol(4 /* Property */ | member.flags, getLateBoundNameFromType(nameType), 1024 /* Late */) : + createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), 2048 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName); if (nameType) { prop.nameType = nameType; @@ -47006,6 +47472,10 @@ var ts; childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : (getArrayLiteralTupleTypeIfApplicable(childrenTypes, childrenContextualType, /*hasRestElement*/ false) || createArrayType(getUnionType(childrenTypes))); + // Fake up a property declaration for the children + childrenPropSymbol.valueDeclaration = ts.createPropertySignature(/*modifiers*/ undefined, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName), /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined); + childrenPropSymbol.valueDeclaration.parent = attributes; + childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol; var childPropMap = ts.createSymbolTable(); childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, typeFlags, objectFlags); @@ -47348,7 +47818,7 @@ var ts; return true; } } - else if (targetType.flags & 3145728 /* UnionOrIntersection */) { + else if (targetType.flags & 3145728 /* UnionOrIntersection */ && isExcessPropertyCheckTarget(targetType)) { for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) { var t = _a[_i]; if (isKnownProperty(t, name, isComparingJsxAttributes)) { @@ -47356,12 +47826,14 @@ var ts; } } } - else if (targetType.flags & 16777216 /* Conditional */) { - return isKnownProperty(targetType.root.trueType, name, isComparingJsxAttributes) || - isKnownProperty(targetType.root.falseType, name, isComparingJsxAttributes); - } return false; } + function isExcessPropertyCheckTarget(type) { + return !!(type.flags & 524288 /* Object */ && !(ts.getObjectFlags(type) & 512 /* ObjectLiteralPatternWithComputedProperties */) || + type.flags & 67108864 /* NonPrimitive */ || + type.flags & 1048576 /* Union */ && ts.some(type.types, isExcessPropertyCheckTarget) || + type.flags & 2097152 /* Intersection */ && ts.every(type.types, isExcessPropertyCheckTarget)); + } function checkJsxExpression(node, checkMode) { if (node.expression) { var type = checkExpression(node.expression, checkMode); @@ -47402,7 +47874,7 @@ var ts; function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); var errorNode = node.kind === 148 /* QualifiedName */ ? node.right : node.kind === 183 /* ImportType */ ? node : node.name; - if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { + if (ts.getCheckFlags(prop) & 512 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); return false; @@ -47792,7 +48264,7 @@ var ts; } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind !== 183 /* ImportType */ && node.expression.kind === 98 /* SuperKeyword */, property.escapedName, type) + return isValidPropertyAccessWithType(node, node.kind === 189 /* PropertyAccessExpression */ && node.expression.kind === 98 /* SuperKeyword */, property.escapedName, type) && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); } function isValidMethodAccess(method, actualThisType) { @@ -48477,15 +48949,32 @@ var ts; return related ? addRelatedInfo(diagnostic, related) : diagnostic; } function getTypeArgumentArityError(node, signatures, typeArguments) { - var min = Infinity; - var max = -Infinity; + var argCount = typeArguments.length; + // No overloads exist + if (signatures.length === 1) { + var sig = signatures[0]; + var min_1 = getMinTypeArgumentCount(sig.typeParameters); + var max = ts.length(sig.typeParameters); + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + "-" + max : min_1, argCount); + } + // Overloads exist + var belowArgCount = -Infinity; + var aboveArgCount = Infinity; for (var _i = 0, signatures_5 = signatures; _i < signatures_5.length; _i++) { var sig = signatures_5[_i]; - min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters)); - max = Math.max(max, ts.length(sig.typeParameters)); + var min_2 = getMinTypeArgumentCount(sig.typeParameters); + var max = ts.length(sig.typeParameters); + if (min_2 > argCount) { + aboveArgCount = Math.min(aboveArgCount, min_2); + } + else if (max < argCount) { + belowArgCount = Math.max(belowArgCount, max); + } } - var paramCount = min === max ? min : min + "-" + max; - return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length); + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + } + return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, isForSignatureHelp, fallbackError) { var isTaggedTemplate = node.kind === 193 /* TaggedTemplateExpression */; @@ -48666,6 +49155,12 @@ var ts; if (inferenceContext) { var typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts.isInJSFile(candidate.declaration)); + // If the original signature has a generic rest type, instantiation may produce a + // signature with different arity and we need to perform another arity check. + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma)) { + candidateForArgumentArityError = checkCandidate; + continue; + } } if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, /*reportErrors*/ false)) { // Give preference to error candidates that have no rest parameters (as they are more specific) @@ -48714,7 +49209,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_7 = function (i) { + var _loop_8 = function (i) { var symbols = ts.mapDefined(candidates, function (_a) { var parameters = _a.parameters, hasRestParameter = _a.hasRestParameter; return hasRestParameter ? @@ -48725,7 +49220,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_7(i); + _loop_8(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return c.hasRestParameter ? ts.last(c.parameters) : undefined; }); var hasRestParameter = restParameterSymbols.length !== 0; @@ -48882,7 +49377,7 @@ var ts; */ function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) { // We exclude union types because we may have a union of function types that happen to have no common signatures. - return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 262144 /* TypeParameter */ || + return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (1048576 /* Union */ | 131072 /* Never */)) && isTypeAssignableTo(funcType, globalFunctionType); } function resolveNewExpression(node, candidatesOutArray, isForSignatureHelp) { @@ -49217,7 +49712,7 @@ var ts; return true; // If the symbol of the node has members, treat it like a constructor. var symbol = getSymbolOfNode(func); - return !!symbol && symbol.members !== undefined; + return !!symbol && (symbol.members !== undefined || symbol.exports !== undefined && symbol.exports.get("prototype") !== undefined); } return false; } @@ -49234,10 +49729,6 @@ var ts; inferred = getInferredClassType(symbol); } var assigned = getAssignedClassType(symbol); - var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType) && isJSConstructor(valueType.symbol.valueDeclaration)) { - inferred = getInferredClassType(valueType.symbol); - } return assigned && inferred ? getIntersectionType([inferred, assigned]) : assigned || inferred; @@ -49272,11 +49763,6 @@ var ts; } return links.inferredClassType; } - function isInferredClassType(type) { - return type.symbol - && ts.getObjectFlags(type) & 16 /* Anonymous */ - && getSymbolLinks(type.symbol).inferredClassType === type; - } /** * Syntactically and semantically checks a call or new expression. * @param node The call/new expression to be checked. @@ -49295,20 +49781,9 @@ var ts; declaration.kind !== 157 /* Constructor */ && declaration.kind !== 161 /* ConstructSignature */ && declaration.kind !== 166 /* ConstructorType */ && - !ts.isJSDocConstructSignature(declaration)) { - // When resolved signature is a call signature (and not a construct signature) the result type is any, unless - // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations - // in a JS file - // Note:JS inferred classes might come from a variable declaration instead of a function declaration. - // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration. - var funcSymbol = checkExpression(node.expression).symbol; - if (!funcSymbol && node.expression.kind === 72 /* Identifier */) { - funcSymbol = getResolvedSymbol(node.expression); - } - var type = funcSymbol && getJSClassType(funcSymbol); - if (type) { - return signature.target ? instantiateType(type, signature.mapper) : type; - } + !ts.isJSDocConstructSignature(declaration) && + !isJSConstructor(declaration)) { + // When resolved signature is a call signature (and not a construct signature) the result type is any if (noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -50363,7 +50838,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 296 /* NumberLike */ | 12288 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { + if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -50384,20 +50859,18 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } if (property.kind === 275 /* PropertyAssignment */ || property.kind === 276 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 149 /* ComputedPropertyName */) { - checkComputedPropertyName(name); - } - if (isComputedNonLiteralName(name)) { - return undefined; - } - var type = getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis); - if (type) { - // non-shorthand property assignments should always have initializers - return checkDestructuringAssignment(property.kind === 276 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); - } - else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); + var exprType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(exprType)) { + var text = getPropertyNameFromType(exprType); + var prop = getPropertyOfType(objectLiteralType, text); + if (prop) { + markPropertyAsReferenced(prop, property, rightIsThis); + checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); + } } + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); + var type = getFlowTypeOfDestructuring(property, elementType); + return checkDestructuringAssignment(property.kind === 276 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } else if (property.kind === 277 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { @@ -50417,23 +50890,6 @@ var ts; error(property, ts.Diagnostics.Property_assignment_expected); } } - function getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis) { - if (isTypeAny(objectLiteralType)) { - return objectLiteralType; - } - var type; - var text = ts.getTextOfPropertyName(name); - if (text) { // TODO: GH#26379 - var prop = getPropertyOfType(objectLiteralType, text); - if (prop) { - markPropertyAsReferenced(prop, property, rightIsThis); - checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); - type = getTypeOfSymbol(prop); - } - type = type || (isNumericLiteralName(text) ? getIndexTypeOfType(objectLiteralType, 1 /* Number */) : undefined); - } - return type || getIndexTypeOfType(objectLiteralType, 0 /* String */); - } function checkArrayLiteralAssignment(node, sourceType, checkMode) { var elements = node.elements; if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { @@ -50453,39 +50909,30 @@ var ts; var element = elements[elementIndex]; if (element.kind !== 210 /* OmittedExpression */) { if (element.kind !== 208 /* SpreadElement */) { - var propName = "" + elementIndex; - var type = isTypeAny(sourceType) ? sourceType : - everyType(sourceType, isTupleLikeType) ? getTupleElementType(sourceType, elementIndex) : - elementType; - if (type) { + var indexType = getLiteralType(elementIndex); + if (isArrayLikeType(sourceType)) { + // We create a synthetic expression so that getIndexedAccessType doesn't get confused + // when the element is a SyntaxKind.ElementAccessExpression. + var elementType_2 = getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)); + var type = getFlowTypeOfDestructuring(element, elementType_2); return checkDestructuringAssignment(element, type, checkMode); } - // We still need to check element expression here because we may need to set appropriate flag on the expression - // such as NodeCheckFlags.LexicalThis on "this"expression. - checkExpression(element); - if (isTupleType(sourceType)) { - error(element, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), getTypeReferenceArity(sourceType), elements.length); - } - else { - error(element, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); - } + return checkDestructuringAssignment(element, elementType, checkMode); + } + if (elementIndex < elements.length - 1) { + error(element, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { - if (elementIndex < elements.length - 1) { - error(element, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + var restExpression = element.expression; + if (restExpression.kind === 204 /* BinaryExpression */ && restExpression.operatorToken.kind === 59 /* EqualsToken */) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - var restExpression = element.expression; - if (restExpression.kind === 204 /* BinaryExpression */ && restExpression.operatorToken.kind === 59 /* EqualsToken */) { - error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); - } - else { - checkGrammarForDisallowedTrailingComma(node.elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - var type = everyType(sourceType, isTupleType) ? - mapType(sourceType, function (t) { return sliceTupleType(t, elementIndex); }) : - createArrayType(elementType); - return checkDestructuringAssignment(restExpression, type, checkMode); - } + checkGrammarForDisallowedTrailingComma(node.elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + var type = everyType(sourceType, isTupleType) ? + mapType(sourceType, function (t) { return sliceTupleType(t, elementIndex); }) : + createArrayType(elementType); + return checkDestructuringAssignment(restExpression, type, checkMode); } } } @@ -51006,7 +51453,8 @@ var ts; var type = getTypeOfExpression(initializer, /*cache*/ true); var widened = ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || ts.isDeclarationReadonly(declaration) || - isTypeAssertion(initializer) ? type : getWidenedLiteralType(type); + isTypeAssertion(initializer) || + isLiteralOfContextualType(type, getContextualType(initializer)) ? type : getWidenedLiteralType(type); if (ts.isInJSFile(declaration)) { if (widened.flags & 98304 /* Nullable */) { reportImplicitAny(declaration, anyType); @@ -51689,7 +52137,7 @@ var ts; // Constructors of classes with no extends clause may not contain super calls, whereas // constructors of derived classes must contain at least one super call somewhere in their function body. var containingClassDecl = node.parent; - if (ts.getEffectiveBaseTypeNode(containingClassDecl)) { + if (ts.getClassExtendsHeritageElement(containingClassDecl)) { captureLexicalThis(node.parent, containingClassDecl); var classExtendsNull = classDeclarationExtendsNull(containingClassDecl); var superCall = getSuperCallInConstructor(node); @@ -51883,7 +52331,6 @@ var ts; break; } } - checkGrammarForDisallowedTrailingComma(node.elementTypes); ts.forEach(node.elementTypes, checkSourceElement); } function checkUnionOrIntersectionType(node) { @@ -52252,10 +52699,10 @@ var ts; case 248 /* ImportEqualsDeclaration */: case 251 /* NamespaceImport */: case 250 /* ImportClause */: - var result_4 = 0 /* None */; + var result_5 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_4 |= getDeclarationSpaces(d); }); - return result_4; + ts.forEach(target.declarations, function (d) { result_5 |= getDeclarationSpaces(d); }); + return result_5; case 237 /* VariableDeclaration */: case 186 /* BindingElement */: case 239 /* FunctionDeclaration */: @@ -52743,7 +53190,12 @@ var ts; return; } if (!containsArgumentsReference(decl)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 148 /* QualifiedName */ ? node.name.right : node.name)); + if (ts.isQualifiedName(node.name)) { + error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left)); + } + else { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name)); + } } else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && @@ -53405,10 +53857,11 @@ var ts; var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - if (!ts.isBindingPattern(name)) { - var nameText = ts.getTextOfPropertyName(name); - if (nameText) { - var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 + if (!ts.isBindingPattern(name) && parentType) { + var exprType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(exprType)) { + var nameText = getPropertyNameFromType(exprType); + var property = getPropertyOfType(parentType, nameText); if (property) { markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); @@ -53765,7 +54218,7 @@ var ts; ? downlevelIteration ? ts.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator : isIterable - ? ts.Diagnostics.Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators + ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators : ts.Diagnostics.Type_0_is_not_an_array_type : downlevelIteration ? ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator @@ -54281,6 +54734,7 @@ var ts; if (produceDiagnostics) { if (node.default) { seenDefault = true; + checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i); } else if (seenDefault) { error(node, ts.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); @@ -54294,6 +54748,23 @@ var ts; } } } + /** Check that type parameter defaults only reference previously declared type parameters */ + function checkTypeParametersNotReferenced(root, typeParameters, index) { + visit(root); + function visit(node) { + if (node.kind === 164 /* TypeReference */) { + var type = getTypeFromTypeReference(node); + if (type.flags & 262144 /* TypeParameter */) { + for (var i = index; i < typeParameters.length; i++) { + if (type.symbol === getSymbolOfNode(typeParameters[i])) { + error(node, ts.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); + } + } + } + } + ts.forEachChild(node, visit); + } + } /** Check that type parameter lists are identical across multiple declarations */ function checkTypeParameterListsIdentical(symbol) { if (symbol.declarations.length === 1) { @@ -54484,7 +54955,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_8 = function (member) { + var _loop_9 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -54503,7 +54974,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_8(member); + _loop_9(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -54777,7 +55248,7 @@ var ts; return 0; } else if (isConstEnum) { - error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + error(initializer, ts.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values); } else if (member.parent.flags & 4194304 /* Ambient */) { error(initializer, ts.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); @@ -56806,7 +57277,9 @@ var ts; return; } var file = host.getSourceFile(resolvedDirective.resolvedFileName); - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } return { @@ -56859,7 +57332,7 @@ var ts; isLateBound: function (nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration); var symbol = node && getSymbolOfNode(node); - return !!(symbol && ts.getCheckFlags(symbol) & 1024 /* Late */); + return !!(symbol && ts.getCheckFlags(symbol) & 2048 /* Late */); }, getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; }, getAllAccessorDeclarations: function (accessor) { @@ -56961,6 +57434,19 @@ var ts; } return false; } + function addReferencedFilesToTypeDirective(file, key) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, key); + for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) { + var fileName = _a[_i].fileName; + var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration) { var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); @@ -57451,9 +57937,6 @@ var ts; if (!(parameter.flags & 4194304 /* Ambient */)) { // Allow `...foo,` in ambient declarations; see GH#23070 checkGrammarForDisallowedTrailingComma(parameters, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); } - if (ts.isBindingPattern(parameter.name)) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -58392,6 +58875,7 @@ var ts; if (nodeArguments.length !== 1) { return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument); } + checkGrammarForDisallowedTrailingComma(nodeArguments); // see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import. // parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import. if (ts.isSpreadElement(nodeArguments[0])) { @@ -58439,9 +58923,6 @@ var ts; JsxNames.LibraryManagedAttributes = "LibraryManagedAttributes"; // tslint:enable variable-name })(JsxNames || (JsxNames = {})); - function typeIsLiteralType(type) { - return !!(type.flags & 2944 /* Literal */); - } })(ts || (ts = {})); var ts; (function (ts) { @@ -60827,22 +61308,62 @@ var ts; return node; } ts.createBundle = createBundle; - function createUnparsedSourceFile(text, mapPath, map) { + function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, map) { var node = ts.createNode(281 /* UnparsedSource */); - node.text = text; - node.sourceMapPath = mapPath; - node.sourceMapText = map; + if (!ts.isString(textOrInputFiles)) { + ts.Debug.assert(mapPathOrType === "js" || mapPathOrType === "dts"); + node.fileName = mapPathOrType === "js" ? textOrInputFiles.javascriptPath : textOrInputFiles.declarationPath; + node.sourceMapPath = mapPathOrType === "js" ? textOrInputFiles.javascriptMapPath : textOrInputFiles.declarationMapPath; + Object.defineProperties(node, { + text: { get: function () { return mapPathOrType === "js" ? textOrInputFiles.javascriptText : textOrInputFiles.declarationText; } }, + sourceMapText: { get: function () { return mapPathOrType === "js" ? textOrInputFiles.javascriptMapText : textOrInputFiles.declarationMapText; } }, + }); + } + else { + node.text = textOrInputFiles; + node.sourceMapPath = mapPathOrType; + node.sourceMapText = map; + } return node; } ts.createUnparsedSourceFile = createUnparsedSourceFile; - function createInputFiles(javascript, declaration, javascriptMapPath, javascriptMapText, declarationMapPath, declarationMapText) { + function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapText) { var node = ts.createNode(282 /* InputFiles */); - node.javascriptText = javascript; - node.javascriptMapPath = javascriptMapPath; - node.javascriptMapText = javascriptMapText; - node.declarationText = declaration; - node.declarationMapPath = declarationMapPath; - node.declarationMapText = declarationMapText; + if (!ts.isString(javascriptTextOrReadFileText)) { + var cache_1 = ts.createMap(); + var textGetter_1 = function (path) { + if (path === undefined) + return undefined; + var value = cache_1.get(path); + if (value === undefined) { + value = javascriptTextOrReadFileText(path); + cache_1.set(path, value !== undefined ? value : false); + } + return value !== false ? value : undefined; + }; + var definedTextGetter_1 = function (path) { + var result = textGetter_1(path); + return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n"; + }; + node.javascriptPath = declarationTextOrJavascriptPath; + node.javascriptMapPath = javascriptMapPath; + node.declarationPath = ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath); + node.declarationMapPath = declarationMapPath; + Object.defineProperties(node, { + javascriptText: { get: function () { return definedTextGetter_1(declarationTextOrJavascriptPath); } }, + javascriptMapText: { get: function () { return textGetter_1(javascriptMapPath); } }, + declarationText: { get: function () { return definedTextGetter_1(ts.Debug.assertDefined(javascriptMapTextOrDeclarationPath)); } }, + declarationMapText: { get: function () { return textGetter_1(declarationMapPath); } } // TODO:: if there is inline sourceMap in dtsFile, use that + }); + } + else { + node.javascriptText = javascriptTextOrReadFileText; + node.javascriptMapPath = javascriptMapPath; + node.javascriptMapText = javascriptMapTextOrDeclarationPath; + node.declarationText = declarationTextOrJavascriptPath; + node.declarationMapPath = declarationMapPath; + node.declarationMapText = declarationMapText; + } return node; } ts.createInputFiles = createInputFiles; @@ -64005,15 +64526,19 @@ var ts; // Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M]) var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/; var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; + function getLineInfo(text, lineStarts) { + return { + getLineCount: function () { return lineStarts.length; }, + getLineText: function (line) { return text.substring(lineStarts[line], lineStarts[line + 1]); } + }; + } + ts.getLineInfo = getLineInfo; /** * Tries to find the sourceMappingURL comment at the end of a file. - * @param text The source text of the file. - * @param lineStarts The line starts of the file. */ - function tryGetSourceMappingURL(text, lineStarts) { - if (lineStarts === void 0) { lineStarts = ts.computeLineStarts(text); } - for (var index = lineStarts.length - 1; index >= 0; index--) { - var line = text.substring(lineStarts[index], lineStarts[index + 1]); + function tryGetSourceMappingURL(lineInfo) { + for (var index = lineInfo.getLineCount() - 1; index >= 0; index--) { + var line = lineInfo.getLineText(index); var comment = sourceMapCommentRegExp.exec(line); if (comment) { return comment[1]; @@ -64257,7 +64782,10 @@ var ts; && left.sourcePosition === right.sourcePosition; } function compareSourcePositions(left, right) { - return ts.compareValues(left.sourceIndex, right.sourceIndex); + // Compares sourcePosition without comparing sourceIndex + // since the mappings are grouped by sourceIndex + ts.Debug.assert(left.sourceIndex === right.sourceIndex); + return ts.compareValues(left.sourcePosition, right.sourcePosition); } function compareGeneratedPositions(left, right) { return ts.compareValues(left.generatedPosition, right.generatedPosition); @@ -64272,11 +64800,9 @@ var ts; var mapDirectory = ts.getDirectoryPath(mapPath); var sourceRoot = map.sourceRoot ? ts.getNormalizedAbsolutePath(map.sourceRoot, mapDirectory) : mapDirectory; var generatedAbsoluteFilePath = ts.getNormalizedAbsolutePath(map.file, mapDirectory); - var generatedCanonicalFilePath = host.getCanonicalFileName(generatedAbsoluteFilePath); - var generatedFile = host.getSourceFileLike(generatedCanonicalFilePath); + var generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); var sourceFileAbsolutePaths = map.sources.map(function (source) { return ts.getNormalizedAbsolutePath(source, sourceRoot); }); - var sourceFileCanonicalPaths = sourceFileAbsolutePaths.map(function (source) { return host.getCanonicalFileName(source); }); - var sourceToSourceIndexMap = ts.createMapFromEntries(sourceFileCanonicalPaths.map(function (source, i) { return [source, i]; })); + var sourceToSourceIndexMap = ts.createMapFromEntries(sourceFileAbsolutePaths.map(function (source, i) { return [host.getCanonicalFileName(source), i]; })); var decodedMappings; var generatedMappings; var sourceMappings; @@ -64286,16 +64812,15 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter, /*allowEdits*/ true) : -1; var source; var sourcePosition; if (isSourceMapping(mapping)) { - var sourceFilePath = sourceFileCanonicalPaths[mapping.sourceIndex]; - var sourceFile = host.getSourceFileLike(sourceFilePath); + var sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter, /*allowEdits*/ true) : -1; } return { @@ -65189,7 +65714,7 @@ var ts; function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { if (prepend.kind === 282 /* InputFiles */) { - return ts.createUnparsedSourceFile(prepend.javascriptText, prepend.javascriptMapPath, prepend.javascriptMapText); + return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; })); @@ -66713,6 +67238,7 @@ var ts; switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); + case 202 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -70483,7 +71009,7 @@ var ts; if (node.name) { enableSubstitutionsForBlockScopedBindings(); } - var extendsClauseElement = ts.getEffectiveBaseTypeNode(node); + var extendsClauseElement = ts.getClassExtendsHeritageElement(node); var classFunction = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, @@ -70892,7 +71418,7 @@ var ts; * synthesized call to `super` */ function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { - return node && node.dotDotDotToken && node.name.kind === 72 /* Identifier */ && !inConstructorWithSynthesizedSuper; + return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); } /** * Adds statements to the body of a function-like node if it contains a rest parameter. @@ -70909,10 +71435,10 @@ var ts; return; } // `declarationName` is the name of the local declaration for the parameter. - var declarationName = ts.getMutableClone(parameter.name); + var declarationName = parameter.name.kind === 72 /* Identifier */ ? ts.getMutableClone(parameter.name) : ts.createTempVariable(/*recordTempVariable*/ undefined); ts.setEmitFlags(declarationName, 48 /* NoSourceMap */); // `expressionName` is the name of the parameter used in expressions. - var expressionName = ts.getSynthesizedClone(parameter.name); + var expressionName = parameter.name.kind === 72 /* Identifier */ ? ts.getSynthesizedClone(parameter.name) : declarationName; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; @@ -70936,6 +71462,11 @@ var ts; ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */); ts.startOnNewLine(forStatement); statements.push(forStatement); + if (parameter.name.kind !== 72 /* Identifier */) { + // do the actual destructuring of the rest parameter if necessary + statements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( + /*modifiers*/ undefined, ts.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName))), parameter), 1048576 /* CustomPrologue */)); + } } /** * Adds a statement to capture the `this` of a function declaration if it is needed. @@ -79171,6 +79702,7 @@ var ts; case 241 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; + case 166 /* ConstructorType */: case 161 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; @@ -79189,6 +79721,7 @@ var ts; diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; + case 165 /* FunctionType */: case 239 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; @@ -79414,7 +79947,7 @@ var ts; return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { if (prepend.kind === 282 /* InputFiles */) { - return ts.createUnparsedSourceFile(prepend.declarationText, prepend.declarationMapPath, prepend.declarationMapText); + return ts.createUnparsedSourceFile(prepend, "dts"); } })); bundle.syntheticFileReferences = []; @@ -79766,7 +80299,10 @@ var ts; if (!ts.isLateVisibilityPaintedStatement(i)) { return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind)); } + var priorNeedsDeclare = needsDeclare; + needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit); var result = transformTopLevelDeclaration(i, /*privateDeclaration*/ true); + needsDeclare = priorNeedsDeclare; lateStatementReplacementMap.set("" + ts.getOriginalNodeId(i), result); } // And lastly, we need to get the final form of all those indetermine import declarations from before and add them to the output list @@ -80129,7 +80665,8 @@ var ts; var extendsClause_1 = ts.getEffectiveBaseTypeNode(input); if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 96 /* NullKeyword */) { // We must add a temporary declaration for the extends clause expression - var newId_1 = ts.createOptimisticUniqueName(ts.unescapeLeadingUnderscores(input.name.escapedText) + "_base"); // TODO: GH#18217 + var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default"; + var newId_1 = ts.createOptimisticUniqueName(oldId + "_base"); getSymbolAccessibilityDiagnostic = function () { return ({ diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: extendsClause_1, @@ -80283,7 +80820,7 @@ var ts; var prop = ts.createProperty(/*decorators*/ undefined, maskModifiers(node, /*mask*/ undefined, (!accessors.setAccessor) ? 64 /* Readonly */ : 0 /* None */), node.name, node.questionToken, ensureType(node, accessorType), /*initializer*/ undefined); var leadingsSyntheticCommentRanges = accessors.secondAccessor && ts.getLeadingCommentRangesOfNode(accessors.secondAccessor, currentSourceFile); if (leadingsSyntheticCommentRanges) { - var _loop_9 = function (range) { + var _loop_10 = function (range) { if (range.kind === 3 /* MultiLineCommentTrivia */) { var text = currentSourceFile.text.slice(range.pos + 2, range.end - 2); var lines = text.split(/\r\n?|\n/g); @@ -80297,7 +80834,7 @@ var ts; }; for (var _i = 0, leadingsSyntheticCommentRanges_1 = leadingsSyntheticCommentRanges; _i < leadingsSyntheticCommentRanges_1.length; _i++) { var range = leadingsSyntheticCommentRanges_1[_i]; - _loop_9(range); + _loop_10(range); } } return prop; @@ -80771,16 +81308,21 @@ var ts; } ts.forEachEmittedFile = forEachEmittedFile; /*@internal*/ + function getOutputPathsForBundle(options, forceDtsPaths) { + var outPath = options.outFile || options.out; + var jsFilePath = options.emitDeclarationOnly ? undefined : outPath; + var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.removeFileExtension(outPath) + ".d.ts" /* Dts */ : undefined; + var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; + var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined; + return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath }; + } + ts.getOutputPathsForBundle = getOutputPathsForBundle; + /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); if (sourceFile.kind === 280 /* Bundle */) { - var outPath = options.outFile || options.out; - var jsFilePath = options.emitDeclarationOnly ? undefined : outPath; - var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); - var declarationFilePath = (forceDtsPaths || ts.getEmitDeclarations(options)) ? ts.removeFileExtension(outPath) + ".d.ts" /* Dts */ : undefined; - var declarationMapPath = declarationFilePath && ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; - var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined; - return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath }; + return getOutputPathsForBundle(options, forceDtsPaths); } else { var ownOutputFilePath = ts.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile, options)); @@ -82187,18 +82729,22 @@ var ts; function emitPropertyAccessExpression(node) { var indentBeforeDot = false; var indentAfterDot = false; + var dotRangeFirstCommentStart = ts.skipTrivia(currentSourceFile.text, node.expression.end, + /*stopAfterLineBreak*/ false, + /*stopAtComments*/ true); + var dotRangeStart = ts.skipTrivia(currentSourceFile.text, dotRangeFirstCommentStart); + var dotRangeEnd = dotRangeStart + 1; if (!(ts.getEmitFlags(node) & 131072 /* NoIndentation */)) { - var dotRangeStart = node.expression.end; - var dotRangeEnd = ts.skipTrivia(currentSourceFile.text, node.expression.end) + 1; var dotToken = ts.createToken(24 /* DotToken */); - dotToken.pos = dotRangeStart; + dotToken.pos = node.expression.end; dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); } emitExpression(node.expression); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); - var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); + var dotHasCommentTrivia = dotRangeFirstCommentStart !== dotRangeStart; + var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression, dotHasCommentTrivia); if (shouldEmitDotDot) { writePunctuation("."); } @@ -82209,13 +82755,15 @@ var ts; } // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal - function needsDotDotForPropertyAccess(expression) { + function needsDotDotForPropertyAccess(expression, dotHasTrivia) { expression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isNumericLiteral(expression)) { // check if numeric literal is a decimal literal that was originally written with a dot var text = getLiteralTextOfNode(expression, /*neverAsciiEscape*/ true); - return !expression.numericLiteralFlags - && !ts.stringContains(text, ts.tokenToString(24 /* DotToken */)); + // If he number will be printed verbatim and it doesn't already contain a dot, add one + // if the expression doesn't have any comments that will be emitted. + return !expression.numericLiteralFlags && !ts.stringContains(text, ts.tokenToString(24 /* DotToken */)) && + (!dotHasTrivia || printerOptions.removeComments); } else if (ts.isPropertyAccessExpression(expression) || ts.isElementAccessExpression(expression)) { // check if constant enum value is integer @@ -82966,6 +83514,7 @@ var ts; function emitJsxSelfClosingElement(node) { writePunctuation("<"); emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); writeSpace(); emit(node.attributes); writePunctuation("/>"); @@ -82979,6 +83528,7 @@ var ts; writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); if (node.attributes.properties && node.attributes.properties.length > 0) { writeSpace(); } @@ -84567,10 +85117,10 @@ var ts; } } /** - * Skips trivia such as comments and white-space that can optionally overriden by the source map source + * Skips trivia such as comments and white-space that can be optionally overridden by the source-map source */ function skipSourceTrivia(source, pos) { - return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(sourceMapSource.text, pos); + return source.skipTrivia ? source.skipTrivia(pos) : ts.skipTrivia(source.text, pos); } /** * Emits a mapping. @@ -84584,7 +85134,7 @@ var ts; if (sourceMapsDisabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { return; } - var _a = ts.getLineAndCharacterOfPosition(currentSourceFile, pos), sourceLine = _a.line, sourceCharacter = _a.character; + var _a = ts.getLineAndCharacterOfPosition(sourceMapSource, pos), sourceLine = _a.line, sourceCharacter = _a.character; sourceMapGenerator.addMapping(writer.getLine(), writer.getColumn(), sourceMapSourceIndex, sourceLine, sourceCharacter, /*nameIndex*/ undefined); } @@ -84993,7 +85543,7 @@ var ts; }, flags); } function getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo) { - return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo1); + return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2); } function closeFileWatcherOf(objWithWatcher) { objWithWatcher.watcher.close(); @@ -85180,13 +85730,12 @@ var ts; } ts.createCompilerHostWorker = createCompilerHostWorker; /*@internal*/ - function changeCompilerHostToUseCache(host, toPath, useCacheForSourceFile) { + function changeCompilerHostLikeToUseCache(host, toPath, getSourceFile) { var originalReadFile = host.readFile; var originalFileExists = host.fileExists; var originalDirectoryExists = host.directoryExists; var originalCreateDirectory = host.createDirectory; var originalWriteFile = host.writeFile; - var originalGetSourceFile = host.getSourceFile; var readFileCache = ts.createMap(); var fileExistsCache = ts.createMap(); var directoryExistsCache = ts.createMap(); @@ -85213,19 +85762,17 @@ var ts; } return setReadFileCache(key, fileName); }; - if (useCacheForSourceFile) { - host.getSourceFile = function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { - var key = toPath(fileName); - var value = sourceFileCache.get(key); - if (value) - return value; - var sourceFile = originalGetSourceFile.call(host, fileName, languageVersion, onError, shouldCreateNewSourceFile); - if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Json */))) { - sourceFileCache.set(key, sourceFile); - } - return sourceFile; - }; - } + var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { + var key = toPath(fileName); + var value = sourceFileCache.get(key); + if (value) + return value; + var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile); + if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Json */))) { + sourceFileCache.set(key, sourceFile); + } + return sourceFile; + } : undefined; // fileExists for any kind of extension host.fileExists = function (fileName) { var key = toPath(fileName); @@ -85236,22 +85783,24 @@ var ts; fileExistsCache.set(key, !!newValue); return newValue; }; - host.writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) { - var key = toPath(fileName); - fileExistsCache.delete(key); - var value = readFileCache.get(key); - if (value && value !== data) { - readFileCache.delete(key); - sourceFileCache.delete(key); - } - else if (useCacheForSourceFile) { - var sourceFile = sourceFileCache.get(key); - if (sourceFile && sourceFile.text !== data) { + if (originalWriteFile) { + host.writeFile = function (fileName, data, writeByteOrderMark, onError, sourceFiles) { + var key = toPath(fileName); + fileExistsCache.delete(key); + var value = readFileCache.get(key); + if (value && value !== data) { + readFileCache.delete(key); sourceFileCache.delete(key); } - } - originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); - }; + else if (getSourceFileWithCache) { + var sourceFile = sourceFileCache.get(key); + if (sourceFile && sourceFile.text !== data) { + sourceFileCache.delete(key); + } + } + originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); + }; + } // directoryExists if (originalDirectoryExists && originalCreateDirectory) { host.directoryExists = function (directory) { @@ -85275,11 +85824,11 @@ var ts; originalDirectoryExists: originalDirectoryExists, originalCreateDirectory: originalCreateDirectory, originalWriteFile: originalWriteFile, - originalGetSourceFile: originalGetSourceFile, + getSourceFileWithCache: getSourceFileWithCache, readFileWithCache: readFileWithCache }; } - ts.changeCompilerHostToUseCache = changeCompilerHostToUseCache; + ts.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache; function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { var diagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(cancellationToken), program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); if (ts.getEmitDeclarations(program.getCompilerOptions())) { @@ -85612,7 +86161,7 @@ var ts; var sourceFilesFoundSearchingNodeModules = ts.createMap(); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); - var configParsingHost = parseConfigHostFromCompilerHost(host); + var configParsingHost = parseConfigHostFromCompilerHostLike(host); var skipDefaultLib = options.noLib; var getDefaultLibraryFileName = ts.memoize(function () { return host.getDefaultLibFileName(options); }); var defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : ts.getDirectoryPath(getDefaultLibraryFileName()); @@ -85658,6 +86207,12 @@ var ts; var sourceFileToPackageName = ts.createMap(); // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it. var redirectTargetsMap = ts.createMultiMap(); + /** + * map with + * - SourceFile if present + * - false if sourceFile missing for source of project reference redirect + * - undefined otherwise + */ var filesByName = ts.createMap(); var missingFilePaths; // stores 'filename -> file association' ignoring case @@ -85718,7 +86273,10 @@ var ts; }); } } - missingFilePaths = ts.arrayFrom(filesByName.keys(), function (p) { return p; }).filter(function (p) { return !filesByName.get(p); }); + missingFilePaths = ts.arrayFrom(ts.mapDefinedIterator(filesByName.entries(), function (_a) { + var path = _a[0], file = _a[1]; + return file === undefined ? path : undefined; + })); files = ts.stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); processingDefaultLibFiles = undefined; processingOtherFiles = undefined; @@ -85864,13 +86422,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_5 = []; + var result_6 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_5.push(resolvedModule); + result_6.push(resolvedModule); } - return result_5; + return result_6; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -86233,14 +86791,12 @@ var ts; // Upstream project didn't have outFile set -- skip (error will have been issued earlier) if (!out) continue; - var dtsFilename = ts.changeExtension(out, ".d.ts"); - var js = host.readFile(out) || "/* Input file " + out + " was missing */\r\n"; - var jsMapPath = out + ".map"; // TODO: try to read sourceMappingUrl comment from the file - var jsMap = host.readFile(jsMapPath); - var dts = host.readFile(dtsFilename) || "/* Input file " + dtsFilename + " was missing */\r\n"; - var dtsMapPath = dtsFilename + ".map"; - var dtsMap = host.readFile(dtsMapPath); - var node = ts.createInputFiles(js, dts, jsMap && jsMapPath, jsMap, dtsMap && dtsMapPath, dtsMap); + var _a = ts.getOutputPathsForBundle(resolvedRefOpts.options, /*forceDtsPaths*/ true), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath; + var node = ts.createInputFiles(function (fileName) { + var path = toPath(fileName); + var sourceFile = getSourceFileByPath(path); + return sourceFile ? sourceFile.text : filesByName.has(path) ? undefined : host.readFile(path); + }, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath); nodes.push(node); } } @@ -86326,7 +86882,7 @@ var ts; return getSourceFileByPath(toPath(fileName)); } function getSourceFileByPath(path) { - return filesByName.get(path); + return filesByName.get(path) || undefined; } function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) { if (sourceFile) { @@ -86804,7 +87360,7 @@ var ts; } /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */ function getSourceFileFromReference(referencingFile, ref) { - return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), function (fileName) { return filesByName.get(toPath(fileName)); }); + return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), function (fileName) { return filesByName.get(toPath(fileName)) || undefined; }); } function getSourceFileFromReferenceWorker(fileName, getSourceFile, fail, refFile) { if (ts.hasExtension(fileName)) { @@ -86910,7 +87466,9 @@ var ts; processReferencedFiles(file_1, isDefaultLib); processTypeReferenceDirectives(file_1); } - processLibReferenceDirectives(file_1); + if (!options.noLib) { + processLibReferenceDirectives(file_1); + } modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } @@ -86921,7 +87479,7 @@ var ts; processImportedModules(file_1); } } - return file_1; + return file_1 || undefined; } var redirectedPath; if (refFile) { @@ -86987,7 +87545,9 @@ var ts; processReferencedFiles(file, isDefaultLib); processTypeReferenceDirectives(file); } - processLibReferenceDirectives(file); + if (!options.noLib) { + processLibReferenceDirectives(file); + } // always process imported modules to record module name resolutions processImportedModules(file); if (isDefaultLib) { @@ -87000,9 +87560,12 @@ var ts; return file; } function addFileToFilesByName(file, path, redirectedPath) { - filesByName.set(path, file); if (redirectedPath) { filesByName.set(redirectedPath, file); + filesByName.set(path, file || false); + } + else { + filesByName.set(path, file); } } function getProjectReferenceRedirect(fileName) { @@ -87665,21 +88228,22 @@ var ts; } ts.createProgram = createProgram; /* @internal */ - function parseConfigHostFromCompilerHost(host) { + function parseConfigHostFromCompilerHostLike(host, directoryStructureHost) { + if (directoryStructureHost === void 0) { directoryStructureHost = host; } return { - fileExists: function (f) { return host.fileExists(f); }, + fileExists: function (f) { return directoryStructureHost.fileExists(f); }, readDirectory: function (root, extensions, excludes, includes, depth) { - ts.Debug.assertDefined(host.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); - return host.readDirectory(root, extensions, excludes, includes, depth); + ts.Debug.assertDefined(directoryStructureHost.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth); }, - readFile: function (f) { return host.readFile(f); }, + readFile: function (f) { return directoryStructureHost.readFile(f); }, useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(), getCurrentDirectory: function () { return host.getCurrentDirectory(); }, - onUnRecoverableConfigFileDiagnostic: function () { return undefined; }, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || (function () { return undefined; }), trace: host.trace ? function (s) { return host.trace(s); } : undefined }; } - ts.parseConfigHostFromCompilerHost = parseConfigHostFromCompilerHost; + ts.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike; function resolveProjectReferencePath(hostOrRef, ref) { var passedInRef = ref ? ref : hostOrRef; return ts.resolveConfigFileProjectName(passedInRef.path); @@ -87746,6 +88310,10 @@ var ts; } } ts.getFileEmitOutput = getFileEmitOutput; + function cloneMapOrUndefined(map) { + return map ? ts.cloneMap(map) : undefined; + } + ts.cloneMapOrUndefined = cloneMapOrUndefined; })(ts || (ts = {})); /*@internal*/ (function (ts) { @@ -87893,12 +88461,35 @@ var ts; fileInfos: fileInfos, referencedMap: referencedMap, exportedModulesMap: exportedModulesMap, - hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, - allFilesExcludingDefaultLibraryFile: undefined, - allFileNames: undefined + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature }; } BuilderState.create = create; + /** + * Releases needed properties + */ + function releaseCache(state) { + state.allFilesExcludingDefaultLibraryFile = undefined; + state.allFileNames = undefined; + } + BuilderState.releaseCache = releaseCache; + /** + * Creates a clone of the state + */ + function clone(state) { + var fileInfos = ts.createMap(); + state.fileInfos.forEach(function (value, key) { + fileInfos.set(key, __assign({}, value)); + }); + // Dont need to backup allFiles info since its cache anyway + return { + fileInfos: fileInfos, + referencedMap: ts.cloneMapOrUndefined(state.referencedMap), + exportedModulesMap: ts.cloneMapOrUndefined(state.exportedModulesMap), + hasCalledUpdateShapeSignature: ts.cloneMap(state.hasCalledUpdateShapeSignature), + }; + } + BuilderState.clone = clone; /** * Gets the files affected by the path from the program */ @@ -88147,7 +88738,7 @@ var ts; var seenFileNamesMap = ts.createMap(); // Start with the paths this file was referenced by seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); - var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); while (queue.length > 0) { var currentPath = queue.pop(); if (!seenFileNamesMap.has(currentPath)) { @@ -88155,7 +88746,7 @@ var ts; seenFileNamesMap.set(currentPath, currentSourceFile); if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 queue.push.apply(// TODO: GH#18217 - queue, getReferencedByPaths(state, currentPath)); + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } @@ -88179,24 +88770,32 @@ var ts; var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState); state.program = newProgram; var compilerOptions = newProgram.getCompilerOptions(); - if (!compilerOptions.outFile && !compilerOptions.out) { + state.compilerOptions = compilerOptions; + // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them + // With --isolatedModules, emitting changed file doesnt emit dependent files so we cant know of dependent files to retrieve errors so dont cache the errors + if (!compilerOptions.outFile && !compilerOptions.out && !compilerOptions.isolatedModules) { state.semanticDiagnosticsPerFile = ts.createMap(); } state.changedFilesSet = ts.createMap(); var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState); - var oldCompilerOptions = useOldState ? oldState.program.getCompilerOptions() : undefined; + var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined; var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile && !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions); if (useOldState) { // Verify the sanity of old state if (!oldState.currentChangedFilePath) { - ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); + var affectedSignatures = oldState.currentAffectedFilesSignatures; + ts.Debug.assert(!oldState.affectedFiles && (!affectedSignatures || !affectedSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); } if (canCopySemanticDiagnostics) { ts.Debug.assert(!ts.forEachKey(oldState.changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files"); } // Copy old state's changed files set ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet); + if (!compilerOptions.outFile && !compilerOptions.out && oldState.affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit; + state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + } } // Update changed files and copy semantic diagnostics if we can var referencedMap = state.referencedMap; @@ -88220,7 +88819,7 @@ var ts; state.changedFilesSet.set(sourceFilePath, true); } else if (canCopySemanticDiagnostics) { - var sourceFile = state.program.getSourceFileByPath(sourceFilePath); + var sourceFile = newProgram.getSourceFileByPath(sourceFilePath); if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) { return; } @@ -88240,6 +88839,36 @@ var ts; }); return state; } + /** + * Releases program and other related not needed properties + */ + function releaseCache(state) { + ts.BuilderState.releaseCache(state); + state.program = undefined; + } + /** + * Creates a clone of the state + */ + function cloneBuilderProgramState(state) { + var newState = ts.BuilderState.clone(state); + newState.semanticDiagnosticsPerFile = ts.cloneMapOrUndefined(state.semanticDiagnosticsPerFile); + newState.changedFilesSet = ts.cloneMap(state.changedFilesSet); + newState.affectedFiles = state.affectedFiles; + newState.affectedFilesIndex = state.affectedFilesIndex; + newState.currentChangedFilePath = state.currentChangedFilePath; + newState.currentAffectedFilesSignatures = ts.cloneMapOrUndefined(state.currentAffectedFilesSignatures); + newState.currentAffectedFilesExportedModulesMap = ts.cloneMapOrUndefined(state.currentAffectedFilesExportedModulesMap); + newState.seenAffectedFiles = ts.cloneMapOrUndefined(state.seenAffectedFiles); + newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles; + newState.semanticDiagnosticsFromOldState = ts.cloneMapOrUndefined(state.semanticDiagnosticsFromOldState); + newState.program = state.program; + newState.compilerOptions = state.compilerOptions; + newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit; + newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; + newState.seenEmittedFiles = ts.cloneMapOrUndefined(state.seenEmittedFiles); + newState.programEmitComplete = state.programEmitComplete; + return newState; + } /** * Verifies that source file is ok to be used in calls that arent handled by next */ @@ -88286,22 +88915,43 @@ var ts; } // With --out or --outFile all outputs go into single file // so operations are performed directly on program, return program - var compilerOptions = state.program.getCompilerOptions(); + var program = ts.Debug.assertDefined(state.program); + var compilerOptions = program.getCompilerOptions(); if (compilerOptions.outFile || compilerOptions.out) { ts.Debug.assert(!state.semanticDiagnosticsPerFile); - return state.program; + return program; } // Get next batch of affected files state.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures || ts.createMap(); if (state.exportedModulesMap) { state.currentAffectedFilesExportedModulesMap = state.currentAffectedFilesExportedModulesMap || ts.createMap(); } - state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, state.program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap); + state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures, state.currentAffectedFilesExportedModulesMap); state.currentChangedFilePath = nextKey.value; state.affectedFilesIndex = 0; state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); } } + /** + * Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet + */ + function getNextAffectedFilePendingEmit(state) { + var affectedFilesPendingEmit = state.affectedFilesPendingEmit; + if (affectedFilesPendingEmit) { + var seenEmittedFiles = state.seenEmittedFiles || (state.seenEmittedFiles = ts.createMap()); + for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) { + var affectedFile = ts.Debug.assertDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]); + if (affectedFile && !seenEmittedFiles.has(affectedFile.path)) { + // emit this file + state.affectedFilesPendingEmitIndex = i; + return affectedFile; + } + } + state.affectedFilesPendingEmit = undefined; + state.affectedFilesPendingEmitIndex = undefined; + } + return undefined; + } /** * Remove the semantic diagnostics cached from old state for affected File and the files that are referencing modules that export entities from affected file */ @@ -88313,9 +88963,10 @@ var ts; // Clean lib file diagnostics if its all files excluding default files to emit if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles && !state.cleanedDiagnosticsOfLibFiles) { state.cleanedDiagnosticsOfLibFiles = true; - var options_2 = state.program.getCompilerOptions(); - if (ts.forEach(state.program.getSourceFiles(), function (f) { - return state.program.isSourceFileDefaultLibrary(f) && + var program_1 = ts.Debug.assertDefined(state.program); + var options_2 = program_1.getCompilerOptions(); + if (ts.forEach(program_1.getSourceFiles(), function (f) { + return program_1.isSourceFileDefaultLibrary(f) && !ts.skipTypeChecking(f, options_2) && removeSemanticDiagnosticsOf(state, f.path); })) { @@ -88376,11 +89027,20 @@ var ts; return true; } // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected - return !!ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { + if (ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it exportedModules.has(filePath) && removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile); - }); + })) { + return true; + } + // Remove diagnostics of files that import this file (without going to exports of referencing files) + return !!ts.forEachEntry(state.referencedMap, function (referencesInFile, referencingFilePath) { + return referencesInFile.has(filePath) && + !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file + removeSemanticDiagnosticsOf(state, referencingFilePath); + } // Dont add to seen since this is not yet done with the export removal + ); } /** * Removes semantic diagnostics for path and @@ -88398,20 +89058,26 @@ var ts; * This is called after completing operation on the next affected file. * The operations here are postponed to ensure that cancellation during the iteration is handled correctly */ - function doneWithAffectedFile(state, affected) { + function doneWithAffectedFile(state, affected, isPendingEmit) { if (affected === state.program) { state.changedFilesSet.clear(); + state.programEmitComplete = true; } else { state.seenAffectedFiles.set(affected.path, true); - state.affectedFilesIndex++; + if (isPendingEmit) { + state.affectedFilesPendingEmitIndex++; + } + else { + state.affectedFilesIndex++; + } } } /** * Returns the result with affected file */ - function toAffectedFileResult(state, result, affected) { - doneWithAffectedFile(state, affected); + function toAffectedFileResult(state, result, affected, isPendingEmit) { + doneWithAffectedFile(state, affected, isPendingEmit); return { result: result, affected: affected }; } /** @@ -88420,14 +89086,18 @@ var ts; */ function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { var path = sourceFile.path; - var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); - // Report the semantic diagnostics from the cache if we already have those diagnostics present - if (cachedDiagnostics) { - return cachedDiagnostics; + if (state.semanticDiagnosticsPerFile) { + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); + // Report the semantic diagnostics from the cache if we already have those diagnostics present + if (cachedDiagnostics) { + return cachedDiagnostics; + } } // Diagnostics werent cached, get them from program, and cache the result - var diagnostics = state.program.getSemanticDiagnostics(sourceFile, cancellationToken); - state.semanticDiagnosticsPerFile.set(path, diagnostics); + var diagnostics = ts.Debug.assertDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); + if (state.semanticDiagnosticsPerFile) { + state.semanticDiagnosticsPerFile.set(path, diagnostics); + } return diagnostics; } var BuilderProgramKind; @@ -88452,7 +89122,7 @@ var ts; rootNames: newProgramOrRootNames, options: hostOrOptions, host: oldProgramOrHost, - oldProgram: oldProgram && oldProgram.getProgram(), + oldProgram: oldProgram && oldProgram.getProgramOrUndefined(), configFileParsingDiagnostics: configFileParsingDiagnostics, projectReferences: projectReferences }); @@ -88483,26 +89153,29 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = host.createHash || ts.identity; + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); + var backupState; // To ensure that we arent storing any references to old program or new program without state newProgram = undefined; // TODO: GH#18217 oldProgram = undefined; oldState = undefined; - var result = { - getState: function () { return state; }, - getProgram: function () { return state.program; }, - getCompilerOptions: function () { return state.program.getCompilerOptions(); }, - getSourceFile: function (fileName) { return state.program.getSourceFile(fileName); }, - getSourceFiles: function () { return state.program.getSourceFiles(); }, - getOptionsDiagnostics: function (cancellationToken) { return state.program.getOptionsDiagnostics(cancellationToken); }, - getGlobalDiagnostics: function (cancellationToken) { return state.program.getGlobalDiagnostics(cancellationToken); }, - getConfigFileParsingDiagnostics: function () { return configFileParsingDiagnostics || state.program.getConfigFileParsingDiagnostics(); }, - getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return state.program.getSyntacticDiagnostics(sourceFile, cancellationToken); }, - getSemanticDiagnostics: getSemanticDiagnostics, - emit: emit, - getAllDependencies: function (sourceFile) { return ts.BuilderState.getAllDependencies(state, state.program, sourceFile); }, - getCurrentDirectory: function () { return state.program.getCurrentDirectory(); } + var result = createRedirectedBuilderProgram(state, configFileParsingDiagnostics); + result.getState = function () { return state; }; + result.backupState = function () { + ts.Debug.assert(backupState === undefined); + backupState = cloneBuilderProgramState(state); + }; + result.restoreState = function () { + state = ts.Debug.assertDefined(backupState); + backupState = undefined; + }; + result.getAllDependencies = function (sourceFile) { return ts.BuilderState.getAllDependencies(state, ts.Debug.assertDefined(state.program), sourceFile); }; + result.getSemanticDiagnostics = getSemanticDiagnostics; + result.emit = emit; + result.releaseProgram = function () { + releaseCache(state); + backupState = undefined; }; if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { result.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; @@ -88521,14 +89194,33 @@ var ts; */ function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { var affected = getNextAffectedFile(state, cancellationToken, computeHash); + var isPendingEmitFile = false; if (!affected) { - // Done - return undefined; + if (!state.compilerOptions.out && !state.compilerOptions.outFile) { + affected = getNextAffectedFilePendingEmit(state); + if (!affected) { + return undefined; + } + isPendingEmitFile = true; + } + else { + var program = ts.Debug.assertDefined(state.program); + // Check if program uses any prepend project references, if thats the case we cant track of the js files of those, so emit even though there are no changes + if (state.programEmitComplete || !ts.some(program.getProjectReferences(), function (ref) { return !!ref.prepend; })) { + state.programEmitComplete = true; + return undefined; + } + affected = program; + } + } + // Mark seen emitted files if there are pending files to be emitted + if (state.affectedFilesPendingEmit && state.program !== affected) { + (state.seenEmittedFiles || (state.seenEmittedFiles = ts.createMap())).set(affected.path, true); } return toAffectedFileResult(state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file - state.program.emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected); + ts.Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected, isPendingEmitFile); } /** * Emits the JavaScript and declaration files. @@ -88565,7 +89257,7 @@ var ts; }; } } - return state.program.emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return ts.Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); } /** * Return the semantic diagnostics for the next affected file or undefined if iteration is complete @@ -88601,25 +89293,38 @@ var ts; */ function getSemanticDiagnostics(sourceFile, cancellationToken) { assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); - var compilerOptions = state.program.getCompilerOptions(); + var compilerOptions = ts.Debug.assertDefined(state.program).getCompilerOptions(); if (compilerOptions.outFile || compilerOptions.out) { ts.Debug.assert(!state.semanticDiagnosticsPerFile); // We dont need to cache the diagnostics just return them from program - return state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + return ts.Debug.assertDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); } if (sourceFile) { return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); } - if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { - // When semantic builder asks for diagnostics of the whole program, - // ensure that all the affected files are handled - var affected = void 0; - while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { - doneWithAffectedFile(state, affected); + // When semantic builder asks for diagnostics of the whole program, + // ensure that all the affected files are handled + var affected; + var affectedFilesPendingEmit; + while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { + if (affected !== state.program && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(affected.path); + } + doneWithAffectedFile(state, affected); + } + // In case of emit builder, cache the files to be emitted + if (affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = ts.concatenate(state.affectedFilesPendingEmit, affectedFilesPendingEmit); + // affectedFilesPendingEmitIndex === undefined + // - means the emit state.affectedFilesPendingEmit was undefined before adding current affected files + // so start from 0 as array would be affectedFilesPendingEmit + // else, continue to iterate from existing index, the current set is appended to existing files + if (state.affectedFilesPendingEmitIndex === undefined) { + state.affectedFilesPendingEmitIndex = 0; } } var diagnostics; - for (var _i = 0, _a = state.program.getSourceFiles(); _i < _a.length; _i++) { + for (var _i = 0, _a = ts.Debug.assertDefined(state.program).getSourceFiles(); _i < _a.length; _i++) { var sourceFile_2 = _a[_i]; diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_2, cancellationToken)); } @@ -88627,6 +89332,32 @@ var ts; } } ts.createBuilderProgram = createBuilderProgram; + function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) { + return { + getState: ts.notImplemented, + backupState: ts.noop, + restoreState: ts.noop, + getProgram: getProgram, + getProgramOrUndefined: function () { return state.program; }, + releaseProgram: function () { return state.program = undefined; }, + getCompilerOptions: function () { return state.compilerOptions; }, + getSourceFile: function (fileName) { return getProgram().getSourceFile(fileName); }, + getSourceFiles: function () { return getProgram().getSourceFiles(); }, + getOptionsDiagnostics: function (cancellationToken) { return getProgram().getOptionsDiagnostics(cancellationToken); }, + getGlobalDiagnostics: function (cancellationToken) { return getProgram().getGlobalDiagnostics(cancellationToken); }, + getConfigFileParsingDiagnostics: function () { return configFileParsingDiagnostics; }, + getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken); }, + getDeclarationDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken); }, + getSemanticDiagnostics: function (sourceFile, cancellationToken) { return getProgram().getSemanticDiagnostics(sourceFile, cancellationToken); }, + emit: function (sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers) { return getProgram().emit(sourceFile, writeFile, cancellationToken, emitOnlyDts, customTransformers); }, + getAllDependencies: ts.notImplemented, + getCurrentDirectory: function () { return getProgram().getCurrentDirectory(); } + }; + function getProgram() { + return ts.Debug.assertDefined(state.program); + } + } + ts.createRedirectedBuilderProgram = createRedirectedBuilderProgram; })(ts || (ts = {})); (function (ts) { function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { @@ -88638,23 +89369,8 @@ var ts; } ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { - var program = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences).newProgram; - return { - // Only return program, all other methods are not implemented - getProgram: function () { return program; }, - getState: ts.notImplemented, - getCompilerOptions: ts.notImplemented, - getSourceFile: ts.notImplemented, - getSourceFiles: ts.notImplemented, - getOptionsDiagnostics: ts.notImplemented, - getGlobalDiagnostics: ts.notImplemented, - getConfigFileParsingDiagnostics: ts.notImplemented, - getSyntacticDiagnostics: ts.notImplemented, - getSemanticDiagnostics: ts.notImplemented, - emit: ts.notImplemented, - getAllDependencies: ts.notImplemented, - getCurrentDirectory: ts.notImplemented - }; + var _a = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences), newProgram = _a.newProgram, newConfigFileParsingDiagnostics = _a.configFileParsingDiagnostics; + return ts.createRedirectedBuilderProgram({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }, newConfigFileParsingDiagnostics); } ts.createAbstractBuilder = createAbstractBuilder; })(ts || (ts = {})); @@ -89458,7 +90174,7 @@ var ts; if (ts.startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { return; // Don't want to a package to globally import from itself } - var target = targets.find(function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === 0 /* EqualTo */; }); if (target === undefined) return; var relative = ts.getRelativePathFromDirectory(resolved, target, getCanonicalFileName); @@ -89833,37 +90549,103 @@ var ts; var onWatchStatusChange = reportWatchStatus || createWatchStatusReporter(system); return { onWatchStatusChange: onWatchStatusChange, - watchFile: system.watchFile ? (function (path, callback, pollingInterval) { return system.watchFile(path, callback, pollingInterval); }) : function () { return noopFileWatcher; }, - watchDirectory: system.watchDirectory ? (function (path, callback, recursive) { return system.watchDirectory(path, callback, recursive); }) : function () { return noopFileWatcher; }, - setTimeout: system.setTimeout ? (function (callback, ms) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var _a; - return (_a = system.setTimeout).call.apply(_a, [system, callback, ms].concat(args)); - }) : ts.noop, - clearTimeout: system.clearTimeout ? (function (timeoutId) { return system.clearTimeout(timeoutId); }) : ts.noop + watchFile: ts.maybeBind(system, system.watchFile) || (function () { return noopFileWatcher; }), + watchDirectory: ts.maybeBind(system, system.watchDirectory) || (function () { return noopFileWatcher; }), + setTimeout: ts.maybeBind(system, system.setTimeout) || ts.noop, + clearTimeout: ts.maybeBind(system, system.clearTimeout) || ts.noop }; } ts.createWatchHost = createWatchHost; + var WatchType; + (function (WatchType) { + WatchType["ConfigFile"] = "Config file"; + WatchType["SourceFile"] = "Source file"; + WatchType["MissingFile"] = "Missing file"; + WatchType["WildcardDirectory"] = "Wild card directory"; + WatchType["FailedLookupLocations"] = "Failed Lookup Locations"; + WatchType["TypeRoots"] = "Type roots"; + })(WatchType = ts.WatchType || (ts.WatchType = {})); + function createWatchFactory(host, options) { + var watchLogLevel = host.trace ? options.extendedDiagnostics ? ts.WatchLogLevel.Verbose : options.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; + var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? (function (s) { return host.trace(s); }) : ts.noop; + var result = ts.getWatchFactory(watchLogLevel, writeLog); + result.writeLog = writeLog; + return result; + } + ts.createWatchFactory = createWatchFactory; + function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost) { + if (directoryStructureHost === void 0) { directoryStructureHost = host; } + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); }); + return { + getSourceFile: function (fileName, languageVersion, onError) { + var text; + try { + ts.performance.mark("beforeIORead"); + text = host.readFile(fileName, getCompilerOptions().charset); + ts.performance.mark("afterIORead"); + ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } + catch (e) { + if (onError) { + onError(e.message); + } + text = ""; + } + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + }, + getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation), + getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, + writeFile: writeFile, + getCurrentDirectory: ts.memoize(function () { return host.getCurrentDirectory(); }), + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), + getNewLine: function () { return ts.getNewLineCharacter(getCompilerOptions(), hostGetNewLine); }, + fileExists: function (f) { return host.fileExists(f); }, + readFile: function (f) { return host.readFile(f); }, + trace: ts.maybeBind(host, host.trace), + directoryExists: ts.maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: ts.maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: ts.maybeBind(host, host.realpath), + getEnvironmentVariable: ts.maybeBind(host, host.getEnvironmentVariable) || (function () { return ""; }), + createHash: ts.maybeBind(host, host.createHash), + readDirectory: ts.maybeBind(host, host.readDirectory), + }; + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + if (host.createDirectory) + host.createDirectory(directoryPath); + } + } + function writeFile(fileName, text, writeByteOrderMark, onError) { + try { + ts.performance.mark("beforeIOWrite"); + ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); + host.writeFile(fileName, text, writeByteOrderMark); + ts.performance.mark("afterIOWrite"); + ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + } + } + ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; /** * Creates the watch compiler host that can be extended with config file or root file names and options host */ - function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { - if (system === void 0) { system = ts.sys; } - if (!createProgram) { - createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram; - } + function createProgramHost(system, createProgram) { + var getDefaultLibLocation = ts.memoize(function () { return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); }); var host = system; host; // tslint:disable-line no-unused-expression (TODO: `host` is unused!) - var useCaseSensitiveFileNames = function () { return system.useCaseSensitiveFileNames; }; - var writeFileName = function (s) { return system.write(s + system.newLine); }; - var _a = createWatchHost(system, reportWatchStatus), onWatchStatusChange = _a.onWatchStatusChange, watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout; return { - useCaseSensitiveFileNames: useCaseSensitiveFileNames, + useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, getNewLine: function () { return system.newLine; }, - getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }), getDefaultLibLocation: getDefaultLibLocation, getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, fileExists: function (path) { return system.fileExists(path); }, @@ -89871,29 +90653,31 @@ var ts; directoryExists: function (path) { return system.directoryExists(path); }, getDirectories: function (path) { return system.getDirectories(path); }, readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); }, - realpath: system.realpath && (function (path) { return system.realpath(path); }), - getEnvironmentVariable: system.getEnvironmentVariable && (function (name) { return system.getEnvironmentVariable(name); }), - watchFile: watchFile, - watchDirectory: watchDirectory, - setTimeout: setTimeout, - clearTimeout: clearTimeout, - trace: function (s) { return system.write(s); }, - onWatchStatusChange: onWatchStatusChange, + realpath: ts.maybeBind(system, system.realpath), + getEnvironmentVariable: ts.maybeBind(system, system.getEnvironmentVariable), + trace: function (s) { return system.write(s + system.newLine); }, createDirectory: function (path) { return system.createDirectory(path); }, writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, - createHash: system.createHash && (function (s) { return system.createHash(s); }), - createProgram: createProgram, - afterProgramCreate: emitFilesAndReportErrorUsingBuilder + createHash: ts.maybeBind(system, system.createHash), + createProgram: createProgram }; - function getDefaultLibLocation() { - return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); - } - function emitFilesAndReportErrorUsingBuilder(builderProgram) { + } + ts.createProgramHost = createProgramHost; + /** + * Creates the watch compiler host that can be extended with config file or root file names and options host + */ + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + var writeFileName = function (s) { return system.write(s + system.newLine); }; + var result = createProgramHost(system, createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram); + ts.copyProperties(result, createWatchHost(system, reportWatchStatus)); + result.afterProgramCreate = function (builderProgram) { var compilerOptions = builderProgram.getCompilerOptions(); var newLine = ts.getNewLineCharacter(compilerOptions, function () { return system.newLine; }); - emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, function (errorCount) { return onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions); }); - } + emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName, function (errorCount) { return result.onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions); }); + }; + return result; } /** * Report error and exit @@ -89949,8 +90733,6 @@ var ts; var hasChangedAutomaticTypeDirectiveNames = false; // True if the automatic type directives have changed var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); var currentDirectory = host.getCurrentDirectory(); - var getCurrentDirectory = function () { return currentDirectory; }; - var readFile = function (path, encoding) { return host.readFile(path, encoding); }; var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, createProgram = host.createProgram; var rootFileNames = host.rootFiles, compilerOptions = host.options, projectReferences = host.projectReferences; var configFileSpecs; @@ -89962,15 +90744,7 @@ var ts; host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); } var directoryStructureHost = cachedDirectoryStructureHost || host; - var parseConfigFileHost = { - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, - fileExists: function (path) { return host.fileExists(path); }, - readFile: readFile, - getCurrentDirectory: getCurrentDirectory, - onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic, - trace: host.trace ? function (s) { return host.trace(s); } : undefined - }; + var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); // From tsc we want to get already parsed result and hence check for rootFileNames var newLine = updateNewLine(); if (configFileName && host.configFileParsingResult) { @@ -89984,52 +90758,40 @@ var ts; parseConfigFile(); newLine = updateNewLine(); } - var trace = host.trace && (function (s) { host.trace(s + newLine); }); - var watchLogLevel = trace ? compilerOptions.extendedDiagnostics ? ts.WatchLogLevel.Verbose : - compilerOptions.diagnostics ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; - var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? trace : ts.noop; // TODO: GH#18217 - var _b = ts.getWatchFactory(watchLogLevel, writeLog), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectory = _b.watchDirectory; + var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog; var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); if (configFileName) { - watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High, "Config file"); + watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High, "Config file" /* ConfigFile */); } - var compilerHost = { - // Members for CompilerHost - getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, - getSourceFileByPath: getVersionedSourceFileByPath, - getDefaultLibLocation: host.getDefaultLibLocation && (function () { return host.getDefaultLibLocation(); }), - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, - useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, - getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return newLine; }, - fileExists: fileExists, - readFile: readFile, - trace: trace, - directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }), - getDirectories: (directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); })), - realpath: host.realpath && (function (s) { return host.realpath(s); }), - getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }), - onReleaseOldSourceFile: onReleaseOldSourceFile, - createHash: host.createHash && (function (data) { return host.createHash(data); }), - // Members for ResolutionCacheHost - toPath: toPath, - getCompilationSettings: function () { return compilerOptions; }, - watchDirectoryOfFailedLookupLocation: function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Failed Lookup Locations"); }, - watchTypeRootsDirectory: function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Type roots"); }, - getCachedDirectoryStructureHost: function () { return cachedDirectoryStructureHost; }, - onInvalidatedResolution: scheduleProgramUpdate, - onChangedAutomaticTypeDirectiveNames: function () { - hasChangedAutomaticTypeDirectiveNames = true; - scheduleProgramUpdate(); - }, - maxNumberOfFilesToIterateForInvalidation: host.maxNumberOfFilesToIterateForInvalidation, - getCurrentProgram: getCurrentProgram, - writeLog: writeLog, - readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, + var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost); + // Members for CompilerHost + var getNewSourceFile = compilerHost.getSourceFile; + compilerHost.getSourceFile = function (fileName) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return getVersionedSourceFileByPath.apply(void 0, [fileName, toPath(fileName)].concat(args)); }; + compilerHost.getSourceFileByPath = getVersionedSourceFileByPath; + compilerHost.getNewLine = function () { return newLine; }; + compilerHost.fileExists = fileExists; + compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; + // Members for ResolutionCacheHost + compilerHost.toPath = toPath; + compilerHost.getCompilationSettings = function () { return compilerOptions; }; + compilerHost.watchDirectoryOfFailedLookupLocation = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Failed Lookup Locations" /* FailedLookupLocations */); }; + compilerHost.watchTypeRootsDirectory = function (dir, cb, flags) { return watchDirectory(host, dir, cb, flags, "Type roots" /* TypeRoots */); }; + compilerHost.getCachedDirectoryStructureHost = function () { return cachedDirectoryStructureHost; }; + compilerHost.onInvalidatedResolution = scheduleProgramUpdate; + compilerHost.onChangedAutomaticTypeDirectiveNames = function () { + hasChangedAutomaticTypeDirectiveNames = true; + scheduleProgramUpdate(); + }; + compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; + compilerHost.getCurrentProgram = getCurrentProgram; + compilerHost.writeLog = writeLog; // Cache for the module resolution var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) : @@ -90082,11 +90844,9 @@ var ts; } function createNewProgram(program, hasInvalidatedResolution) { // Compile the program - if (watchLogLevel !== ts.WatchLogLevel.None) { - writeLog("CreatingProgramWith::"); - writeLog(" roots: " + JSON.stringify(rootFileNames)); - writeLog(" options: " + JSON.stringify(compilerOptions)); - } + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; hasChangedCompilerOptions = false; hasChangedConfigFileParsingErrors = false; @@ -90149,7 +90909,7 @@ var ts; } // Create new source file if requested or the versions dont match if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { - var sourceFile = getNewSourceFile(); + var sourceFile = getNewSourceFile(fileName, languageVersion, onError); if (hostSourceFile) { if (shouldCreateNewSourceFile) { hostSourceFile.version++; @@ -90159,7 +90919,7 @@ var ts; hostSourceFile.sourceFile = sourceFile; sourceFile.version = hostSourceFile.version.toString(); if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file"); + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file" /* SourceFile */); } } else { @@ -90173,7 +90933,7 @@ var ts; else { if (sourceFile) { sourceFile.version = initialVersion.toString(); - var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file"); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path, "Source file" /* SourceFile */); sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); } else { @@ -90183,21 +90943,6 @@ var ts; return sourceFile; } return hostSourceFile.sourceFile; - function getNewSourceFile() { - var text; - try { - ts.performance.mark("beforeIORead"); - text = host.readFile(fileName, compilerOptions.charset); - ts.performance.mark("afterIORead"); - ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); - } - catch (e) { - if (onError) { - onError(e.message); - } - } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; - } } function nextSourceFileVersion(path) { var hostSourceFile = sourceFilesCache.get(path); @@ -90324,7 +91069,7 @@ var ts; } } function watchMissingFilePath(missingFilePath) { - return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath, "Missing file"); + return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath, "Missing file" /* MissingFile */); } function onMissingFileChange(fileName, eventKind, missingFilePath) { updateCachedSystemWithFile(fileName, missingFilePath, eventKind); @@ -90368,28 +91113,7 @@ var ts; // Schedule Update the program scheduleProgramUpdate(); } - }, flags, "Wild card directories"); - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - host.createDirectory(directoryPath); - } - } - function writeFile(fileName, text, writeByteOrderMark, onError) { - try { - ts.performance.mark("beforeIOWrite"); - ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); - host.writeFile(fileName, text, writeByteOrderMark); - ts.performance.mark("afterIOWrite"); - ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); - } - catch (e) { - if (onError) { - onError(e.message); - } - } + }, flags, "Wild card directory" /* WildcardDirectory */); } } ts.createWatchProgram = createWatchProgram; @@ -90558,9 +91282,8 @@ var ts; }; } ts.createBuilderStatusReporter = createBuilderStatusReporter; - function createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus) { - if (system === void 0) { system = ts.sys; } - var host = ts.createCompilerHostWorker({}, /*setParentNodes*/ undefined, system); + function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) { + var host = ts.createProgramHost(system, createProgram); host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : function () { return undefined; }; host.setModifiedTime = system.setModifiedTime ? function (path, date) { return system.setModifiedTime(path, date); } : ts.noop; host.deleteFile = system.deleteFile ? function (path) { return system.deleteFile(path); } : ts.noop; @@ -90568,21 +91291,18 @@ var ts; host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system); return host; } - function createSolutionBuilderHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) { + function createSolutionBuilderHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary) { if (system === void 0) { system = ts.sys; } - var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus); + var host = createSolutionBuilderHostBase(system, createProgram || ts.createAbstractBuilder, reportDiagnostic, reportSolutionBuilderStatus); host.reportErrorSummary = reportErrorSummary; return host; } ts.createSolutionBuilderHost = createSolutionBuilderHost; - function createSolutionBuilderWithWatchHost(system, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) { - var host = createSolutionBuilderHostBase(system, reportDiagnostic, reportSolutionBuilderStatus); + function createSolutionBuilderWithWatchHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + var host = createSolutionBuilderHostBase(system, createProgram || ts.createEmitAndSemanticDiagnosticsBuilderProgram, reportDiagnostic, reportSolutionBuilderStatus); var watchHost = ts.createWatchHost(system, reportWatchStatus); - host.onWatchStatusChange = watchHost.onWatchStatusChange; - host.watchFile = watchHost.watchFile; - host.watchDirectory = watchHost.watchDirectory; - host.setTimeout = watchHost.setTimeout; - host.clearTimeout = watchHost.clearTimeout; + ts.copyProperties(host, watchHost); return host; } ts.createSolutionBuilderWithWatchHost = createSolutionBuilderWithWatchHost; @@ -90597,7 +91317,7 @@ var ts; var hostWithWatch = host; var currentDirectory = host.getCurrentDirectory(); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - var parseConfigFileHost = ts.parseConfigHostFromCompilerHost(host); + var parseConfigFileHost = ts.parseConfigHostFromCompilerHostLike(host); // State of the solution var options = defaultOptions; var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); @@ -90610,7 +91330,13 @@ var ts; var globalDependencyGraph; var writeFileName = function (s) { return host.trace && host.trace(s); }; var readFileWithCache = function (f) { return host.readFile(f); }; + var projectCompilerOptions = baseCompilerOptions; + var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return projectCompilerOptions; }); + var originalGetSourceFile = compilerHost.getSourceFile; + var computeHash = host.createHash || ts.generateDjb2Hash; + updateGetSourceFile(); // Watch state + var builderPrograms = createFileMap(toPath); var diagnostics = createFileMap(toPath); var projectPendingBuild = createFileMap(toPath); var projectErrorsReported = createFileMap(toPath); @@ -90618,6 +91344,7 @@ var ts; var nextProjectToBuild = 0; var timerToBuildInvalidatedProject; var reportFileChangeDetected = false; + var _a = ts.createWatchFactory(host, options), watchFile = _a.watchFile, watchFilePath = _a.watchFilePath, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog; // Watches for the solution var allWatchedWildcardDirectories = createFileMap(toPath); var allWatchedInputFiles = createFileMap(toPath); @@ -90658,6 +91385,30 @@ var ts; ts.clearMap(allWatchedWildcardDirectories, function (wildCardWatches) { return ts.clearMap(wildCardWatches, ts.closeFileWatcherOf); }); ts.clearMap(allWatchedInputFiles, function (inputFileWatches) { return ts.clearMap(inputFileWatches, ts.closeFileWatcher); }); ts.clearMap(allWatchedConfigFiles, ts.closeFileWatcher); + builderPrograms.clear(); + updateGetSourceFile(); + } + function updateGetSourceFile() { + if (options.watch) { + if (compilerHost.getSourceFile === originalGetSourceFile) { + compilerHost.getSourceFile = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var result = originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args)); + if (result && options.watch) { + result.version = computeHash.call(host, result.text); + } + return result; + }; + } + } + else { + if (compilerHost.getSourceFile !== originalGetSourceFile) { + compilerHost.getSourceFile = originalGetSourceFile; + } + } } function isParsedCommandLine(entry) { return !!entry.options; @@ -90707,36 +91458,34 @@ var ts; } function watchConfigFile(resolved) { if (options.watch && !allWatchedConfigFiles.hasKey(resolved)) { - allWatchedConfigFiles.setValue(resolved, hostWithWatch.watchFile(resolved, function () { + allWatchedConfigFiles.setValue(resolved, watchFile(hostWithWatch, resolved, function () { invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.Full); - })); + }, ts.PollingInterval.High, "Config file" /* ConfigFile */, resolved)); } } function watchWildCardDirectories(resolved, parsed) { if (!options.watch) return; ts.updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(allWatchedWildcardDirectories, resolved), ts.createMapFromTemplate(parsed.configFileSpecs.wildcardDirectories), function (dir, flags) { - return hostWithWatch.watchDirectory(dir, function (fileOrDirectory) { + return watchDirectory(hostWithWatch, dir, function (fileOrDirectory) { var fileOrDirectoryPath = toPath(fileOrDirectory); if (fileOrDirectoryPath !== toPath(dir) && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, parsed.options)) { - // writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`); + writeLog("Project: " + resolved + " Detected file add/remove of non supported extension: " + fileOrDirectory); return; } if (isOutputFile(fileOrDirectory, parsed)) { - // writeLog(`${fileOrDirectory} is output file`); + writeLog(fileOrDirectory + " is output file"); return; } invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.Partial); - }, !!(flags & 1 /* Recursive */)); + }, flags, "Wild card directory" /* WildcardDirectory */, resolved); }); } function watchInputFiles(resolved, parsed) { if (!options.watch) return; ts.mutateMap(getOrCreateValueMapFromConfigFileMap(allWatchedInputFiles, resolved), ts.arrayToMap(parsed.fileNames, toPath), { - createNewValue: function (_key, input) { return hostWithWatch.watchFile(input, function () { - invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.None); - }); }, + createNewValue: function (path, input) { return watchFilePath(hostWithWatch, input, function () { return invalidateProjectAndScheduleBuilds(resolved, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.Low, path, "Source file" /* SourceFile */, resolved); }, onDeleteValue: ts.closeFileWatcher, }); } @@ -91056,18 +91805,39 @@ var ts; reportStatus(ts.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, resolved, status.upstreamProjectName); return; } + if (status.type === UpToDateStatusType.UpToDateWithUpstreamTypes) { + // Fake that files have been built by updating output file stamps + updateOutputTimestamps(proj); + return; + } var buildResult = buildSingleProject(resolved); - var dependencyGraph = getGlobalDependencyGraph(); - var referencingProjects = dependencyGraph.referencingProjectsMap.getValue(resolved); + if (buildResult & BuildResultFlags.AnyErrors) + return; + var _a = getGlobalDependencyGraph(), referencingProjectsMap = _a.referencingProjectsMap, buildQueue = _a.buildQueue; + var referencingProjects = referencingProjectsMap.getValue(resolved); if (!referencingProjects) return; // Always use build order to queue projects - for (var _i = 0, _a = dependencyGraph.buildQueue; _i < _a.length; _i++) { - var project = _a[_i]; + for (var index = buildQueue.indexOf(resolved) + 1; index < buildQueue.length; index++) { + var project = buildQueue[index]; var prepend = referencingProjects.getValue(project); - // If the project is referenced with prepend, always build downstream projectm, - // otherwise queue it only if declaration output changed - if (prepend || (prepend !== undefined && !(buildResult & BuildResultFlags.DeclarationOutputUnchanged))) { + if (prepend !== undefined) { + // If the project is referenced with prepend, always build downstream projects, + // If declaration output is changed, build the project + // otherwise mark the project UpToDateWithUpstreamTypes so it updates output time stamps + var status_1 = projectStatus.getValue(project); + if (prepend || !(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) { + if (status_1 && (status_1.type === UpToDateStatusType.UpToDate || status_1.type === UpToDateStatusType.UpToDateWithUpstreamTypes)) { + projectStatus.setValue(project, { + type: UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: status_1.oldestOutputFileName, + newerProjectName: resolved + }); + } + } + else if (status_1 && status_1.type === UpToDateStatusType.UpToDate) { + status_1.type = UpToDateStatusType.UpToDateWithUpstreamTypes; + } addProjToQueue(project); } } @@ -91138,19 +91908,12 @@ var ts; // Nothing to build - must be a solution file, basically return BuildResultFlags.None; } - var programOptions = { - projectReferences: configFile.projectReferences, - host: host, - rootNames: configFile.fileNames, - options: configFile.options, - configFileParsingDiagnostics: configFile.errors - }; - if (host.beforeCreateProgram) { - host.beforeCreateProgram(options); - } - var program = ts.createProgram(programOptions); + // TODO: handle resolve module name to cache result in project reference redirect + projectCompilerOptions = configFile.options; + var program = host.createProgram(configFile.fileNames, configFile.options, compilerHost, builderPrograms.getValue(proj), configFile.errors, configFile.projectReferences); + projectCompilerOptions = baseCompilerOptions; // Don't emit anything in the presence of syntactic errors or options diagnostics - var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); + var syntaxDiagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(), program.getGlobalDiagnostics(), program.getSyntacticDiagnostics()); if (syntaxDiagnostics.length) { return buildErrors(syntaxDiagnostics, BuildResultFlags.SyntaxErrors, "Syntactic"); } @@ -91159,6 +91922,8 @@ var ts; if (semanticDiagnostics.length) { return buildErrors(semanticDiagnostics, BuildResultFlags.TypeErrors, "Semantic"); } + // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly + program.backupState(); var newestDeclarationFileContentChangedTime = minimumDate; var anyDtsChanged = false; var declDiagnostics; @@ -91167,10 +91932,12 @@ var ts; ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }); // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { + program.restoreState(); return buildErrors(declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"); } // Actual Emit var emitterDiagnostics = ts.createDiagnosticCollection(); + var emittedOutputs = createFileMap(toPath); outputFiles.forEach(function (_a) { var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark; var priorChangeTime; @@ -91184,7 +91951,8 @@ var ts; anyDtsChanged = true; } } - ts.writeFile(host, emitterDiagnostics, name, text, writeByteOrderMark); + emittedOutputs.setValue(name, true); + ts.writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark); if (priorChangeTime !== undefined) { newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime); unchangedOutputs.setValue(name, priorChangeTime); @@ -91194,45 +91962,64 @@ var ts; if (emitDiagnostics.length) { return buildErrors(emitDiagnostics, BuildResultFlags.EmitErrors, "Emit"); } + // Update time stamps for rest of the outputs + newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(configFile, newestDeclarationFileContentChangedTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); var status = { type: UpToDateStatusType.UpToDate, - newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime + newestDeclarationFileContentChangedTime: anyDtsChanged ? maximumDate : newestDeclarationFileContentChangedTime, + oldestOutputFileName: outputFiles.length ? outputFiles[0].name : getFirstProjectOutput(configFile) }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); - if (host.afterProgramEmitAndDiagnostics) { - host.afterProgramEmitAndDiagnostics(program); - } + afterProgramCreate(proj, program); return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); - if (host.afterProgramEmitAndDiagnostics) { - host.afterProgramEmitAndDiagnostics(program); - } + afterProgramCreate(proj, program); return resultFlags; } } + function afterProgramCreate(proj, program) { + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } + if (options.watch) { + program.releaseProgram(); + builderPrograms.setValue(proj, program); + } + } function updateOutputTimestamps(proj) { if (options.dry) { return reportStatus(ts.Diagnostics.A_non_dry_build_would_build_project_0, proj.options.configFilePath); } - if (options.verbose) { - reportStatus(ts.Diagnostics.Updating_output_timestamps_of_project_0, proj.options.configFilePath); - } - var now = new Date(); - var outputs = getAllProjectOutputs(proj); - var priorNewestUpdateTime = minimumDate; - for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) { - var file = outputs_2[_i]; - if (isDeclarationFile(file)) { - priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime); - } - host.setModifiedTime(file, now); - } + var priorNewestUpdateTime = updateOutputTimestampsWorker(proj, minimumDate, ts.Diagnostics.Updating_output_timestamps_of_project_0); projectStatus.setValue(proj.options.configFilePath, { type: UpToDateStatusType.UpToDate, newestDeclarationFileContentChangedTime: priorNewestUpdateTime }); } + function updateOutputTimestampsWorker(proj, priorNewestUpdateTime, verboseMessage, skipOutputs) { + var outputs = getAllProjectOutputs(proj); + if (!skipOutputs || outputs.length !== skipOutputs.getSize()) { + if (options.verbose) { + reportStatus(verboseMessage, proj.options.configFilePath); + } + var now = host.now ? host.now() : new Date(); + for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) { + var file = outputs_2[_i]; + if (skipOutputs && skipOutputs.hasKey(file)) { + continue; + } + if (isDeclarationFile(file)) { + priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime); + } + host.setModifiedTime(file, now); + if (proj.options.listEmittedFiles) { + writeFileName("TSFILE: " + file); + } + } + } + return priorNewestUpdateTime; + } function getFilesToClean() { // Get the same graph for cleaning we'd use for building var graph = getGlobalDependencyGraph(); @@ -91279,9 +92066,17 @@ var ts; } // TODO:: In watch mode as well to use caches for incremental build once we can invalidate caches correctly and have right api // Override readFile for json files and output .d.ts to cache the text - var _a = ts.changeCompilerHostToUseCache(host, toPath, /*useCacheForSourceFile*/ true), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, originalGetSourceFile = _a.originalGetSourceFile, newReadFileWithCache = _a.readFileWithCache; var savedReadFileWithCache = readFileWithCache; + var savedGetSourceFile = compilerHost.getSourceFile; + var _a = ts.changeCompilerHostLikeToUseCache(host, toPath, function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return savedGetSourceFile.call.apply(savedGetSourceFile, [compilerHost].concat(args)); + }), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, newReadFileWithCache = _a.readFileWithCache; readFileWithCache = newReadFileWithCache; + compilerHost.getSourceFile = getSourceFileWithCache; var graph = getGlobalDependencyGraph(); reportBuildQueue(graph); var anyFailed = false; @@ -91333,8 +92128,8 @@ var ts; host.directoryExists = originalDirectoryExists; host.createDirectory = originalCreateDirectory; host.writeFile = originalWriteFile; + compilerHost.getSourceFile = savedGetSourceFile; readFileWithCache = savedReadFileWithCache; - host.getSourceFile = originalGetSourceFile; return anyFailed ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success; } function reportParseConfigFileDiagnostic(proj) { @@ -91357,7 +92152,7 @@ var ts; } } function relName(path) { - return ts.convertToRelativePath(path, host.getCurrentDirectory(), function (f) { return host.getCanonicalFileName(f); }); + return ts.convertToRelativePath(path, host.getCurrentDirectory(), function (f) { return compilerHost.getCanonicalFileName(f); }); } /** * Report the up-to-date status of a project if we're in verbose mode @@ -91390,6 +92185,19 @@ var ts; } } ts.getAllProjectOutputs = getAllProjectOutputs; + function getFirstProjectOutput(project) { + if (project.options.outFile || project.options.out) { + return ts.first(getOutFileOutputs(project)); + } + for (var _i = 0, _a = project.fileNames; _i < _a.length; _i++) { + var inputFile = _a[_i]; + var outputs = getOutputFileNames(inputFile, project); + if (outputs.length) { + return ts.first(outputs); + } + } + return ts.Debug.fail("project " + project.options.configFilePath + " expected to have at least one output"); + } function formatUpToDateStatus(configFileName, status, relName, formatMessage) { switch (status.type) { case UpToDateStatusType.OutOfDateWithSelf: @@ -91442,17 +92250,17 @@ var ts; } ts.inspectValue = inspectValue; function getRecurser() { - var seen = new Set(); + var seen = []; var nameStack = []; return function (obj, name, cbOk, cbFail) { - if (seen.has(obj) || nameStack.length > 4) { - return cbFail(seen.has(obj), nameStack); + if (seen.indexOf(obj) !== -1 || nameStack.length > 4) { + return cbFail(seen.indexOf(obj) !== -1, nameStack); } - seen.add(obj); + seen.push(obj); nameStack.push(name); var res = cbOk(); nameStack.pop(); - seen.delete(obj); + seen.pop(); return res; }; } @@ -91510,8 +92318,8 @@ var ts; return key === "constructor" ? undefined : getValueInfo(key, value, recurser); }); } - var ignoredProperties = new Set(["arguments", "caller", "constructor", "eval", "super_"]); - var reservedFunctionProperties = new Set(Object.getOwnPropertyNames(ts.noop)); + var ignoredProperties = ["arguments", "caller", "constructor", "eval", "super_"]; + var reservedFunctionProperties = Object.getOwnPropertyNames(ts.noop); function getEntriesOfObject(obj) { var seen = ts.createMap(); var entries = []; @@ -91520,8 +92328,8 @@ var ts; for (var _i = 0, _a = Object.getOwnPropertyNames(chain); _i < _a.length; _i++) { var key = _a[_i]; if (!isJsPrivate(key) && - !ignoredProperties.has(key) && - (typeof obj !== "function" || !reservedFunctionProperties.has(key)) && + ignoredProperties.indexOf(key) === -1 && + (typeof obj !== "function" || reservedFunctionProperties.indexOf(key) === -1) && // Don't add property from a higher prototype if it already exists in a lower one ts.addToSeen(seen, key)) { var value = safeGetPropertyOfObject(chain, key); @@ -91549,7 +92357,7 @@ var ts; return { kind: 0 /* Const */, name: name, typeName: "any", comment: comment }; } function isJsPrivate(name) { - return name.startsWith("_"); + return ts.startsWith(name, "_"); } ts.isJsPrivate = isJsPrivate; function tryRequire(fileNameToRequire) { @@ -91812,8 +92620,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_6 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_6.config; + var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_7.config; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. @@ -93388,7 +94196,7 @@ var ts; } ts.quotePreferenceFromString = quotePreferenceFromString; function getQuotePreference(sourceFile, preferences) { - if (preferences.quotePreference) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { @@ -93959,15 +94767,18 @@ var ts; if (/^\d+$/.test(text)) { return text; } + // Editors can pass in undefined or empty string - we want to infer the preference in those cases. + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - switch (preferences.quotePreference) { - case undefined: + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": case "double": return quoted; case "single": return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; default: - return ts.Debug.assertNever(preferences.quotePreference); + return ts.Debug.assertNever(quotePreference); } } ts.quote = quote; @@ -95245,7 +96056,7 @@ var ts; continue; var patterns = paths[path]; if (patterns) { - var _loop_10 = function (name, kind, extension) { + var _loop_11 = function (name, kind, extension) { // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. if (!result.some(function (entry) { return entry.name === name; })) { result.push(nameAndKind(name, kind, extension)); @@ -95253,7 +96064,7 @@ var ts; }; for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseDirectory, fileExtensions, host); _i < _a.length; _i++) { var _b = _a[_i], name = _b.name, kind = _b.kind, extension = _b.extension; - _loop_10(name, kind, extension); + _loop_11(name, kind, extension); } } } @@ -95288,7 +96099,7 @@ var ts; // (But do if we didn't find anything, e.g. 'package.json' missing.) var foundGlobal = false; if (fragmentDirectory === undefined) { - var _loop_11 = function (moduleName) { + var _loop_12 = function (moduleName) { if (!result.some(function (entry) { return entry.name === moduleName; })) { foundGlobal = true; result.push(nameAndKind(moduleName, "external module name" /* externalModuleName */, /*extension*/ undefined)); @@ -95296,7 +96107,7 @@ var ts; }; for (var _b = 0, _c = enumerateNodeModulesVisibleToScript(host, scriptPath); _b < _c.length; _b++) { var moduleName = _c[_b]; - _loop_11(moduleName); + _loop_12(moduleName); } } if (!foundGlobal) { @@ -95650,7 +96461,7 @@ var ts; getJSCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); // TODO: GH#18217 } else { - if ((!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { + if (!isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); @@ -95850,7 +96661,8 @@ var ts; }) || { type: "none" }; } function getSymbolName(symbol, origin, target) { - return origin && originIsExport(origin) && origin.isDefaultExport && symbol.escapedName === "default" /* Default */ + return origin && originIsExport(origin) && ((origin.isDefaultExport && symbol.escapedName === "default" /* Default */) || + (symbol.escapedName === "export=" /* ExportEquals */)) // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. ? ts.firstDefined(symbol.declarations, function (d) { return ts.isExportAssignment(d) && ts.isIdentifier(d.expression) ? d.expression.text : undefined; }) || ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) @@ -98511,9 +99323,9 @@ var ts; // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). if (node.parent.kind === 276 /* ShorthandPropertyAssignment */) { - var result_7 = []; - FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_7.push(nodeEntry(node)); }); - return result_7; + var result_8 = []; + FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_8.push(nodeEntry(node)); }); + return result_8; } else if (node.kind === 98 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { // References to and accesses on the super keyword only have one possible implementation, so no @@ -98545,8 +99357,8 @@ var ts; case 0 /* Symbol */: { var symbol = def.symbol; var _a = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_3 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_3, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case 1 /* Label */: { var node_3 = def.node; @@ -98554,8 +99366,8 @@ var ts; } case 2 /* Keyword */: { var node_4 = def.node; - var name_4 = ts.tokenToString(node_4.kind); - return { node: node_4, name: name_4, kind: "keyword" /* keyword */, displayParts: [{ text: name_4, kind: "keyword" /* keyword */ }] }; + var name_5 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case 3 /* This */: { var node_5 = def.node; @@ -98581,8 +99393,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode, checker) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); + function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText) { + return __assign({}, entryToDocumentSpan(entry), (providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker))); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98693,6 +99505,11 @@ var ts; } return ts.createTextSpanFromBounds(start, end); } + function getTextSpanOfEntry(entry) { + return entry.kind === 0 /* Span */ ? entry.textSpan : + getTextSpan(entry.node, entry.node.getSourceFile()); + } + FindAllReferences.getTextSpanOfEntry = getTextSpanOfEntry; /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccessForReference(node) { var decl = ts.getDeclarationFromName(node); @@ -98786,24 +99603,100 @@ var ts; if (symbol.escapedName === "export=" /* ExportEquals */) { return getReferencedSymbolsForModule(program, symbol.parent, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet); } - var moduleReferences = ts.emptyArray; - var moduleSourceFile = isModuleSymbol(symbol); - var referencedNode = node; - if (moduleSourceFile) { - var exportEquals = symbol.exports.get("export=" /* ExportEquals */); - // If !!exportEquals, we're about to add references to `import("mod")` anyway, so don't double-count them. - moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); - if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) - return moduleReferences; - // Continue to get references to 'export ='. - symbol = ts.skipAlias(exportEquals, checker); - referencedNode = undefined; + var moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + if (moduleReferences && !(symbol.flags & 33554432 /* Transient */)) { + return moduleReferences; } - return ts.concatenate(moduleReferences, getReferencedSymbolsForSymbol(symbol, referencedNode, sourceFiles, sourceFilesSet, checker, cancellationToken, options)); + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker); + var moduleReferencesOfExportTarget = aliasedSymbol && + getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + var references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options); + return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget); } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; - function isModuleSymbol(symbol) { - return symbol.flags & 1536 /* Module */ ? ts.find(symbol.declarations, ts.isSourceFile) : undefined; + function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) { + if (node.parent && ts.isNamespaceExportDeclaration(node.parent)) { + var aliasedSymbol = checker.getAliasedSymbol(symbol); + var targetSymbol = checker.getMergedSymbol(aliasedSymbol); + if (aliasedSymbol !== targetSymbol) { + return targetSymbol; + } + } + return undefined; + } + function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + var moduleSourceFile = symbol.flags & 1536 /* Module */ ? ts.find(symbol.declarations, ts.isSourceFile) : undefined; + if (!moduleSourceFile) + return undefined; + var exportEquals = symbol.exports.get("export=" /* ExportEquals */); + // If !!exportEquals, we're about to add references to `import("mod")` anyway, so don't double-count them. + var moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); + if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) + return moduleReferences; + // Continue to get references to 'export ='. + var checker = program.getTypeChecker(); + symbol = ts.skipAlias(exportEquals, checker); + return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol(symbol, /*node*/ undefined, sourceFiles, sourceFilesSet, checker, cancellationToken, options)); + } + /** + * Merges the references by sorting them (by file index in sourceFiles and their location in it) that point to same definition symbol + */ + function mergeReferences(program) { + var referencesToMerge = []; + for (var _i = 1; _i < arguments.length; _i++) { + referencesToMerge[_i - 1] = arguments[_i]; + } + var result; + for (var _a = 0, referencesToMerge_1 = referencesToMerge; _a < referencesToMerge_1.length; _a++) { + var references = referencesToMerge_1[_a]; + if (!references || !references.length) + continue; + if (!result) { + result = references; + continue; + } + var _loop_13 = function (entry) { + if (!entry.definition || entry.definition.type !== 0 /* Symbol */) { + result.push(entry); + return "continue"; + } + var symbol = entry.definition.symbol; + var refIndex = ts.findIndex(result, function (ref) { return !!ref.definition && + ref.definition.type === 0 /* Symbol */ && + ref.definition.symbol === symbol; }); + if (refIndex === -1) { + result.push(entry); + return "continue"; + } + var reference = result[refIndex]; + result[refIndex] = { + definition: reference.definition, + references: reference.references.concat(entry.references).sort(function (entry1, entry2) { + var entry1File = getSourceFileIndexOfEntry(program, entry1); + var entry2File = getSourceFileIndexOfEntry(program, entry2); + if (entry1File !== entry2File) { + return ts.compareValues(entry1File, entry2File); + } + var entry1Span = FindAllReferences.getTextSpanOfEntry(entry1); + var entry2Span = FindAllReferences.getTextSpanOfEntry(entry2); + return entry1Span.start !== entry2Span.start ? + ts.compareValues(entry1Span.start, entry2Span.start) : + ts.compareValues(entry1Span.length, entry2Span.length); + }) + }; + }; + for (var _b = 0, references_1 = references; _b < references_1.length; _b++) { + var entry = references_1[_b]; + _loop_13(entry); + } + } + return result; + } + function getSourceFileIndexOfEntry(program, entry) { + var sourceFile = entry.kind === 0 /* Span */ ? + program.getSourceFile(entry.fileName) : + entry.node.getSourceFile(); + return program.getSourceFiles().indexOf(sourceFile); } function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) { ts.Debug.assert(!!symbol.valueDeclaration); @@ -98840,7 +99733,7 @@ var ts; break; default: // This may be merged with something. - ts.Debug.fail("Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); + ts.Debug.assert(!!(symbol.flags & 33554432 /* Transient */), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); } } var exported = symbol.exports.get("export=" /* ExportEquals */); @@ -98887,12 +99780,12 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options)) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + var exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); if (exportSpecifier) { // When renaming at an export specifier, rename the export and not the thing being exported. getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); @@ -98902,7 +99795,7 @@ var ts; searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { - var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.isForRename, !!options.implementations) : [symbol] }); + var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.isForRename, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] }); // Try to get the smallest valid scope that we can limit our search to; // otherwise we'll need to search globally (i.e. include each file). var scope = getSymbolScope(symbol); @@ -98935,14 +99828,17 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { var parent = node.parent; - if (ts.isExportSpecifier(parent) && !isForRename) { + if (ts.isExportSpecifier(parent) && useLocalSymbolForExportSpecifier) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { + // Ignore UMD module and global merge + if (symbol.flags & 33554432 /* Transient */) + return undefined; // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); } @@ -98957,6 +99853,12 @@ var ts; SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; })(SpecialSearchKind || (SpecialSearchKind = {})); + function getNonModuleSymbolOfMergedModuleSymbol(symbol) { + if (!(symbol.flags & (1536 /* Module */ | 33554432 /* Transient */))) + return undefined; + var decl = symbol.declarations && ts.find(symbol.declarations, function (d) { return !ts.isSourceFile(d) && !ts.isModuleDeclaration(d); }); + return decl && decl.symbol; + } /** * Holds all state needed for the finding references. * Unlike `Search`, there is only one `State`. @@ -99015,7 +99917,7 @@ var ts; // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form // here appears to be intentional). - var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b; + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : undefined; return { symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, allSearchSymbols: allSearchSymbols, includes: function (sym) { return ts.contains(allSearchSymbols, sym); } }; @@ -99399,6 +100301,7 @@ var ts; getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { + ts.Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled"); var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); @@ -99427,14 +100330,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!state.options.isForRename || alwaysGetReferences) { + if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99466,7 +100369,7 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename) { + if (!(isForRenameWithPrefixAndSuffixText(state.options))) { searchForImportedSymbol(symbol, state); } } @@ -99728,6 +100631,9 @@ var ts; }); return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } + function isParameterName(node) { + return node.kind === 72 /* Identifier */ && node.parent.kind === 151 /* Parameter */ && node.parent.name === node; + } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. @@ -99748,7 +100654,7 @@ var ts; searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; case 279 /* SourceFile */: - if (ts.isExternalModule(searchSpaceNode)) { + if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through @@ -99780,7 +100686,7 @@ var ts; // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag; case 279 /* SourceFile */: - return container.kind === 279 /* SourceFile */ && !ts.isExternalModule(container); + return container.kind === 279 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return FindAllReferences.nodeEntry(n); }); @@ -99804,13 +100710,13 @@ var ts; } // For certain symbol kinds, we need to include other symbols in the search set. // This is not needed when searching for re-exports. - function populateSearchSymbolSet(symbol, location, checker, isForRename, implementations) { + function populateSearchSymbolSet(symbol, location, checker, isForRename, providePrefixAndSuffixText, implementations) { var result = []; - forEachRelatedSymbol(symbol, location, checker, isForRename, function (sym, root, base) { result.push(base || root || sym); }, + forEachRelatedSymbol(symbol, location, checker, isForRename, !(isForRename && providePrefixAndSuffixText), function (sym, root, base) { result.push(base || root || sym); }, /*allowBaseTypes*/ function () { return !implementations; }); return result; } - function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, cbSymbol, allowBaseTypes) { + function forEachRelatedSymbol(symbol, location, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, cbSymbol, allowBaseTypes) { var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { /* Because in short-hand property assignment, location has two meaning : property name and as value of the property @@ -99847,6 +100753,13 @@ var ts; if (res2) return res2; } + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location, symbol, checker); + if (aliasedSymbol) { + // In case of UMD module and global merging, search for global as well + var res_2 = cbSymbol(aliasedSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, 1 /* Node */); + if (res_2) + return res_2; + } var res = fromRoot(symbol); if (res) return res; @@ -99857,9 +100770,23 @@ var ts; return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } // symbolAtLocation for a binding element is the local symbol. See if the search symbol is the property. - // Don't do this when populating search set for a rename -- just rename the local. + // Don't do this when populating search set for a rename when prefix and suffix text will be provided -- just rename the local. if (!isForRenamePopulateSearchSymbolSet) { - var bindingElementPropertySymbol = ts.isObjectBindingElementWithoutPropertyName(location.parent) ? ts.getPropertySymbolFromBindingElement(checker, location.parent) : undefined; + var bindingElementPropertySymbol = void 0; + if (onlyIncludeBindingElementAtReferenceLocation) { + bindingElementPropertySymbol = ts.isObjectBindingElementWithoutPropertyName(location.parent) ? ts.getPropertySymbolFromBindingElement(checker, location.parent) : undefined; + } + else { + bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + } + return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); + } + ts.Debug.assert(isForRenamePopulateSearchSymbolSet); + // due to the above assert and the arguments at the uses of this function, + // (onlyIncludeBindingElementAtReferenceLocation <=> !providePrefixAndSuffixTextForRename) holds + var includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation; + if (includeOriginalSymbolOfBindingElement) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, 4 /* SearchedPropertyFoundLocal */); } function fromRoot(sym, kind) { @@ -99877,10 +100804,17 @@ var ts; : undefined); }); } + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { + var bindingElement = ts.getDeclarationOfKind(symbol, 186 /* BindingElement */); + if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { + return ts.getPropertySymbolFromBindingElement(checker, bindingElement); + } + } } function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { var checker = state.checker; - return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, function (sym, rootSymbol, baseSymbol, kind) { return search.includes(baseSymbol || rootSymbol || sym) + return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, + /*onlyIncludeBindingElementAtReferenceLocation*/ !state.options.isForRename || !!state.options.providePrefixAndSuffixTextForRename, function (sym, rootSymbol, baseSymbol, kind) { return search.includes(baseSymbol || rootSymbol || sym) // For a base type, use the symbol for the derived type. For a synthetic (e.g. union) property, use the union symbol. ? { symbol: rootSymbol && !(ts.getCheckFlags(sym) & 6 /* Synthetic */) ? rootSymbol : sym, kind: kind } : undefined; }, @@ -99922,7 +100856,8 @@ var ts; Core.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; function isImplementation(node) { return !!(node.flags & 4194304 /* Ambient */) - || (ts.isVariableLike(node) ? ts.hasInitializer(node) + ? !(ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) + : (ts.isVariableLike(node) ? ts.hasInitializer(node) : ts.isFunctionLikeDeclaration(node) ? !!node.body : ts.isClassLike(node) || ts.isModuleOrEnumDeclaration(node)); } @@ -99965,6 +100900,9 @@ var ts; }); return res.length === 0 ? undefined : res; } + function isForRenameWithPrefixAndSuffixText(options) { + return options.isForRename && options.providePrefixAndSuffixTextForRename; + } })(Core = FindAllReferences.Core || (FindAllReferences.Core = {})); })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -100077,7 +101015,7 @@ var ts; } function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) { var allFiles = program.getSourceFiles(); - var _loop_12 = function (sourceFile) { + var _loop_14 = function (sourceFile) { var newFromOld = oldToNew(sourceFile.path); var newImportFromPath = newFromOld !== undefined ? newFromOld : sourceFile.path; var newImportFromDirectory = ts.getDirectoryPath(newImportFromPath); @@ -100099,7 +101037,7 @@ var ts; var toImport = oldFromNew !== undefined // If we're at the new location (file was already renamed), need to redo module resolution starting from the old location. // TODO:GH#18217 - ? getSourceFileToImportFromResolved(ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, host) + ? getSourceFileToImportFromResolved(ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew); // Need an update if the imported file moved, or the importing file moved and was using a relative path. return toImport !== undefined && (toImport.updated || (importingSourceFileMoved && ts.pathIsRelative(importLiteral.text))) @@ -100109,7 +101047,7 @@ var ts; }; for (var _i = 0, allFiles_1 = allFiles; _i < allFiles_1.length; _i++) { var sourceFile = allFiles_1[_i]; - _loop_12(sourceFile); + _loop_14(sourceFile); } } function combineNormal(pathA, pathB) { @@ -100129,23 +101067,32 @@ var ts; var resolved = host.resolveModuleNames ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName) : program.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName); - return getSourceFileToImportFromResolved(resolved, oldToNew, host); + return getSourceFileToImportFromResolved(resolved, oldToNew); } } - function getSourceFileToImportFromResolved(resolved, oldToNew, host) { + function getSourceFileToImportFromResolved(resolved, oldToNew) { // Search through all locations looking for a moved file, and only then test already existing files. // This is because if `a.ts` is compiled to `a.js` and `a.ts` is moved, we don't want to resolve anything to `a.js`, but to `a.ts`'s new location. - return tryEach(tryGetNewFile) || tryEach(tryGetOldFile); - function tryEach(cb) { - return resolved && ((resolved.resolvedModule && cb(resolved.resolvedModule.resolvedFileName)) || ts.firstDefined(resolved.failedLookupLocations, cb)); + if (!resolved) + return undefined; + // First try resolved module + if (resolved.resolvedModule) { + var result_9 = tryChange(resolved.resolvedModule.resolvedFileName); + if (result_9) + return result_9; } - function tryGetNewFile(oldFileName) { - var newFileName = oldToNew(oldFileName); - return newFileName !== undefined && host.fileExists(newFileName) ? { newFileName: newFileName, updated: true } : undefined; // TODO: GH#18217 + // Then failed lookups except package.json since we dont want to touch them (only included ts/js files) + var result = ts.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson); + if (result) + return result; + // If nothing changed, then result is resolved module file thats not updated + return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false }; + function tryChangeWithIgnoringPackageJson(oldFileName) { + return !ts.endsWith(oldFileName, "/package.json") ? tryChange(oldFileName) : undefined; } - function tryGetOldFile(oldFileName) { + function tryChange(oldFileName) { var newFileName = oldToNew(oldFileName); - return host.fileExists(oldFileName) ? newFileName !== undefined ? { newFileName: newFileName, updated: true } : { newFileName: oldFileName, updated: false } : undefined; // TODO: GH#18217 + return newFileName && { newFileName: newFileName, updated: true }; } } function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) { @@ -100242,10 +101189,10 @@ var ts; // bar(({pr/*goto*/op1})=>{}); if (ts.isPropertyName(node) && ts.isBindingElement(parent) && ts.isObjectBindingPattern(parent.parent) && (node === (parent.propertyName || parent.name))) { - var name_5 = ts.getNameFromPropertyName(node); + var name_6 = ts.getNameFromPropertyName(node); var type = typeChecker.getTypeAtLocation(parent.parent); - return name_5 === undefined ? ts.emptyArray : ts.flatMap(type.isUnion() ? type.types : [type], function (t) { - var prop = t.getProperty(name_5); + return name_6 === undefined ? ts.emptyArray : ts.flatMap(type.isUnion() ? type.types : [type], function (t) { + var prop = t.getProperty(name_6); return prop && getDefinitionFromSymbol(typeChecker, prop, node); }); } @@ -100890,7 +101837,7 @@ var ts; if (!patternMatcher) return ts.emptyArray; var rawItems = []; - var _loop_13 = function (sourceFile) { + var _loop_15 = function (sourceFile) { cancellationToken.throwIfCancellationRequested(); if (excludeDtsFiles && sourceFile.isDeclarationFile) { return "continue"; @@ -100902,7 +101849,7 @@ var ts; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { var sourceFile = sourceFiles_6[_i]; - _loop_13(sourceFile); + _loop_15(sourceFile); } rawItems.sort(compareNavigateToItems); return (maxResultCount === undefined ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); @@ -101594,7 +102541,7 @@ var ts; else if (ts.isCallExpression(parent)) { var name = getCalledExpressionName(parent.expression); if (name !== undefined) { - var args = ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteral(a) ? a.getText(curSourceFile) : undefined; }).join(", "); + var args = ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "); return name + "(" + args + ") callback"; } } @@ -101647,10 +102594,12 @@ var ts; organizeImportsWorker(topLevelExportDecls, coalesceExports); for (var _i = 0, _a = sourceFile.statements.filter(ts.isAmbientModule); _i < _a.length; _i++) { var ambientModule = _a[_i]; - var ambientModuleBody = getModuleBlock(ambientModule); // TODO: GH#18217 - var ambientModuleImportDecls = ambientModuleBody.statements.filter(ts.isImportDeclaration); + if (!ambientModule.body) { + continue; + } + var ambientModuleImportDecls = ambientModule.body.statements.filter(ts.isImportDeclaration); organizeImportsWorker(ambientModuleImportDecls, coalesceAndOrganizeImports); - var ambientModuleExportDecls = ambientModuleBody.statements.filter(ts.isExportDeclaration); + var ambientModuleExportDecls = ambientModule.body.statements.filter(ts.isExportDeclaration); organizeImportsWorker(ambientModuleExportDecls, coalesceExports); } return changeTracker.getChanges(); @@ -101690,13 +102639,9 @@ var ts; } } OrganizeImports.organizeImports = organizeImports; - function getModuleBlock(moduleDecl) { - var body = moduleDecl.body; - return body && !ts.isIdentifier(body) ? (ts.isModuleBlock(body) ? body : getModuleBlock(body)) : undefined; - } function removeUnusedImports(oldImports, sourceFile, program) { var typeChecker = program.getTypeChecker(); - var jsxNamespace = typeChecker.getJsxNamespace(); + var jsxNamespace = typeChecker.getJsxNamespace(sourceFile); var jsxElementsPresent = !!(sourceFile.transformFlags & 4 /* ContainsJsx */); var usedImports = []; for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) { @@ -101956,6 +102901,9 @@ var ts; if (ts.isDeclaration(n)) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } var span = getOutliningSpanForNode(n, sourceFile); if (span) out.push(span); @@ -101973,6 +102921,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -102088,6 +103043,7 @@ var ts; case 245 /* ModuleBlock */: return spanForNode(n.parent); case 240 /* ClassDeclaration */: + case 209 /* ClassExpression */: case 241 /* InterfaceDeclaration */: case 243 /* EnumDeclaration */: case 246 /* CaseBlock */: @@ -102116,10 +103072,10 @@ var ts; } function spanForObjectOrArrayLiteral(node, open) { if (open === void 0) { open = 18 /* OpenBraceToken */; } - // If the block has no leading keywords and is inside an array literal, + // If the block has no leading keywords and is inside an array literal or call expression, // we only want to collapse the span of the block. // Otherwise, the collapsed section will include the end of the previous line. - return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent), open); + return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent) && !ts.isCallExpression(node.parent), open); } function spanForNode(hintSpanNode, autoCollapse, useFullStart, open) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -102421,15 +103377,15 @@ var ts; // Assumes 'value' is already lowercase. function indexOfIgnoringCase(str, value) { var n = str.length - value.length; - var _loop_14 = function (start) { + var _loop_16 = function (start) { if (every(value, function (valueChar, i) { return toLowerCase(str.charCodeAt(i + start)) === valueChar; })) { return { value: start }; } }; for (var start = 0; start <= n; start++) { - var state_3 = _loop_14(start); - if (typeof state_3 === "object") - return state_3.value; + var state_4 = _loop_16(start); + if (typeof state_4 === "object") + return state_4.value; } return -1; } @@ -102943,15 +103899,15 @@ var ts; (function (ts) { var Rename; (function (Rename) { - function getRenameInfo(program, sourceFile, position) { + function getRenameInfo(program, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position); var renameInfo = node && nodeIsEligibleForRename(node) - ? getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, function (declaration) { return program.isSourceFileDefaultLibrary(declaration.getSourceFile()); }) + ? getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, function (declaration) { return program.isSourceFileDefaultLibrary(declaration.getSourceFile()); }, options) : undefined; return renameInfo || getRenameInfoError(ts.Diagnostics.You_cannot_rename_this_element); } Rename.getRenameInfo = getRenameInfo; - function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) { + function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) return; @@ -102968,7 +103924,7 @@ var ts; return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { - return getRenameInfoForModule(node, sourceFile, symbol); + return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 149 /* ComputedPropertyName */) @@ -102985,7 +103941,7 @@ var ts; var moduleSourceFile = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (!moduleSourceFile) return undefined; - var withoutIndex = node.text.endsWith("/index") || node.text.endsWith("/index.js") ? undefined : ts.tryRemoveSuffix(ts.removeFileExtension(moduleSourceFile.fileName), "/index"); + var withoutIndex = ts.endsWith(node.text, "/index") || ts.endsWith(node.text, "/index.js") ? undefined : ts.tryRemoveSuffix(ts.removeFileExtension(moduleSourceFile.fileName), "/index"); var name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; var kind = withoutIndex === undefined ? "module" /* moduleElement */ : "directory" /* directory */; var indexAfterLastSlash = node.text.lastIndexOf("/") + 1; @@ -103440,7 +104396,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) { - var _loop_15 = function (n) { + var _loop_17 = function (n) { // If the node is not a subspan of its parent, this is a big problem. // There have been crashes that might be caused by this violation. ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.showSyntaxKind(n) + ", parent: " + ts.Debug.showSyntaxKind(n.parent); }); @@ -103449,10 +104405,10 @@ var ts; return { value: argumentInfo }; } }; - for (var n = node; isManuallyInvoked || (!ts.isBlock(n) && !ts.isSourceFile(n)); n = n.parent) { - var state_4 = _loop_15(n); - if (typeof state_4 === "object") - return state_4.value; + for (var n = node; !ts.isSourceFile(n) && (isManuallyInvoked || !ts.isBlock(n)); n = n.parent) { + var state_5 = _loop_17(n); + if (typeof state_5 === "object") + return state_5.value; } return undefined; } @@ -103565,86 +104521,47 @@ var ts; var ts; (function (ts) { var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/; - function getSourceMapper(useCaseSensitiveFileNames, currentDirectory, log, host, getProgram) { - var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - var sourcemappedFileCache; + function getSourceMapper(host) { + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var currentDirectory = host.getCurrentDirectory(); + var sourceFileLike = ts.createMap(); + var documentPositionMappers = ts.createMap(); return { tryGetSourcePosition: tryGetSourcePosition, tryGetGeneratedPosition: tryGetGeneratedPosition, toLineColumnOffset: toLineColumnOffset, clearCache: clearCache }; function toPath(fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } - function scanForSourcemapURL(fileName) { - var mappedFile = sourcemappedFileCache.get(toPath(fileName)); - if (!mappedFile) { - return; + function getDocumentPositionMapper(generatedFileName, sourceFileName) { + var path = toPath(generatedFileName); + var value = documentPositionMappers.get(path); + if (value) + return value; + var mapper; + if (host.getDocumentPositionMapper) { + mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); } - return ts.tryGetSourceMappingURL(mappedFile.text, ts.getLineStarts(mappedFile)); - } - function convertDocumentToSourceMapper(file, contents, mapFileName) { - var map = ts.tryParseRawSourceMap(contents); - if (!map || !map.sources || !map.file || !map.mappings) { - // obviously invalid map - return file.sourceMapper = ts.identitySourceMapConsumer; + else if (host.readFile) { + var file = getSourceFileLike(generatedFileName); + mapper = file && ts.getDocumentPositionMapper({ getSourceFileLike: getSourceFileLike, getCanonicalFileName: getCanonicalFileName, log: function (s) { return host.log(s); } }, generatedFileName, ts.getLineInfo(file.text, ts.getLineStarts(file)), function (f) { return !host.fileExists || host.fileExists(f) ? host.readFile(f) : undefined; }); } - var program = getProgram(); - return file.sourceMapper = ts.createDocumentPositionMapper({ - getSourceFileLike: function (s) { - // Lookup file in program, if provided - var file = program && program.getSourceFileByPath(s); - // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file - if (file === undefined || file.resolvedPath !== s) { - // Otherwise check the cache (which may hit disk) - return sourcemappedFileCache.get(s); - } - return file; - }, - getCanonicalFileName: getCanonicalFileName, - log: log, - }, map, mapFileName); - } - function getSourceMapper(fileName, file) { - if (!host.readFile || !host.fileExists) { - return file.sourceMapper = ts.identitySourceMapConsumer; - } - if (file.sourceMapper) { - return file.sourceMapper; - } - var mapFileName = scanForSourcemapURL(fileName); - if (mapFileName) { - var match = base64UrlRegExp.exec(mapFileName); - if (match) { - if (match[1]) { - var base64Object = match[1]; - return convertDocumentToSourceMapper(file, ts.base64decode(ts.sys, base64Object), fileName); - } - // Not a data URL we can parse, skip it - mapFileName = undefined; - } - } - var possibleMapLocations = []; - if (mapFileName) { - possibleMapLocations.push(mapFileName); - } - possibleMapLocations.push(fileName + ".map"); - for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) { - var location = possibleMapLocations_1[_i]; - var mapPath = ts.toPath(location, ts.getDirectoryPath(fileName), getCanonicalFileName); - if (host.fileExists(mapPath)) { - return convertDocumentToSourceMapper(file, host.readFile(mapPath), mapPath); // TODO: GH#18217 - } - } - return file.sourceMapper = ts.identitySourceMapConsumer; + documentPositionMappers.set(path, mapper || ts.identitySourceMapConsumer); + return mapper || ts.identitySourceMapConsumer; } function tryGetSourcePosition(info) { if (!ts.isDeclarationFileName(info.fileName)) return undefined; - var file = getFile(info.fileName); + var file = getSourceFile(info.fileName); if (!file) return undefined; - var newLoc = getSourceMapper(info.fileName, file).getSourcePosition(info); - return newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; + var newLoc = getDocumentPositionMapper(info.fileName).getSourcePosition(info); + return !newLoc || newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; } function tryGetGeneratedPosition(info) { - var program = getProgram(); + if (ts.isDeclarationFileName(info.fileName)) + return undefined; + var sourceFile = getSourceFile(info.fileName); + if (!sourceFile) + return undefined; + var program = host.getProgram(); var options = program.getCompilerOptions(); var outPath = options.outFile || options.out; var declarationPath = outPath ? @@ -103652,49 +104569,96 @@ var ts; ts.getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - var declarationFile = getFile(declarationPath); - if (!declarationFile) - return undefined; - var newLoc = getSourceMapper(declarationPath, declarationFile).getGeneratedPosition(info); + var newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info); return newLoc === info ? undefined : newLoc; } - function getFile(fileName) { + function getSourceFile(fileName) { + var program = host.getProgram(); + if (!program) + return undefined; var path = toPath(fileName); - var file = getProgram().getSourceFileByPath(path); - if (file && file.resolvedPath === path) { - return file; + // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file + var file = program.getSourceFileByPath(path); + return file && file.resolvedPath === path ? file : undefined; + } + function getOrCreateSourceFileLike(fileName) { + var path = toPath(fileName); + var fileFromCache = sourceFileLike.get(path); + if (fileFromCache !== undefined) + return fileFromCache ? fileFromCache : undefined; + if (!host.readFile || host.fileExists && !host.fileExists(path)) { + sourceFileLike.set(path, false); + return undefined; } - return sourcemappedFileCache.get(path); + // And failing that, check the disk + var text = host.readFile(path); + var file = text ? createSourceFileLike(text) : false; + sourceFileLike.set(path, file); + return file ? file : undefined; + } + // This can be called from source mapper in either source program or program that includes generated file + function getSourceFileLike(fileName) { + return !host.getSourceFileLike ? + getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : + host.getSourceFileLike(fileName); } function toLineColumnOffset(fileName, position) { - var file = getFile(fileName); // TODO: GH#18217 + var file = getSourceFileLike(fileName); // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } function clearCache() { - sourcemappedFileCache = createSourceFileLikeCache(host); + sourceFileLike.clear(); + documentPositionMappers.clear(); } } ts.getSourceMapper = getSourceMapper; - function createSourceFileLikeCache(host) { - var cached = ts.createMap(); - return { - get: function (path) { - if (cached.has(path)) { - return cached.get(path); + function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) { + var mapFileName = ts.tryGetSourceMappingURL(generatedFileLineInfo); + if (mapFileName) { + var match = base64UrlRegExp.exec(mapFileName); + if (match) { + if (match[1]) { + var base64Object = match[1]; + return convertDocumentToSourceMapper(host, ts.base64decode(ts.sys, base64Object), generatedFileName); } - if (!host.fileExists || !host.readFile || !host.fileExists(path)) - return; - // And failing that, check the disk - var text = host.readFile(path); // TODO: GH#18217 - var file = { - text: text, - lineMap: undefined, - getLineAndCharacterOfPosition: function (pos) { - return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos); - } - }; - cached.set(path, file); - return file; + // Not a data URL we can parse, skip it + mapFileName = undefined; + } + } + var possibleMapLocations = []; + if (mapFileName) { + possibleMapLocations.push(mapFileName); + } + possibleMapLocations.push(generatedFileName + ".map"); + var originalMapFileName = mapFileName && ts.getNormalizedAbsolutePath(mapFileName, ts.getDirectoryPath(generatedFileName)); + for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) { + var location = possibleMapLocations_1[_i]; + var mapFileName_1 = ts.getNormalizedAbsolutePath(location, ts.getDirectoryPath(generatedFileName)); + var mapFileContents = readMapFile(mapFileName_1, originalMapFileName); + if (ts.isString(mapFileContents)) { + return convertDocumentToSourceMapper(host, mapFileContents, mapFileName_1); + } + if (mapFileContents !== undefined) { + return mapFileContents || undefined; + } + } + return undefined; + } + ts.getDocumentPositionMapper = getDocumentPositionMapper; + function convertDocumentToSourceMapper(host, contents, mapFileName) { + var map = ts.tryParseRawSourceMap(contents); + if (!map || !map.sources || !map.file || !map.mappings) { + // obviously invalid map + return undefined; + } + return ts.createDocumentPositionMapper(host, map, mapFileName); + } + function createSourceFileLike(text, lineMap) { + return { + text: text, + lineMap: lineMap, + getLineAndCharacterOfPosition: function (pos) { + return ts.computeLineAndCharacterOfPosition(ts.getLineStarts(this), pos); } }; } @@ -103702,6 +104666,7 @@ var ts; /* @internal */ var ts; (function (ts) { + var visitedNestedConvertibleFunctions = ts.createMap(); function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { program.getSemanticDiagnostics(sourceFile, cancellationToken); var diags = []; @@ -103712,6 +104677,7 @@ var ts; diags.push(ts.createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); } var isJsFile = ts.isSourceFileJS(sourceFile); + visitedNestedConvertibleFunctions.clear(); check(sourceFile); if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { @@ -103809,13 +104775,17 @@ var ts; } } function addConvertToAsyncFunctionDiagnostics(node, checker, diags) { - if (!ts.isAsyncFunction(node) && + // need to check function before checking map so that deeper levels of nested callbacks are checked + if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) { + diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function)); + } + } + function isConvertibleFunction(node, checker) { + return !ts.isAsyncFunction(node) && node.body && ts.isBlock(node.body) && hasReturnStatementWithPromiseHandler(node.body) && - returnsPromise(node, checker)) { - diags.push(ts.createDiagnosticForNode(!node.name && ts.isVariableDeclaration(node.parent) && ts.isIdentifier(node.parent.name) ? node.parent.name : node, ts.Diagnostics.This_may_be_converted_to_an_async_function)); - } + returnsPromise(node, checker); } function returnsPromise(node, checker) { var functionType = checker.getTypeAtLocation(node); @@ -103856,16 +104826,21 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 96 /* NullKeyword */: - case 72 /* Identifier */: // identifier includes undefined case 239 /* FunctionDeclaration */: case 196 /* FunctionExpression */: case 197 /* ArrowFunction */: + visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); + /* falls through */ + case 96 /* NullKeyword */: + case 72 /* Identifier */: // identifier includes undefined return true; default: return false; } } + function getKeyFromNode(exp) { + return exp.pos.toString() + ":" + exp.end.toString(); + } })(ts || (ts = {})); /* @internal */ var ts; @@ -104588,7 +105563,7 @@ var ts; return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; }); }); options = ts.cloneCompilerOptions(options); - var _loop_16 = function (opt) { + var _loop_18 = function (opt) { if (!ts.hasProperty(options, opt.name)) { return "continue"; } @@ -104607,7 +105582,7 @@ var ts; }; for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { var opt = commandLineOptionsStringToEnum_1[_i]; - _loop_16(opt); + _loop_18(opt); } return options; } @@ -107779,7 +108754,7 @@ var ts; ChangeTracker.prototype.finishDeleteDeclarations = function () { var _this = this; var deletedNodesInLists = new ts.NodeSet(); // Stores nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. - var _loop_17 = function (sourceFile, node) { + var _loop_19 = function (sourceFile, node) { if (!this_1.deletedNodes.some(function (d) { return d.sourceFile === sourceFile && ts.rangeContainsRangeExclusive(d.node, node); })) { if (ts.isArray(node)) { this_1.deleteRange(sourceFile, ts.rangeOfTypeParameters(node)); @@ -107792,7 +108767,7 @@ var ts; var this_1 = this; for (var _i = 0, _a = this.deletedNodes; _i < _a.length; _i++) { var _b = _a[_i], sourceFile = _b.sourceFile, node = _b.node; - _loop_17(sourceFile, node); + _loop_19(sourceFile, node); } deletedNodesInLists.forEach(function (node) { var sourceFile = node.getSourceFile(); @@ -107849,14 +108824,14 @@ var ts; // order changes by start position // If the start position is the same, put the shorter range first, since an empty range (x, x) may precede (x, y) but not vice-versa. var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); }); - var _loop_18 = function (i) { + var _loop_20 = function (i) { ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () { return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range); }); }; // verify that change intervals do not overlap, except possibly at end points. for (var i = 0; i < normalized.length - 1; i++) { - _loop_18(i); + _loop_20(i); } var textChanges = normalized.map(function (c) { return ts.createTextChange(ts.createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate)); @@ -108460,6 +109435,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addNameToNamelessParameter"; + var errorCodes = [ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_parameter_name, fixId, ts.Diagnostics.Add_names_to_all_parameters_without_names)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, + }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos); + if (!ts.isIdentifier(token)) { + return ts.Debug.fail("add-name-to-nameless-parameter operates on identifiers, but got a " + ts.formatSyntaxKind(token.kind)); + } + var param = token.parent; + if (!ts.isParameter(param)) { + return ts.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts.formatSyntaxKind(token.kind)); + } + var i = param.parent.parameters.indexOf(param); + ts.Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); + ts.Debug.assert(i > -1, "Parameter not found in parent parameter list."); + var replacement = ts.createParameter( + /*decorators*/ undefined, param.modifiers, param.dotDotDotToken, "arg" + i, param.questionToken, ts.createTypeReferenceNode(token, /*typeArguments*/ undefined), param.initializer); + changeTracker.replaceNode(sourceFile, token, replacement); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -108952,8 +109961,8 @@ var ts; (function (InferFromReference) { function inferTypesFromReferences(references, checker, cancellationToken) { var usageContext = {}; - for (var _i = 0, references_1 = references; _i < references_1.length; _i++) { - var reference = references_1[_i]; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } @@ -108969,8 +109978,8 @@ var ts; return undefined; } var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; + for (var _i = 0, references_3 = references; _i < references_3.length; _i++) { + var reference = references_3[_i]; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } @@ -109610,7 +110619,7 @@ var ts; var newNodes = transformExpression(node, transformer, node); changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); } - var _loop_19 = function (statement) { + var _loop_21 = function (statement) { ts.forEachChild(statement, function visit(node) { if (ts.isCallExpression(node)) { startTransformation(node, statement); @@ -109622,7 +110631,7 @@ var ts; }; for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { var statement = returnStatements_1[_i]; - _loop_19(statement); + _loop_21(statement); } } function getReturnStatementsWithPromiseHandlers(body) { @@ -110530,11 +111539,10 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var program = context.program, sourceFile = context.sourceFile, span = context.span; + var sourceFile = context.sourceFile, span = context.span; var classDeclaration = getClass(sourceFile, span.start); - var checker = program.getTypeChecker(); return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences); }); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences); }); return changes.length === 0 ? undefined : codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, ts.Diagnostics.Implement_all_unimplemented_interfaces); }); }, @@ -110546,7 +111554,7 @@ var ts; if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { var implementedTypeNode = _a[_i]; - addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes, context.preferences); + addMissingDeclarations(context, implementedTypeNode, diag.file, classDeclaration, changes, context.preferences); } } }); @@ -110558,7 +111566,8 @@ var ts; function symbolPointsToNonPrivateMember(symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); } - function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + function addMissingDeclarations(context, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + var checker = context.program.getTypeChecker(); var maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker); // Note that this is ultimately derived from a map indexed by symbol names, // so duplicates cannot occur. @@ -110572,11 +111581,11 @@ var ts; if (!classType.getStringIndexType()) { createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); } - codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, context, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); if (indexInfoOfKind) { - changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration, /*flags*/ undefined, codefix.getNoopSymbolTrackerWithResolver(context))); } } } @@ -110902,7 +111911,7 @@ var ts; var symbolName = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken && (ts.isIntrinsicJsxName(symbolToken.text) || checker.resolveName(symbolToken.text, symbolToken, 67108863 /* All */, /*excludeGlobals*/ false)) - ? checker.getJsxNamespace() + ? checker.getJsxNamespace(sourceFile) : symbolToken.text; // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default" /* Default */); @@ -111274,7 +112283,7 @@ var ts; }); typeDeclToMembers.forEach(function (infos, classDeclaration) { var supers = getAllSupers(classDeclaration, checker); - var _loop_20 = function (info) { + var _loop_22 = function (info) { // If some superclass added this property, don't add it again. if (supers.some(function (superClassOrInterface) { var superInfos = typeDeclToMembers.get(superClassOrInterface); @@ -111301,7 +112310,7 @@ var ts; }; for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { var info = infos_1[_i]; - _loop_20(info); + _loop_22(info); } }); })); @@ -111450,7 +112459,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0, token.text], fixId, ts.Diagnostics.Add_all_missing_members); } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { - var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, !ts.isInterfaceDeclaration(typeDecl)); + var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); var containingMethodDeclaration = ts.getAncestor(callExpression, 156 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); @@ -111476,6 +112485,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addMissingNewOperator"; + var errorCodes = [ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingNewOperator(t, sourceFile, span); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_new_operator_to_call, fixId, ts.Diagnostics.Add_missing_new_operator_to_all_calls)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return addMissingNewOperator(changes, context.sourceFile, diag); + }); }, + }); + function addMissingNewOperator(changes, sourceFile, span) { + var call = ts.cast(findAncestorMatchingSpan(sourceFile, span), ts.isCallExpression); + var newExpression = ts.createNew(call.expression, call.typeArguments, call.arguments); + changes.replaceNode(sourceFile, call, newExpression); + } + function findAncestorMatchingSpan(sourceFile, span) { + var token = ts.getTokenAtPosition(sourceFile, span.start); + var end = ts.textSpanEnd(span); + while (token.end < end) { + token = token.parent; + } + return token; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -111553,10 +112596,10 @@ var ts; var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile); if (!tsconfigObjectLiteral) return undefined; - var compilerOptionsProperty = findProperty(tsconfigObjectLiteral, "compilerOptions"); + var compilerOptionsProperty = codefix.findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); if (!compilerOptionsProperty) { var newCompilerOptions = ts.createObjectLiteral([makeDefaultBaseUrl(), makeDefaultPaths()]); - changes.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment("compilerOptions", newCompilerOptions)); + changes.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, codefix.createJsonPropertyAssignment("compilerOptions", newCompilerOptions)); return defaultTypesDirectoryName; } var compilerOptions = compilerOptionsProperty.initializer; @@ -111568,10 +112611,10 @@ var ts; } var defaultBaseUrl = "."; function makeDefaultBaseUrl() { - return createJsonPropertyAssignment("baseUrl", ts.createStringLiteral(defaultBaseUrl)); + return codefix.createJsonPropertyAssignment("baseUrl", ts.createStringLiteral(defaultBaseUrl)); } function getOrAddBaseUrl(changes, tsconfig, compilerOptions) { - var baseUrlProp = findProperty(compilerOptions, "baseUrl"); + var baseUrlProp = codefix.findJsonProperty(compilerOptions, "baseUrl"); if (baseUrlProp) { return ts.isStringLiteral(baseUrlProp.initializer) ? baseUrlProp.initializer.text : defaultBaseUrl; } @@ -111582,13 +112625,13 @@ var ts; } var defaultTypesDirectoryName = "types"; function makeDefaultPathMapping() { - return createJsonPropertyAssignment("*", ts.createArrayLiteral([ts.createStringLiteral(defaultTypesDirectoryName + "/*")])); + return codefix.createJsonPropertyAssignment("*", ts.createArrayLiteral([ts.createStringLiteral(defaultTypesDirectoryName + "/*")])); } function makeDefaultPaths() { - return createJsonPropertyAssignment("paths", ts.createObjectLiteral([makeDefaultPathMapping()])); + return codefix.createJsonPropertyAssignment("paths", ts.createObjectLiteral([makeDefaultPathMapping()])); } function getOrAddPathMapping(changes, tsconfig, compilerOptions) { - var paths = findProperty(compilerOptions, "paths"); + var paths = codefix.findJsonProperty(compilerOptions, "paths"); if (!paths || !ts.isObjectLiteralExpression(paths.initializer)) { changes.insertNodeAtObjectStart(tsconfig, compilerOptions, makeDefaultPaths()); return defaultTypesDirectoryName; @@ -111604,12 +112647,6 @@ var ts; changes.insertNodeAtObjectStart(tsconfig, paths.initializer, makeDefaultPathMapping()); return defaultTypesDirectoryName; } - function createJsonPropertyAssignment(name, initializer) { - return ts.createPropertyAssignment(ts.createStringLiteral(name), initializer); - } - function findProperty(obj, name) { - return ts.find(obj.properties, function (p) { return ts.isPropertyAssignment(p) && !!p.name && ts.isStringLiteral(p.name) && p.name.text === name; }); - } function getInstallCommand(fileName, packageName) { return { type: "install package", file: fileName, packageName: packageName }; } @@ -111638,9 +112675,9 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var program = context.program, sourceFile = context.sourceFile, span = context.span; + var sourceFile = context.sourceFile, span = context.span; var changes = ts.textChanges.ChangeTracker.with(context, function (t) { - return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t, context.preferences); + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, context, t, context.preferences); }); return changes.length === 0 ? undefined : [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Implement_inherited_abstract_class, fixId, ts.Diagnostics.Implement_all_inherited_abstract_classes)]; }, @@ -111650,7 +112687,7 @@ var ts; return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var classDeclaration = getClass(diag.file, diag.start); if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { - addMissingMembers(classDeclaration, context.sourceFile, context.program.getTypeChecker(), changes, context.preferences); + addMissingMembers(classDeclaration, context.sourceFile, context, changes, context.preferences); } }); }, @@ -111661,13 +112698,14 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); return ts.cast(token.parent, ts.isClassLike); } - function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker, preferences) { + function addMissingMembers(classDeclaration, sourceFile, context, changeTracker, preferences) { var extendsNode = ts.getEffectiveBaseTypeNode(classDeclaration); + var checker = context.program.getTypeChecker(); var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); // Note that this is ultimately derived from a map indexed by symbol names, // so duplicates cannot occur. var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); - codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, context, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files @@ -111766,6 +112804,32 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "enableExperimentalDecorators"; + var errorCodes = [ + ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning.code + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var configFile = context.program.getCompilerOptions().configFile; + if (configFile === undefined) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) { return makeChange(changeTracker, configFile); }); + return [codefix.createCodeFixActionNoFixId(fixId, changes, ts.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; + }, + fixIds: [fixId], + }); + function makeChange(changeTracker, configFile) { + codefix.setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", ts.createTrue()); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -112409,24 +113473,43 @@ var ts; * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. * @returns Empty string iff there are no member insertions. */ - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, preferences, out) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, context, preferences, out) { var classMembers = classDeclaration.symbol.members; for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { var symbol = possiblyMissingSymbols_1[_i]; if (!classMembers.has(symbol.escapedName)) { - addNewNodeForMemberSymbol(symbol, classDeclaration, checker, preferences, out); + addNewNodeForMemberSymbol(symbol, classDeclaration, context, preferences, out); } } } codefix.createMissingMemberNodes = createMissingMemberNodes; + function getModuleSpecifierResolverHost(context) { + return { + directoryExists: context.host.directoryExists ? function (d) { return context.host.directoryExists(d); } : undefined, + fileExists: context.host.fileExists ? function (f) { return context.host.fileExists(f); } : undefined, + getCurrentDirectory: context.host.getCurrentDirectory ? function () { return context.host.getCurrentDirectory(); } : undefined, + readFile: context.host.readFile ? function (f) { return context.host.readFile(f); } : undefined, + useCaseSensitiveFileNames: context.host.useCaseSensitiveFileNames ? function () { return context.host.useCaseSensitiveFileNames(); } : undefined, + getSourceFiles: function () { return context.program.getSourceFiles(); }, + getCommonSourceDirectory: function () { return context.program.getCommonSourceDirectory(); }, + }; + } + function getNoopSymbolTrackerWithResolver(context) { + return { + trackSymbol: ts.noop, + moduleResolverHost: getModuleSpecifierResolverHost(context), + }; + } + codefix.getNoopSymbolTrackerWithResolver = getNoopSymbolTrackerWithResolver; /** * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. */ - function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, preferences, out) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, context, preferences, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } + var checker = context.program.getTypeChecker(); var declaration = declarations[0]; var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration), /*includeTrivia*/ false); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); @@ -112438,7 +113521,7 @@ var ts; case 159 /* SetAccessor */: case 153 /* PropertySignature */: case 154 /* PropertyDeclaration */: - var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(56 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); @@ -112478,13 +113561,14 @@ var ts; break; } function outputMethod(signature, modifiers, name, body) { - var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + var method = signatureToMethodDeclaration(context, signature, enclosingDeclaration, modifiers, name, optional, body); if (method) out(method); } } - function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 156 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + function signatureToMethodDeclaration(context, signature, enclosingDeclaration, modifiers, name, optional, body) { + var program = context.program; + var signatureDeclaration = program.getTypeChecker().signatureToSignatureDeclaration(signature, 156 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -112495,19 +113579,21 @@ var ts; signatureDeclaration.body = body; return signatureDeclaration; } - function createMethodFromCallExpression(context, call, methodName, inJs, makeStatic, preferences, body) { + function createMethodFromCallExpression(context, call, methodName, inJs, makeStatic, preferences, contextNode) { + var body = !ts.isInterfaceDeclaration(contextNode); var typeArguments = call.typeArguments, args = call.arguments, parent = call.parent; var checker = context.program.getTypeChecker(); + var tracker = getNoopSymbolTrackerWithResolver(context); var types = ts.map(args, function (arg) { // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" - return checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg))); + return checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg)), contextNode, /*flags*/ undefined, tracker); }); var names = ts.map(args, function (arg) { return ts.isIdentifier(arg) ? arg.text : ts.isPropertyAccessExpression(arg) ? arg.name.text : undefined; }); var contextualType = checker.getContextualType(call); - var returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, call) || ts.createKeywordTypeNode(120 /* AnyKeyword */); + var returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker) || ts.createKeywordTypeNode(120 /* AnyKeyword */); return ts.createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [ts.createToken(116 /* StaticKeyword */)] : undefined, @@ -112576,7 +113662,9 @@ var ts; } function createStubbedMethodBody(preferences) { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), - /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], + /*typeArguments*/ undefined, + // TODO Handle auto quote preference. + [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))], /*multiline*/ true); } function createVisibilityModifier(flags) { @@ -112588,6 +113676,38 @@ var ts; } return undefined; } + function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) { + var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile); + if (!tsconfigObjectLiteral) + return undefined; + var compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); + if (compilerOptionsProperty === undefined) { + changeTracker.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment("compilerOptions", ts.createObjectLiteral([ + createJsonPropertyAssignment(optionName, optionValue), + ]))); + return; + } + var compilerOptions = compilerOptionsProperty.initializer; + if (!ts.isObjectLiteralExpression(compilerOptions)) { + return; + } + var optionProperty = findJsonProperty(compilerOptions, optionName); + if (optionProperty === undefined) { + changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue)); + } + else { + changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue); + } + } + codefix.setJsonCompilerOptionValue = setJsonCompilerOptionValue; + function createJsonPropertyAssignment(name, initializer) { + return ts.createPropertyAssignment(ts.createStringLiteral(name), initializer); + } + codefix.createJsonPropertyAssignment = createJsonPropertyAssignment; + function findJsonProperty(obj, name) { + return ts.find(obj.properties, function (p) { return ts.isPropertyAssignment(p) && !!p.name && ts.isStringLiteral(p.name) && p.name.text === name; }); + } + codefix.findJsonProperty = findJsonProperty; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -112949,9 +114069,9 @@ var ts; forEachOwnNodeOfFunction(fnAst, function (node) { if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && ts.isPropertyAccessExpression(node.left) && node.left.expression.kind === 100 /* ThisKeyword */) { - var name_6 = node.left.name.text; - if (!ts.isJsPrivate(name_6)) { - ts.getOrUpdate(members, name_6, function () { return ts.createProperty(/*decorators*/ undefined, /*modifiers*/ undefined, name_6, /*questionOrExclamationToken*/ undefined, anyType(), /*initializer*/ undefined); }); + var name_7 = node.left.name.text; + if (!ts.isJsPrivate(name_7)) { + ts.getOrUpdate(members, name_7, function () { return ts.createProperty(/*decorators*/ undefined, /*modifiers*/ undefined, name_7, /*questionOrExclamationToken*/ undefined, anyType(), /*initializer*/ undefined); }); } } }); @@ -113466,7 +114586,7 @@ var ts; }); var namespaceImportName = namespaceNameConflicts ? ts.getUniqueName(preferredName, sourceFile) : preferredName; var neededNamedImports = []; - var _loop_21 = function (element) { + var _loop_23 = function (element) { var propertyName = (element.propertyName || element.name).text; ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) { var access = ts.createPropertyAccess(ts.createIdentifier(namespaceImportName), propertyName); @@ -113485,7 +114605,7 @@ var ts; }; for (var _i = 0, _a = toConvert.elements; _i < _a.length; _i++) { var element = _a[_i]; - _loop_21(element); + _loop_23(element); } changes.replaceNode(sourceFile, toConvert, ts.createNamespaceImport(ts.createIdentifier(namespaceImportName))); if (neededNamedImports.length) { @@ -113880,32 +115000,30 @@ var ts; case 100 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 233 /* LabeledStatement */: - { - var label = node.label; - (seenLabels || (seenLabels = [])).push(label.escapedText); - ts.forEachChild(node, visit); - seenLabels.pop(); - break; - } + case 233 /* LabeledStatement */: { + var label = node.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts.forEachChild(node, visit); + seenLabels.pop(); + break; + } case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: - { - var label = node.label; - if (label) { - if (!ts.contains(seenLabels, label.escapedText)) { - // attempts to jump to label that is not in range to be extracted - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); - } + case 228 /* ContinueStatement */: { + var label = node.label; + if (label) { + if (!ts.contains(seenLabels, label.escapedText)) { + // attempts to jump to label that is not in range to be extracted + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); } - else { - if (!(permittedJumps & (node.kind === 229 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { - // attempt to break or continue in a forbidden context - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); - } - } - break; } + else { + if (!(permittedJumps & (node.kind === 229 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + // attempt to break or continue in a forbidden context + (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } case 201 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; @@ -114717,7 +115835,7 @@ var ts; : ts.getEnclosingBlockScopeContainer(scopes[0]); ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - var _loop_22 = function (i) { + var _loop_24 = function (i) { var scopeUsages = usagesPerScope[i]; // Special case: in the innermost scope, all usages are available. // (The computed value reflects the value at the top-level of the scope, but the @@ -114757,7 +115875,7 @@ var ts; } }; for (var i = 0; i < scopes.length; i++) { - _loop_22(i); + _loop_24(i); } return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations }; function isInGenericContext(node) { @@ -115308,10 +116426,10 @@ var ts; } function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newModuleName) { var checker = program.getTypeChecker(); - var _loop_23 = function (sourceFile) { + var _loop_25 = function (sourceFile) { if (sourceFile === oldFile) return "continue"; - var _loop_24 = function (statement) { + var _loop_26 = function (statement) { forEachImportInStatement(statement, function (importNode) { if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol) return; @@ -115333,12 +116451,12 @@ var ts; }; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - _loop_24(statement); + _loop_26(statement); } }; for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - _loop_23(sourceFile); + _loop_25(sourceFile); } } function getNamespaceLikeImport(node) { @@ -115581,6 +116699,11 @@ var ts; var movedSymbols = new SymbolSet(); var oldImportsNeededByNewFile = new SymbolSet(); var newFileImportsFromOldFile = new SymbolSet(); + var containsJsx = ts.find(toMove, function (statement) { return !!(statement.transformFlags & 4 /* ContainsJsx */); }); + var jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx); + if (jsxNamespaceSymbol) { // Might not exist (e.g. in non-compiling code) + oldImportsNeededByNewFile.add(jsxNamespaceSymbol); + } for (var _i = 0, toMove_1 = toMove; _i < toMove_1.length; _i++) { var statement = toMove_1[_i]; forEachTopLevelDeclaration(statement, function (decl) { @@ -115609,6 +116732,10 @@ var ts; var statement = _c[_b]; if (ts.contains(toMove, statement)) continue; + // jsxNamespaceSymbol will only be set iff it is in oldImportsNeededByNewFile. + if (jsxNamespaceSymbol && !!(statement.transformFlags & 4 /* ContainsJsx */)) { + unusedImportsFromOldFile.delete(jsxNamespaceSymbol); + } forEachReference(statement, checker, function (symbol) { if (movedSymbols.has(symbol)) oldFileImportsFromNewFile.add(symbol); @@ -115616,6 +116743,19 @@ var ts; }); } return { movedSymbols: movedSymbols, newFileImportsFromOldFile: newFileImportsFromOldFile, oldFileImportsFromNewFile: oldFileImportsFromNewFile, oldImportsNeededByNewFile: oldImportsNeededByNewFile, unusedImportsFromOldFile: unusedImportsFromOldFile }; + function getJsxNamespaceSymbol(containsJsx) { + if (containsJsx === undefined) { + return undefined; + } + var jsxNamespace = checker.getJsxNamespace(containsJsx); + // Strictly speaking, this could resolve to a symbol other than the JSX namespace. + // This will produce erroneous output (probably, an incorrectly copied import) but + // is expected to be very rare and easily reversible. + var jsxNamespaceSymbol = checker.resolveName(jsxNamespace, containsJsx, 1920 /* Namespace */, /*excludeGlobals*/ true); + return !!jsxNamespaceSymbol && ts.some(jsxNamespaceSymbol.declarations, isInImport) + ? jsxNamespaceSymbol + : undefined; + } } // Below should all be utilities function isInImport(decl) { @@ -115634,7 +116774,7 @@ var ts; } function isVariableDeclarationInImport(decl) { return ts.isSourceFile(decl.parent.parent.parent) && - decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true); + !!decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true); } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { @@ -116388,8 +117528,8 @@ var ts; SourceFileObject.prototype.getLineStarts = function () { return ts.getLineStarts(this); }; - SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character) { - return ts.getPositionOfLineAndCharacter(this, line, character); + SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character, allowEdits) { + return ts.computePositionOfLineAndCharacter(ts.getLineStarts(this), line, character, this.text, allowEdits); }; SourceFileObject.prototype.getLineEndOfPosition = function (pos) { var line = this.getLineAndCharacterOfPosition(pos).line; @@ -116839,7 +117979,16 @@ var ts; } var useCaseSensitiveFileNames = ts.hostUsesCaseSensitiveFileNames(host); var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - var sourceMapper = ts.getSourceMapper(useCaseSensitiveFileNames, currentDirectory, log, host, function () { return program; }); + var sourceMapper = ts.getSourceMapper({ + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCurrentDirectory: function () { return currentDirectory; }, + getProgram: getProgram, + fileExists: host.fileExists && (function (f) { return host.fileExists(f); }), + readFile: host.readFile && (function (f, encoding) { return host.readFile(f, encoding); }), + getDocumentPositionMapper: host.getDocumentPositionMapper && (function (generatedFileName, sourceFileName) { return host.getDocumentPositionMapper(generatedFileName, sourceFileName); }), + getSourceFileLike: host.getSourceFileLike && (function (f) { return host.getSourceFileLike(f); }), + log: log + }); function getValidSourceFile(fileName) { var sourceFile = program.getSourceFile(fileName); if (!sourceFile) { @@ -116892,15 +118041,7 @@ var ts; writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, fileExists: fileExists, - readFile: function (fileName) { - // stub missing host functionality - var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); - var entry = hostCache && hostCache.getEntryByPath(path); - if (entry) { - return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); - } - return host.readFile && host.readFile(fileName); - }, + readFile: readFile, realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); @@ -116954,6 +118095,15 @@ var ts; !ts.isString(entry) : (!!host.fileExists && host.fileExists(fileName)); } + function readFile(fileName) { + // stub missing host functionality + var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); + var entry = hostCache && hostCache.getEntryByPath(path); + if (entry) { + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); + } + return host.readFile && host.readFile(fileName); + } // Release any files we have acquired in the old program but are // not part of the new program. function onReleaseOldSourceFile(oldSourceFile, oldOptions) { @@ -117165,7 +118315,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function findRenameLocations(fileName, position, findInStrings, findInComments) { + function findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); @@ -117176,7 +118326,7 @@ var ts; }); } else { - return getReferencesWorker(node, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }, ts.FindAllReferences.toRenameLocation); + return getReferencesWorker(node, position, { findInStrings: findInStrings, findInComments: findInComments, providePrefixAndSuffixTextForRename: providePrefixAndSuffixTextForRename, isForRename: true }, function (entry, originalNode, checker) { return ts.FindAllReferences.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false); }); } } function getReferencesAtPosition(fileName, position) { @@ -117600,9 +118750,9 @@ var ts; return ts.stringContains(path, "/node_modules/"); } } - function getRenameInfo(fileName, position) { + function getRenameInfo(fileName, position, options) { synchronizeHostData(); - return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position); + return ts.Rename.getRenameInfo(program, getValidSourceFile(fileName), position, options); } function getRefactorContext(file, positionOrRange, preferences, formatOptions) { var _a = typeof positionOrRange === "number" ? [positionOrRange, undefined] : [positionOrRange.pos, positionOrRange.end], startPosition = _a[0], endPosition = _a[1]; @@ -118860,13 +120010,13 @@ var ts; var _this = this; return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { + LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) { var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position); }); + return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); }); }; - LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { + LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); + return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); }); }; /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {