diff --git a/TS.fsx b/TS.fsx index 882ca6962..755dc8be1 100644 --- a/TS.fsx +++ b/TS.fsx @@ -74,10 +74,10 @@ module Types = member this.Printl content = Printf.kprintf (fun s -> output.Append("\r\n" + this.GetCurIndent() + s) |> ignore) content - + member this.PrintlToStack content = Printf.kprintf (fun s -> stack.Append("\r\n" + this.GetCurIndent() + s) |> ignore) content - + member this.StackIsEmpty () = stack.Length = 0 member this.IncreaseIndent() = curTabCount <- curTabCount + 1 @@ -324,8 +324,8 @@ module Data = type KnownWorkerInterfaceType = JsonProvider<"inputfiles/knownWorkerInterfaces.json", InferTypesFromValues=false> let knownWorkerInterfaces = - File.ReadAllText(Path.Combine(GlobalVars.inputFolder, "knownWorkerInterfaces.json")) - |> KnownWorkerInterfaceType.Parse + File.ReadAllText(Path.Combine(GlobalVars.inputFolder, "knownWorkerInterfaces.json")) + |> KnownWorkerInterfaceType.Parse |> set let GetAllInterfacesByFlavor flavor = @@ -736,8 +736,6 @@ module Emit = let tName = DomTypeToTsType (genericMatch.Groups.[1].Value) let paramName = DomTypeToTsType (genericMatch.Groups.[2].Value) match tName with - | "Promise" -> - "PromiseLike<" + paramName + ">" | _ -> if tName = "Array" then paramName + "[]" else tName + "<" + paramName + ">" @@ -894,7 +892,7 @@ module Emit = | Some pollutor -> "this: " + pollutor.Name + ", " | _ -> "" - let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface) (conflictedMembers: Set) = + let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface) (conflictedMembers: Set) = let emitPropertyFromJson (p: InputJsonType.Root) = let readOnlyModifier = match p.Readonly with @@ -1030,7 +1028,7 @@ module Emit = /// Emit the properties and methods of a given interface let EmitMembers flavor (prefix: string) (emitScope: EmitScope) (i:Browser.Interface) = - let conflictedMembers = + let conflictedMembers = match Map.tryFind i.Name extendConflictsBaseTypes with | Some conflict -> conflict.MemberNames | _ -> [] @@ -1129,7 +1127,7 @@ module Emit = match Map.tryFind iName extendConflictsBaseTypes with | Some _ -> iName + "Base" | _ -> iName - + let processedIName = processIName i.Name if processedIName <> i.Name then Pt.PrintlToStack "interface %s extends %s {" i.Name processedIName @@ -1462,7 +1460,7 @@ module Emit = Pt.Printl "" EmitDictionaries flavor - browser.CallbackInterfaces.Interfaces |> Array.iter EmitCallBackInterface + browser.CallbackInterfaces.Interfaces |> Array.iter EmitCallBackInterface EmitNonCallbackInterfaces flavor // Add missed interface definition from the spec diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index a6b12cedb..7a0776930 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1331,7 +1331,7 @@ interface AudioContextBase extends EventTarget { onstatechange: (this: AudioContext, ev: Event) => any; readonly sampleRate: number; readonly state: string; - close(): PromiseLike; + close(): Promise; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; @@ -1351,14 +1351,14 @@ interface AudioContextBase extends EventTarget { createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; createStereoPanner(): StereoPannerNode; createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike; - resume(): PromiseLike; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; + resume(): Promise; addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } interface AudioContext extends AudioContextBase { - suspend(): PromiseLike; + suspend(): Promise; } declare var AudioContext: { @@ -2076,13 +2076,13 @@ declare var CSSSupportsRule: { } interface Cache { - add(request: RequestInfo): PromiseLike; - addAll(requests: RequestInfo[]): PromiseLike; - delete(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; keys(request?: RequestInfo, options?: CacheQueryOptions): any; - match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; - put(request: RequestInfo, response: Response): PromiseLike; + put(request: RequestInfo, response: Response): Promise; } declare var Cache: { @@ -2091,11 +2091,11 @@ declare var Cache: { } interface CacheStorage { - delete(cacheName: string): PromiseLike; - has(cacheName: string): PromiseLike; + delete(cacheName: string): Promise; + has(cacheName: string): Promise; keys(): any; - match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; - open(cacheName: string): PromiseLike; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; } declare var CacheStorage: { @@ -5716,7 +5716,7 @@ interface HTMLMediaElement extends HTMLElement { * Loads and starts playback of a media resource. */ play(): void; - setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike; + setMediaKeys(mediaKeys: MediaKeys | null): Promise; readonly HAVE_CURRENT_DATA: number; readonly HAVE_ENOUGH_DATA: number; readonly HAVE_FUTURE_DATA: number; @@ -7294,7 +7294,7 @@ interface MSApp { execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; getCurrentPriority(): string; - getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise; getViewId(view: any): any; isTaskScheduledAtPriorityOrHigher(priority: string): boolean; pageHandlesAllApplicationActivations(enabled: boolean): void; @@ -7355,8 +7355,8 @@ declare var MSBlobBuilder: { } interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike; + getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise; + makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise; } declare var MSCredentials: { @@ -7744,7 +7744,7 @@ interface MediaDevices extends EventTarget { ondevicechange: (this: MediaDevices, ev: Event) => any; enumerateDevices(): any; getSupportedConstraints(): MediaTrackSupportedConstraints; - getUserMedia(constraints: MediaStreamConstraints): PromiseLike; + getUserMedia(constraints: MediaStreamConstraints): Promise; addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -7803,15 +7803,15 @@ declare var MediaKeyMessageEvent: { } interface MediaKeySession extends EventTarget { - readonly closed: PromiseLike; + readonly closed: Promise; readonly expiration: number; readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; - close(): PromiseLike; - generateRequest(initDataType: string, initData: any): PromiseLike; - load(sessionId: string): PromiseLike; - remove(): PromiseLike; - update(response: any): PromiseLike; + close(): Promise; + generateRequest(initDataType: string, initData: any): Promise; + load(sessionId: string): Promise; + remove(): Promise; + update(response: any): Promise; } declare var MediaKeySession: { @@ -7833,7 +7833,7 @@ declare var MediaKeyStatusMap: { interface MediaKeySystemAccess { readonly keySystem: string; - createMediaKeys(): PromiseLike; + createMediaKeys(): Promise; getConfiguration(): MediaKeySystemConfiguration; } @@ -7844,7 +7844,7 @@ declare var MediaKeySystemAccess: { interface MediaKeys { createSession(sessionType?: string): MediaKeySession; - setServerCertificate(serverCertificate: any): PromiseLike; + setServerCertificate(serverCertificate: any): Promise; } declare var MediaKeys: { @@ -7983,7 +7983,7 @@ interface MediaStreamTrack extends EventTarget { readonly readonly: boolean; readonly readyState: string; readonly remote: boolean; - applyConstraints(constraints: MediaTrackConstraints): PromiseLike; + applyConstraints(constraints: MediaTrackConstraints): Promise; clone(): MediaStreamTrack; getCapabilities(): MediaTrackCapabilities; getConstraints(): MediaTrackConstraints; @@ -8217,7 +8217,7 @@ interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorConte getGamepads(): Gamepad[]; javaEnabled(): boolean; msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; - requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike; + requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise; vibrate(pattern: number | number[]): boolean; } @@ -8377,7 +8377,7 @@ interface Notification extends EventTarget { declare var Notification: { prototype: Notification; new(title: string, options?: NotificationOptions): Notification; - requestPermission(callback?: NotificationPermissionCallback): PromiseLike; + requestPermission(callback?: NotificationPermissionCallback): Promise; } interface OES_element_index_uint { @@ -8448,8 +8448,8 @@ interface OfflineAudioContextEventMap extends AudioContextEventMap { interface OfflineAudioContext extends AudioContextBase { readonly length: number; oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any; - startRendering(): PromiseLike; - suspend(suspendTime: number): PromiseLike; + startRendering(): Promise; + suspend(suspendTime: number): Promise; addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -8564,8 +8564,8 @@ interface PaymentRequest extends EventTarget { readonly shippingAddress: PaymentAddress | null; readonly shippingOption: string | null; readonly shippingType: string | null; - abort(): PromiseLike; - show(): PromiseLike; + abort(): Promise; + show(): Promise; addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -8576,7 +8576,7 @@ declare var PaymentRequest: { } interface PaymentRequestUpdateEvent extends Event { - updateWith(d: PromiseLike): void; + updateWith(d: Promise): void; } declare var PaymentRequestUpdateEvent: { @@ -8592,7 +8592,7 @@ interface PaymentResponse { readonly payerPhone: string | null; readonly shippingAddress: PaymentAddress | null; readonly shippingOption: string | null; - complete(result?: string): PromiseLike; + complete(result?: string): Promise; toJSON(): any; } @@ -8918,9 +8918,9 @@ declare var ProgressEvent: { } interface PushManager { - getSubscription(): PromiseLike; - permissionState(options?: PushSubscriptionOptionsInit): PromiseLike; - subscribe(options?: PushSubscriptionOptionsInit): PromiseLike; + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; } declare var PushManager: { @@ -8933,7 +8933,7 @@ interface PushSubscription { readonly options: PushSubscriptionOptions; getKey(name: string): ArrayBuffer | null; toJSON(): any; - unsubscribe(): PromiseLike; + unsubscribe(): Promise; } declare var PushSubscription: { @@ -9127,19 +9127,19 @@ interface RTCPeerConnection extends EventTarget { onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any; readonly remoteDescription: RTCSessionDescription | null; readonly signalingState: string; - addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike; + addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; addStream(stream: MediaStream): void; close(): void; - createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike; - createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): PromiseLike; + createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise; getConfiguration(): RTCConfiguration; getLocalStreams(): MediaStream[]; getRemoteStreams(): MediaStream[]; - getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike; + getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise; getStreamById(streamId: string): MediaStream | null; removeStream(stream: MediaStream): void; - setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike; - setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike; + setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; + setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -9245,8 +9245,8 @@ declare var RTCSsrcConflictEvent: { } interface RTCStatsProvider extends EventTarget { - getStats(): PromiseLike; - msGetStats(): PromiseLike; + getStats(): Promise; + msGetStats(): Promise; } declare var RTCStatsProvider: { @@ -9300,7 +9300,7 @@ declare var Range: { interface ReadableStream { readonly locked: boolean; - cancel(): PromiseLike; + cancel(): Promise; getReader(): ReadableStreamReader; } @@ -9310,8 +9310,8 @@ declare var ReadableStream: { } interface ReadableStreamReader { - cancel(): PromiseLike; - read(): PromiseLike; + cancel(): Promise; + read(): Promise; releaseLock(): void; } @@ -11285,10 +11285,10 @@ interface ServiceWorkerContainer extends EventTarget { readonly controller: ServiceWorker | null; oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any; onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any; - readonly ready: PromiseLike; - getRegistration(clientURL?: USVString): PromiseLike; + readonly ready: Promise; + getRegistration(clientURL?: USVString): Promise; getRegistrations(): any; - register(scriptURL: USVString, options?: RegistrationOptions): PromiseLike; + register(scriptURL: USVString, options?: RegistrationOptions): Promise; addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -11324,9 +11324,9 @@ interface ServiceWorkerRegistration extends EventTarget { readonly sync: SyncManager; readonly waiting: ServiceWorker | null; getNotifications(filter?: GetNotificationOptions): any; - showNotification(title: string, options?: NotificationOptions): PromiseLike; - unregister(): PromiseLike; - update(): PromiseLike; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -11561,7 +11561,7 @@ declare var SubtleCrypto: { interface SyncManager { getTags(): any; - register(tag: string): PromiseLike; + register(tag: string): Promise; } declare var SyncManager: { @@ -11975,8 +11975,8 @@ declare var WaveShaperNode: { } interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): PromiseLike; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): PromiseLike; + getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -13469,10 +13469,10 @@ interface AbstractWorker { interface Body { readonly bodyUsed: boolean; - arrayBuffer(): PromiseLike; - blob(): PromiseLike; - json(): PromiseLike; - text(): PromiseLike; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; } interface CanvasPathMethods { @@ -13613,7 +13613,7 @@ interface GlobalEventHandlers { } interface GlobalFetch { - fetch(input: RequestInfo, init?: RequestInit): PromiseLike; + fetch(input: RequestInfo, init?: RequestInit): Promise; } interface HTMLTableAlignment { @@ -14870,7 +14870,7 @@ declare var onwheel: (this: Window, ev: WheelEvent) => any; declare var indexedDB: IDBFactory; declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; -declare function fetch(input: RequestInfo, init?: RequestInit): PromiseLike; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void; declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; type AAGUID = string; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 29bfc29af..a3d174697 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -168,13 +168,13 @@ declare var Blob: { } interface Cache { - add(request: RequestInfo): PromiseLike; - addAll(requests: RequestInfo[]): PromiseLike; - delete(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; + add(request: RequestInfo): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo, options?: CacheQueryOptions): Promise; keys(request?: RequestInfo, options?: CacheQueryOptions): any; - match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; matchAll(request?: RequestInfo, options?: CacheQueryOptions): any; - put(request: RequestInfo, response: Response): PromiseLike; + put(request: RequestInfo, response: Response): Promise; } declare var Cache: { @@ -183,11 +183,11 @@ declare var Cache: { } interface CacheStorage { - delete(cacheName: string): PromiseLike; - has(cacheName: string): PromiseLike; + delete(cacheName: string): Promise; + has(cacheName: string): Promise; keys(): any; - match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike; - open(cacheName: string): PromiseLike; + match(request: RequestInfo, options?: CacheQueryOptions): Promise; + open(cacheName: string): Promise; } declare var CacheStorage: { @@ -746,7 +746,7 @@ interface Notification extends EventTarget { declare var Notification: { prototype: Notification; new(title: string, options?: NotificationOptions): Notification; - requestPermission(callback?: NotificationPermissionCallback): PromiseLike; + requestPermission(callback?: NotificationPermissionCallback): Promise; } interface Performance { @@ -862,9 +862,9 @@ declare var ProgressEvent: { } interface PushManager { - getSubscription(): PromiseLike; - permissionState(options?: PushSubscriptionOptionsInit): PromiseLike; - subscribe(options?: PushSubscriptionOptionsInit): PromiseLike; + getSubscription(): Promise; + permissionState(options?: PushSubscriptionOptionsInit): Promise; + subscribe(options?: PushSubscriptionOptionsInit): Promise; } declare var PushManager: { @@ -877,7 +877,7 @@ interface PushSubscription { readonly options: PushSubscriptionOptions; getKey(name: string): ArrayBuffer | null; toJSON(): any; - unsubscribe(): PromiseLike; + unsubscribe(): Promise; } declare var PushSubscription: { @@ -897,7 +897,7 @@ declare var PushSubscriptionOptions: { interface ReadableStream { readonly locked: boolean; - cancel(): PromiseLike; + cancel(): Promise; getReader(): ReadableStreamReader; } @@ -907,8 +907,8 @@ declare var ReadableStream: { } interface ReadableStreamReader { - cancel(): PromiseLike; - read(): PromiseLike; + cancel(): Promise; + read(): Promise; releaseLock(): void; } @@ -986,9 +986,9 @@ interface ServiceWorkerRegistration extends EventTarget { readonly sync: SyncManager; readonly waiting: ServiceWorker | null; getNotifications(filter?: GetNotificationOptions): any; - showNotification(title: string, options?: NotificationOptions): PromiseLike; - unregister(): PromiseLike; - update(): PromiseLike; + showNotification(title: string, options?: NotificationOptions): Promise; + unregister(): Promise; + update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -1000,7 +1000,7 @@ declare var ServiceWorkerRegistration: { interface SyncManager { getTags(): any; - register(tag: string): PromiseLike; + register(tag: string): Promise; } declare var SyncManager: { @@ -1130,14 +1130,14 @@ interface AbstractWorker { interface Body { readonly bodyUsed: boolean; - arrayBuffer(): PromiseLike; - blob(): PromiseLike; - json(): PromiseLike; - text(): PromiseLike; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; } interface GlobalFetch { - fetch(input: RequestInfo, init?: RequestInit): PromiseLike; + fetch(input: RequestInfo, init?: RequestInit): Promise; } interface MSBaseReaderEventMap { @@ -1234,10 +1234,10 @@ declare var Client: { } interface Clients { - claim(): PromiseLike; - get(id: string): PromiseLike; + claim(): Promise; + get(id: string): Promise; matchAll(options?: ClientQueryOptions): any; - openWindow(url: USVString): PromiseLike; + openWindow(url: USVString): Promise; } declare var Clients: { @@ -1263,7 +1263,7 @@ declare var DedicatedWorkerGlobalScope: { } interface ExtendableEvent extends Event { - waitUntil(f: PromiseLike): void; + waitUntil(f: Promise): void; } declare var ExtendableEvent: { @@ -1288,7 +1288,7 @@ interface FetchEvent extends ExtendableEvent { readonly clientId: string | null; readonly isReload: boolean; readonly request: Request; - respondWith(r: PromiseLike): void; + respondWith(r: Promise): void; } declare var FetchEvent: { @@ -1363,7 +1363,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope { onpushsubscriptionchange: (this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any; onsync: (this: ServiceWorkerGlobalScope, ev: SyncEvent) => any; readonly registration: ServiceWorkerRegistration; - skipWaiting(): PromiseLike; + skipWaiting(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -1386,8 +1386,8 @@ declare var SyncEvent: { interface WindowClient extends Client { readonly focused: boolean; readonly visibilityState: string; - focus(): PromiseLike; - navigate(url: USVString): PromiseLike; + focus(): Promise; + navigate(url: USVString): Promise; } declare var WindowClient: { @@ -1715,7 +1715,7 @@ declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; declare var console: Console; -declare function fetch(input: RequestInfo, init?: RequestInit): PromiseLike; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function dispatchEvent(evt: Event): boolean; declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;